After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710346 - Give external developers some way of watching out for the Guard Window
Give external developers some way of watching out for the Guard Window
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-17 01:28 UTC by A. Walton
Modified: 2013-10-17 12:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description A. Walton 2013-10-17 01:28:39 UTC
The way the code currently is, Mutter creates a "Guard Window" that it hides windows behind so that it can still do things like window previews for minimized windows. And that's fine, but it does so in a pretty inconvenient manner for external tools that have to handle window management while working with the existing window manager:

* The window has no title, so we can't filter it out based on title.
* The window is the size of the screen rect, so we could theoretically filter on that, but then you get other screen-sized windows that you don't want to filter out.
* The window is an override redirect/popup-style window, which confuses our software into thinking it should always be considered.

This is bad. We could handle it by checking to see if all of these things are true, but then some random media player comes along and hoses our hack. The most straight forward solution to the problem is to simply set some property on the window that we can look for and filter it out directly. And the easiest one for us to handle is simply naming the window.

The one-liner fix would be
diff --git a/src/core/screen.c b/src/core/screen.c
index 5efc65a..7f69164 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -475,6 +475,7 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
                   CopyFromParent, /* visual */
                   CWEventMask|CWOverrideRedirect|CWBackPixel,
                   &attributes);
+  XStoreName (xdisplay, guard_window, "mutter guard window");
 
   {
     unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-10-17 01:30:48 UTC
Out of curiosity, what window management software are you writing?