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:
		 Geoff Reedy
					Geoff Reedy
				
			
				
					committed by
					
						 Matthias Clasen
						Matthias Clasen
					
				
			
			
				
	
			
			
			 Matthias Clasen
						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; | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user