Override redirect windows with keyboard grabs on Xwayland

Olivier Fourdan ofourdan at redhat.com
Mon Jul 4 07:10:10 UTC 2016


Hey Adam,

> This feels a lot like any other "app wants attention" case where you
> should just get a pulsing button or bouncing icon in the taskbar. The
> o-r window might be mapped and focused from Xwayland's perspective but
> there's nothing compelling wayland to actually show or focus it
> promptly, you know it's o-r, you know it's full-screen sized, and you
> have control of the display so when you _do_ put it up you can vignette
> it and add a Get Me Out Of Here checkbox in the upper-right or
> whatever.

That mechanism would probably not work as is with O-R windows for a couple of reasons:

 - the WM is not supposed to manage O-R windows (well, a compositor has of course, but the WM doesn't get a MapRequest and most WM will do as little as possible with O-R).

 - O-R are not listed in the window list so even if the compositor would have set the demand attention flag, the shell would probably ignore it.

Besides, what happens here is that O-R is already covering the entire screen (thus most likely cover any shell notification as well), and it feels natural for the user to start typing as the screen is covered and a nice text input is displayed :)
 
> I guess the thing you don't really get is a GrabNotify to let the wm
> know what's going on, though maybe you could infer it from FocusOut.
> There also appears to be no "wants attention" request in any wayland
> protocol, which is perhaps suboptimal. But if we had that, xserver
> could just emit that when an active grab fires, and then once the
> window gets focus the grab works just as well as it ever would.

We do (well, in gtk-shell no not strictly standard) have a "present" protocol that allows a Wayland client to ask the compositor to raise and focus a surface, we could use this with Xwayland to achieve that, but I suspect mutter would most likely deny such request on O-R (and being gtk-shell, that wouldn't work with any other compositor).

Thing is, weston seems to do this right so there should be a way to achieve that in mutter as well.

The approach I took in my patch for GNOME bug https://bugzilla.gnome.org/show_bug.cgi?id=752956 is to not deny focus for O-R that are fullscreen (either on a single monitor or the whole screen):

https://bugzilla.gnome.org/attachment.cgi?id=330053&action=diff

It does fix the issue, but I am not sure this can be acceptable in GNOME.

Cheers,
Olivier


More information about the xorg-devel mailing list