xwayland: set _NET_WORKAREA property based on usable area

XWayland clients use the _NET_WORKAREA root window property to determine
how much of the screen is not covered by panels/docks. The property is
used for example by Qt to determine areas of the screen that popup menus
should not overlap (see QScreen::availableVirtualGeometry).

Depends on wlroots MR:
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4406

v2: prevent calling wlr_xwayland_set_workareas() too early
v3: fix segfault at exit (server->xwayland == NULL)
This commit is contained in:
John Lindgren 2023-10-24 13:49:15 -04:00 committed by Johan Malm
parent 5a2df57363
commit 6b8c79748a
3 changed files with 89 additions and 0 deletions

View file

@ -24,6 +24,7 @@
#include "node.h"
#include "regions.h"
#include "view.h"
#include "xwayland.h"
static void
output_frame_notify(struct wl_listener *listener, void *data)
@ -610,6 +611,9 @@ output_update_usable_area(struct output *output)
{
if (update_usable_area(output)) {
regions_update_geometry(output);
#if HAVE_XWAYLAND
xwayland_update_workarea(output->server);
#endif
desktop_arrange_all_views(output->server);
}
}
@ -629,6 +633,9 @@ output_update_all_usable_areas(struct server *server, bool layout_changed)
}
}
if (usable_area_changed || layout_changed) {
#if HAVE_XWAYLAND
xwayland_update_workarea(server);
#endif
desktop_arrange_all_views(server);
}
}