First cut at a cross-"platform" X11/Wayland windowing library

Brian Tarricone brian at tarricone.org
Thu Sep 22 02:12:24 CEST 2022


Hi all,

Completely untested, but I threw together a sort of "cross-windowing-environment" start of a wnck-like library, just to see what it might look like.  So far it just supports enumerating workspaces on both X11 (using libwnck) and Wayland (using the not-quite-yet-official ext-workspace-v1 protocol), and getting signals when workspaces are added, removed, and activated.  There's also a dummy impl that just advertises a single workspace, for cases where we're not on X11 and the Wayland compositor doesn't support workspaces.  It's missing a bunch of things, including documentation, but hopefully a glance at the headers (xfw-workspace-manager.h & xfw-workspace.h are the public API interfaces) is enough to get an idea how it works.

My next thought would be to copy over Gaƫl's work from[1] on the Wayland foreign toplevel protocol as the Wayland version of WnckWindow.

One thing I realized is that on Wayland there doesn't appear to be a way to get the list of toplevels on each workspace.  There's no "glue" between the workspace protocol and the foreign toplevel protocol.  That would presumably require some engagement with the people who maintain those protocols in order to fix it, but in the meantime I think it's fine to just pretend that every workspace on Wayland has every toplevel window.  Not ideal, but the best we can do for now.

Another issue is that the Wayland workspaces protocol has the concept of "workspace groups".  The idea -- I think -- is that in a multi-monitor setup, you can have completely independent sets of workspaces per monitor.  My API doesn't account for that, and just flattens all workspace groups into a single "namespace", but it probably makes sense to represent those faithfully, and on the X11 backend it'd just have a single workspace group that contains all workspaces.

     -brian

[0] https://gitlab.xfce.org/kelnos/libxfce4windowing
[1] https://gitlab.xfce.org/xfce/xfce4-panel/-/merge_requests/96


More information about the Xfce4-dev mailing list