gnome-desktop r5425 - trunk/libgnome-desktop



Author: federico
Date: Fri Mar  6 20:37:27 2009
New Revision: 5425
URL: http://svn.gnome.org/viewvc/gnome-desktop?rev=5425&view=rev

Log:
Grab the X server while tweaking the RANDR configuration

Signed-off-by: Federico Mena Quintero <federico novell com>

Modified:
   trunk/libgnome-desktop/ChangeLog
   trunk/libgnome-desktop/gnome-rr-config.c

Modified: trunk/libgnome-desktop/gnome-rr-config.c
==============================================================================
--- trunk/libgnome-desktop/gnome-rr-config.c	(original)
+++ trunk/libgnome-desktop/gnome-rr-config.c	Fri Mar  6 20:37:27 2009
@@ -34,6 +34,10 @@
 #undef GNOME_DISABLE_DEPRECATED
 #include "libgnomeui/gnome-rr-config.h"
 #include "edid.h"
+#include <X11/Xlib.h>
+#include <X11/extensions/Xrandr.h>
+#include <gdk/gdkx.h>
+#include "gnome-rr-private.h"
 
 #define CONFIG_INTENDED_BASENAME "monitors.xml"
 #define CONFIG_BACKUP_BASENAME "monitors.xml.backup"
@@ -1616,6 +1620,13 @@
     height = MIN (max_height, height);
 
     /* FMQ: do we need to check the sizes instead of clamping them? */
+
+    /* Grab the server while we fiddle with the CRTCs and the screen, so that
+     * apps that listen for RANDR notifications will only receive the final
+     * status.
+     */
+
+    gdk_x11_display_grab (gdk_screen_get_display (assign->screen->gdk_screen));
     
     /* Turn off all crtcs that are currently displaying outside the new screen,
      * or are not used in the new setup
@@ -1676,5 +1687,7 @@
 	success = !state.has_error;
     }
 
+    gdk_x11_display_ungrab (gdk_screen_get_display (assign->screen->gdk_screen));
+
     return success;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]