Re: xfwm4-wayland: use wlr-scene API
adlo <[email protected]> Tue, 4 Apr 2023 08:32:03 +0100
| Newsgroups | gmane.comp.freedesktop.wayland.devel,gmane.comp.desktop.xfce.devel.version4 |
|---|---|
| Message-ID | <[email protected]> |
Correction: the View struct is in src/wayland/output.h, not view.h > On 4 Apr 2023, at 08:07, adlo <[email protected]> wrote: > > If I use my View struct (src/wayland/view.h), everything is fine. But if I try to copy the contents of the View struct into the Client struct (src/client.h) and use the Client struct to hold data about my view instead of the View struct, so every instance of View is replaced with Client, my compositor segfaults at src/wayland/xdg_shell.c line 170 when I close the last window on the screen. (I think it was that line, I don't have the backtrace to hand.) > > I did some experimentation and copied my entire View struct into client.h and it still seemed to work. I think it also starts working if I make the Client struct smaller. So I think maybe it's got something to do with the size of the struct. > > What's going on? > > Regards > adlo > >> On 31 Mar 2023, at 12:44, adlo <[email protected]> wrote: >> I have rewritten my Wayland port of xfwm4 for the third or fourth time. >> >> I kept adding thousands of lines of code and then scrapping it, so the >> commit history was getting full of scrapped code, so I decided to reset >> to master and start from scratch. >> >> I have created a new wayland-2 branch. At some point I may rename this >> branch to wayland and rename the old wayland branch to wayland-old or >> something. >> >> My compositor now uses the wlr-scene API, which handles a lot of the >> low-level stuff for you, such as rendering and damage tracking, which >> makes the code much simpler to write and more easily maintainable. >> >> I have now moved the Wayland compositor code into the original xfwm4 >> binary, so the Wayland compositor and X11 version are now in one >> binary. >> >> You can run the Wayland compositor with the command xfwm4 --wayland >> >> You can find the repo here: >> https://github.com/adlocode/xfwm4/tree/wayland-2 >> >> Regards >> adlo