output,xwayland: Add support for _NET_WM_STRUT_PARTIAL

Account for space taken up by XWayland panels (as indicated by the
_NET_WM_STRUT_PARTIAL property) in the usable_area calculation.

This makes it possible to use labwc in a "transitional" setup, where it
replaces the X11 window manager and compositor, but most other parts of
a existing X11 desktop environment can still be used via XWayland.

(Some remaining drawbacks of such a setup would be the lack of desktop
icons, and native Wayland clients not showing up in X11-based taskbars.)
This commit is contained in:
John Lindgren 2022-11-22 05:11:50 -05:00 committed by Johan Malm
parent a9076f2a01
commit 0a5255f062
3 changed files with 129 additions and 0 deletions

View file

@ -603,6 +603,16 @@ update_usable_area(struct output *output)
struct wlr_box old = output->usable_area;
layers_arrange(output);
#if HAVE_XWAYLAND
struct view *view;
wl_list_for_each(view, &output->server->views, link) {
if (view->mapped && view->type == LAB_XWAYLAND_VIEW) {
xwayland_adjust_usable_area(view,
output->server->output_layout,
output->wlr_output, &output->usable_area);
}
}
#endif
return !wlr_box_equal(&old, &output->usable_area);
}