[gnome-settings-daemon] locate-pointer: Remove support for multiple X screens
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] locate-pointer: Remove support for multiple X screens
- Date: Mon, 26 May 2014 16:10:24 +0000 (UTC)
commit cf677a9c47d868b0bdae026b9d0db36df75f9dac
Author: Rui Matos <tiagomatos gmail com>
Date: Thu May 22 21:34:46 2014 +0200
locate-pointer: Remove support for multiple X screens
Support for this has been removed from mutter and gtk+ so there's no
point in having it here.
https://bugzilla.gnome.org/show_bug.cgi?id=730765
plugins/mouse/gsd-locate-pointer.c | 94 +++++++++++++++--------------------
1 files changed, 40 insertions(+), 54 deletions(-)
---
diff --git a/plugins/mouse/gsd-locate-pointer.c b/plugins/mouse/gsd-locate-pointer.c
index 7113666..4cea055 100644
--- a/plugins/mouse/gsd-locate-pointer.c
+++ b/plugins/mouse/gsd-locate-pointer.c
@@ -424,14 +424,16 @@ set_locate_pointer (void)
{
GdkKeymapKey *keys;
GdkDisplay *display;
- int n_screens;
+ GdkScreen *screen;
+ Window xroot;
int n_keys;
gboolean has_entries;
static const guint keyvals[] = { GDK_KEY_Control_L, GDK_KEY_Control_R };
- unsigned j;
+ unsigned i, j;
display = gdk_display_get_default ();
- n_screens = gdk_display_get_n_screens (display);
+ screen = gdk_screen_get_default ();
+ xroot = gdk_x11_window_get_xid (gdk_screen_get_root_window (screen));
for (j = 0 ; j < G_N_ELEMENTS (keyvals) ; j++)
{
@@ -441,63 +443,47 @@ set_locate_pointer (void)
&n_keys);
if (has_entries)
{
- gint i, j;
for (i = 0; i < n_keys; i++)
{
- for (j = 0; j < n_screens; j++)
- {
- GdkScreen *screen;
- Window xroot;
-
- screen = gdk_display_get_screen (display, j);
- xroot = gdk_x11_window_get_xid (gdk_screen_get_root_window (screen));
-
- gdk_x11_display_error_trap_push (display);
-
- XGrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- 0,
- xroot,
- False,
- GrabModeAsync,
- GrabModeSync);
- XGrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- LockMask,
- xroot,
- False,
- GrabModeAsync,
- GrabModeSync);
- XGrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- Mod2Mask,
- xroot,
- False,
- GrabModeAsync,
- GrabModeSync);
- XGrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- Mod4Mask,
- xroot,
- False,
- GrabModeAsync,
- GrabModeSync);
-
- gdk_x11_display_error_trap_pop_ignored (display);
- }
+ gdk_x11_display_error_trap_push (display);
+
+ XGrabKey (GDK_DISPLAY_XDISPLAY (display),
+ keys[i].keycode,
+ 0,
+ xroot,
+ False,
+ GrabModeAsync,
+ GrabModeSync);
+ XGrabKey (GDK_DISPLAY_XDISPLAY (display),
+ keys[i].keycode,
+ LockMask,
+ xroot,
+ False,
+ GrabModeAsync,
+ GrabModeSync);
+ XGrabKey (GDK_DISPLAY_XDISPLAY (display),
+ keys[i].keycode,
+ Mod2Mask,
+ xroot,
+ False,
+ GrabModeAsync,
+ GrabModeSync);
+ XGrabKey (GDK_DISPLAY_XDISPLAY (display),
+ keys[i].keycode,
+ Mod4Mask,
+ xroot,
+ False,
+ GrabModeAsync,
+ GrabModeSync);
+
+ gdk_x11_display_error_trap_pop_ignored (display);
}
g_free (keys);
- for (i = 0; i < n_screens; i++)
- {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
- gdk_window_add_filter (gdk_screen_get_root_window (screen),
- filter,
- screen);
- }
+ gdk_window_add_filter (gdk_screen_get_root_window (screen),
+ filter,
+ screen);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]