xwayland: Change layer for xwayland override redirect windows

Our positioning of override redirect windows falls apart when an
app is on the fullscreen layer, because we end up putting its
menus and tooltips beneath it. This patch raises the special
override redirect layer to be just below things like on-screen
keyboards (and, unfortunately, above things like panels).

There is no perfect way to deal with this problem, especially
for content like tooltips that don't come with transience hints.

In some cases override redirect menus could be better placed by
using the parenting/transience information provided with them
at map time, and we should probably do that at some point, but
that would still leave us with tooltips below full screen
applications, and the need for this layer change.

based on a patch
Co-authored-by: Hideyuki Nagase <hideyukn@microsoft.com>
Co-authored-by: Steve Pronovost <spronovo@microsoft.com>
Co-authored-by: Brenton DeGeer <brdegeer@microsoft.com>

I changed the layer position and the comments, so:
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
dev
Hideyuki Nagase 3 years ago committed by Pekka Paalanen
parent 0df0dccc84
commit e4100f856d
  1. 17
      libweston/desktop/xwayland.c

@ -444,10 +444,21 @@ weston_desktop_xwayland_init(struct weston_desktop *desktop)
xwayland->client = weston_desktop_client_create(desktop, NULL, NULL, NULL, NULL, 0, 0);
weston_layer_init(&xwayland->layer, compositor);
/* We put this layer on top of regular shell surfaces, but hopefully
* below any UI the shell would add */
/* This is the layer we use for override redirect "windows", which
* ends up used for tooltips and drop down menus, among other things.
* Previously this was WESTON_LAYER_POSITION_NORMAL + 1, but this is
* below the fullscreen layer, so fullscreen apps would be above their
* menus and tooltips.
*
* Moving this to just below the TOP_UI layer ensures visibility at all
* times, with the minor drawback that they could be rendered above
* DESKTOP_UI.
*
* For tooltips with no transient window hints, this is probably the best
* we can do.
*/
weston_layer_set_position(&xwayland->layer,
WESTON_LAYER_POSITION_NORMAL + 1);
WESTON_LAYER_POSITION_TOP_UI - 1);
compositor->xwayland = xwayland;
compositor->xwayland_interface = &weston_desktop_xwayland_interface;

Loading…
Cancel
Save