x11: add missing checks that a hint is supported
Before acting on any hint that is set by the window manager we must first check that the hint is supported by the current window manager. Checking that a property has a value is insufficient as it may have been set by a previous window manager which did support the hint. https://bugzilla.gnome.org/show_bug.cgi?id=691515
This commit is contained in:
committed by
Matthias Clasen
parent
246438812a
commit
2fcbe3a9b4
@ -280,6 +280,10 @@ get_current_desktop (GdkScreen *screen)
|
||||
unsigned char *data_return = NULL;
|
||||
int workspace = 0;
|
||||
|
||||
if (!gdk_x11_screen_supports_net_wm_hint (screen,
|
||||
gdk_atom_intern_static_string ("_NET_CURRENT_DESKTOP")))
|
||||
return workspace;
|
||||
|
||||
display = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
|
||||
win = XRootWindow (display, GDK_SCREEN_XNUMBER (screen));
|
||||
|
||||
@ -330,6 +334,10 @@ get_work_area (GdkScreen *screen,
|
||||
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;
|
||||
|
||||
|
||||
@ -1738,7 +1738,9 @@ static void
|
||||
move_to_current_desktop (GdkWindow *window)
|
||||
{
|
||||
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_WM_DESKTOP")))
|
||||
gdk_atom_intern_static_string ("_NET_WM_DESKTOP")) &&
|
||||
gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_CURRENT_DESKTOP")))
|
||||
{
|
||||
Atom type;
|
||||
gint format;
|
||||
@ -2717,7 +2719,9 @@ gdk_x11_window_get_frame_extents (GdkWindow *window,
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
|
||||
/* first try: use _NET_FRAME_EXTENTS */
|
||||
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
||||
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_FRAME_EXTENTS")) &&
|
||||
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
||||
gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_FRAME_EXTENTS"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type_return,
|
||||
@ -2764,7 +2768,9 @@ gdk_x11_window_get_frame_extents (GdkWindow *window,
|
||||
/* use NETWM_VIRTUAL_ROOTS if available */
|
||||
root = GDK_WINDOW_XROOTWIN (window);
|
||||
|
||||
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root,
|
||||
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_VIRTUAL_ROOTS")) &&
|
||||
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root,
|
||||
gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_VIRTUAL_ROOTS"),
|
||||
0, G_MAXLONG, False, XA_WINDOW, &type_return,
|
||||
|
||||
Reference in New Issue
Block a user