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 691515 - Insufficient checks for EWMH support
Insufficient checks for EWMH support
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-01-11 03:43 UTC by Geoff Reedy
Modified: 2013-01-18 02:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to add missing checks (3.44 KB, patch)
2013-01-11 03:43 UTC, Geoff Reedy
accepted-commit_now Details | Review

Description Geoff Reedy 2013-01-11 03:43:40 UTC
Created attachment 233200 [details] [review]
patch to add missing checks

There were a few places where EWMH hints were used without checking that the current window manager supports the hint. A property may have a value set by a previous window manager and thus does not match the state of the current window manager. On my system, this led to the problems of bug 683333 and bug 689030. There was a _NET_WORKAREA property on the root window, but it was from the metacity that gdm was running, not from my window manager (xmonad).

The attached patch guards the use of _NET_CURRENT_DESKTOP, _NET_WORKAREA, _NET_CURRENT_DESKTOP, _NET_FRAME_EXTENTS, and _NET_VIRTUAL_ROOTS. Before this patch goes in, someone should probably verify that common window managers include these hints in _NET_SUPPORTED if they do indeed support them.
Comment 1 Matthias Clasen 2013-01-11 19:52:59 UTC
Review of attachment 233200 [details] [review]:

Makes sense
Comment 2 Geoff Reedy 2013-01-13 04:28:43 UTC
This should get backported to the 3.4 and 3.6 branches too.
Comment 3 Geoff Reedy 2013-01-13 04:34:39 UTC
Oh, and 3.0 and 3.2, but they only need the gdkwindow fixes (the problematic gdkscreen functions aren't in these versions)
Comment 4 Paul Menzel 2013-01-16 10:53:51 UTC
In the Debian bug tracking system bug report #681974 [1] describes this problem.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681974
Comment 5 Paul Menzel 2013-01-16 12:29:35 UTC
Geoff,

  […]
  display = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
  disp_screen = GDK_SCREEN_XNUMBER (screen);
  workarea = XInternAtom (display, "_NET_WORKAREA", True);

  /* Defaults in case of error */
  area->x = 0;
  area->y = 0;
  area->width = gdk_screen_get_width (screen);
  area->height = gdk_screen_get_height (screen);

  if (!gdk_x11_screen_supports_net_wm_hint (screen,
                                            gdk_atom_intern_static_string ("_NET_WORKAREA")))
    return;

  if (workarea == None)
    return;
  […]

1. Why is your check not added before the following line?

    workarea = XInternAtom (display, "_NET_WORKAREA", True);

2. Why was the check `workarea == None` not enough? Should `XInternAtom (display, "_NET_WORKAREA", True);` be called with `False`? Reading the documentation [1] I am not sure what happens, if the workarea does not exist and `True` is passed.

[1] http://www.tronche.com/gui/x/xlib/window-information/XInternAtom.html
Comment 6 Matthias Clasen 2013-01-17 14:29:25 UTC
Paul, feel free to commit this on the 3.4 branch.
Comment 7 Matthias Clasen 2013-01-18 02:13:54 UTC
cherry-picked to both 3.6 and 3.4