[gnome-settings-daemon/gnome-3-8] media-keys: Work-around launched apps not getting focused
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-8] media-keys: Work-around launched apps not getting focused
- Date: Fri, 26 Jul 2013 18:05:03 +0000 (UTC)
commit 5ed4d73797d11b97ecaf614c3006dff4cdd4a8a6
Author: Bastien Nocera <hadess hadess net>
Date: Thu Jul 25 15:22:12 2013 +0200
media-keys: Work-around launched apps not getting focused
Get a timestamp from the root window to launch applications.
This should work-around applications not getting focused
correctly when launched.
https://bugzilla.gnome.org/show_bug.cgi?id=701273
plugins/media-keys/gsd-media-keys-manager.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 93cf14e..fd3bcda 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2104,6 +2104,17 @@ do_action (GsdMediaKeysManager *manager,
return FALSE;
}
+static guint
+get_timestamp (void)
+{
+ GdkWindow *window;
+ GdkDisplayManager *manager;
+
+ manager = gdk_display_manager_get ();
+ window = gdk_x11_window_lookup_for_display (gdk_display_manager_get_default_display(manager),
GDK_ROOT_WINDOW());
+ return gdk_x11_get_server_time (window);
+}
+
static void
on_accelerator_activated (ShellKeyGrabber *grabber,
guint accel_id,
@@ -2111,6 +2122,7 @@ on_accelerator_activated (ShellKeyGrabber *grabber,
GsdMediaKeysManager *manager)
{
guint i;
+ guint timestamp;
for (i = 0; i < manager->priv->keys->len; i++) {
MediaKey *key;
@@ -2120,10 +2132,12 @@ on_accelerator_activated (ShellKeyGrabber *grabber,
if (key->accel_id != accel_id)
continue;
+ timestamp = get_timestamp ();
+
if (key->key_type == CUSTOM_KEY)
- do_custom_action (manager, deviceid, key, GDK_CURRENT_TIME);
+ do_custom_action (manager, deviceid, key, timestamp);
else
- do_action (manager, deviceid, key->key_type, GDK_CURRENT_TIME);
+ do_action (manager, deviceid, key->key_type, timestamp);
return;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]