xfwm4-wayland: use wlr-scene API

adlo adloconwy at gmail.com
Tue Apr 4 07:07:03 UTC 2023

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?


> On 31 Mar 2023, at 12:44, adlo <adloconwy at gmail.com> 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

More information about the wayland-devel mailing list