summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@ubuntu.com>2010-05-06 15:51:14 -0500
committerFederico Mena Quintero <federico@novell.com>2010-05-06 15:51:49 -0500
commitd5e0550961e337a8ce08e41534bd26f7daab79be (patch)
treed20ad6c9858aa01d4e9950c976b9827a20a65b60
parenteef5fa202f000a43522f8fa9ed9a28249e5c4511 (diff)
downloadgnome-settings-daemon-d5e0550961e337a8ce08e41534bd26f7daab79be.tar.gz
bgo#610482 - Adjust XF86Display timestamps if they are out of order with RANDR timestamps
Some laptops seem to send XF86Display keypress events when you unsuspend them, probably as a way to 'make Windows work'. For some reason these events come with timestamps that are out of order with respect to the RANDR timestamps. So we'll adjust the keypress timestamps so that the events can be processed. Signed-off-by: Federico Mena Quintero <federico@novell.com>
-rw-r--r--plugins/xrandr/gsd-xrandr-manager.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index e78eb6b1..bcaa53be 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -988,6 +988,8 @@ handle_fn_f7 (GsdXrandrManager *mgr, guint32 timestamp)
gnome_rr_config_free (current);
if (priv->fn_f7_configs) {
+ guint32 server_timestamp;
+
mgr->priv->current_fn_f7_config++;
if (priv->fn_f7_configs[mgr->priv->current_fn_f7_config] == NULL)
@@ -999,6 +1001,22 @@ handle_fn_f7 (GsdXrandrManager *mgr, guint32 timestamp)
g_debug ("applying");
+ /* See https://bugzilla.gnome.org/show_bug.cgi?id=610482
+ *
+ * Sometimes we'll get two rapid XF86Display keypress events,
+ * but their timestamps will be out of order with respect to the
+ * RANDR timestamps. This *may* be due to stupid BIOSes sending
+ * out display-switch keystrokes "to make Windows work".
+ *
+ * The X server will error out if the timestamp provided is
+ * older than a previous change configuration timestamp. We
+ * assume here that we do want this event to go through still,
+ * since kernel timestamps may be skewed wrt the X server.
+ */
+ gnome_rr_screen_get_timestamps (screen, NULL, &server_timestamp);
+ if (timestamp < server_timestamp)
+ timestamp = server_timestamp;
+
apply_configuration_and_display_error (mgr, priv->fn_f7_configs[mgr->priv->current_fn_f7_config], timestamp);
}
else {