[gnome-desktop/randr-hotplug: 1/9] Only select for RRScreenChangeNotifyMask, not for the more detailed RANDR 1.2 events
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-desktop/randr-hotplug: 1/9] Only select for RRScreenChangeNotifyMask, not for the more detailed RANDR 1.2 events
- Date: Mon, 8 Jun 2009 20:44:44 -0400 (EDT)
commit 2290fde44cb2b39aab3e094743aaf5571e3f0dbd
Author: Federico Mena Quintero <federico novell com>
Date: Mon Jun 8 19:00:33 2009 -0500
Only select for RRScreenChangeNotifyMask, not for the more detailed RANDR 1.2 events
We don't care about property changes on outputs, as we only handle the
EDID_DATA property. That property isn't likely to change on an
output, anyway.
Then, we don't do anything special when an individual output or CRTC
changes. We just care if the screen layout changed in general; in
that case, we simply re-probe the outputs and call the caller's
callback. The X server will emit RRScreenChangeNotify in conjunction
with the more detailed events, anyway, so we are guaranteed to know
when things change.
Signed-off-by: Federico Mena Quintero <federico novell com>
---
libgnome-desktop/gnome-rr.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c
index 0b95e3a..4debe2e 100644
--- a/libgnome-desktop/gnome-rr.c
+++ b/libgnome-desktop/gnome-rr.c
@@ -502,6 +502,21 @@ screen_on_event (GdkXEvent *xevent,
*/
screen_update (screen, TRUE, TRUE, NULL); /* NULL-GError */
}
+#if 0
+ /* WHY THIS CODE IS DISABLED:
+ *
+ * Note that in gnome_rr_screen_new(), we only select for
+ * RRScreenChangeNotifyMask. We used to select for other values in
+ * RR*NotifyMask, but we weren't really doing anything useful with those
+ * events. We only care about "the screens changed in some way or another"
+ * for now.
+ *
+ * If we ever run into a situtation that could benefit from processing more
+ * detailed events, we can enable this code again.
+ *
+ * Note that the X server sends RRScreenChangeNotify in conjunction with the
+ * more detailed events from RANDR 1.2 - see xserver/randr/randr.c:TellChanged().
+ */
else if (event_num == RRNotify)
{
/* Other RandR events */
@@ -522,6 +537,7 @@ screen_on_event (GdkXEvent *xevent,
/* No need to reprobe hardware here */
screen_update (screen, TRUE, FALSE, NULL); /* NULL-GError */
}
+#endif
/* Pass the event on to GTK+ */
return GDK_FILTER_CONTINUE;
@@ -570,10 +586,8 @@ gnome_rr_screen_new (GdkScreen *gdk_screen,
XRRSelectInput (screen->xdisplay,
screen->xroot,
- RRScreenChangeNotifyMask |
- RRCrtcChangeNotifyMask |
- RROutputPropertyNotifyMask);
-
+ RRScreenChangeNotifyMask);
+
gdk_x11_register_standard_event_type (
gdk_screen_get_display (gdk_screen),
event_base,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]