[gnome-settings-daemon] cursor: Remove multi-screen support
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] cursor: Remove multi-screen support
- Date: Tue, 8 Apr 2014 11:48:43 +0000 (UTC)
commit 879aa0fc0b1b163394ad7e1cfb26eb88a91c61c8
Author: Bastien Nocera <hadess hadess net>
Date: Wed Apr 2 15:16:06 2014 +0200
cursor: Remove multi-screen support
We don't actually support multi-screen in any other desktop bits.
https://bugzilla.gnome.org/show_bug.cgi?id=727493
plugins/cursor/gsd-cursor-manager.c | 51 ++++++++--------------------------
1 files changed, 12 insertions(+), 39 deletions(-)
---
diff --git a/plugins/cursor/gsd-cursor-manager.c b/plugins/cursor/gsd-cursor-manager.c
index f93b94e..f0f0f16 100644
--- a/plugins/cursor/gsd-cursor-manager.c
+++ b/plugins/cursor/gsd-cursor-manager.c
@@ -84,55 +84,28 @@ static gpointer manager_object = NULL;
static gboolean add_all_devices (GsdCursorManager *manager, GdkDevice *exception, GError **error);
-typedef void (*ForeachScreenFunc) (GdkDisplay *display, GdkScreen *screen, GsdCursorManager *manager,
gpointer user_data);
-
-static void
-foreach_screen (GsdCursorManager *manager,
- ForeachScreenFunc func,
- gpointer user_data)
-{
- GdkDisplay *display;
- guint n_screens;
- guint i;
-
- display = gdk_display_get_default ();
- n_screens = gdk_display_get_n_screens (display);
- for (i = 0; i < n_screens; i++) {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
- (func) (display, screen, manager, user_data);
- }
-}
-
-static void
-set_cursor_visibility_foreach (GdkDisplay *display,
- GdkScreen *screen,
- GsdCursorManager *manager,
- gpointer user_data)
-{
- Display *xdisplay;
- gboolean visible = GPOINTER_TO_INT (user_data);
-
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- if (visible)
- XFixesShowCursor (xdisplay, GDK_WINDOW_XID (gdk_screen_get_root_window (screen)));
- else
- XFixesHideCursor (xdisplay, GDK_WINDOW_XID (gdk_screen_get_root_window (screen)));
-}
-
static void
set_cursor_visibility (GsdCursorManager *manager,
gboolean visible)
{
+ GdkWindow *root;
+ Display *xdisplay;
+
g_debug ("Attempting to %s the cursor", visible ? "show" : "hide");
if (manager->priv->cursor_shown == visible)
return;
gdk_error_trap_push ();
- foreach_screen (manager, set_cursor_visibility_foreach, GINT_TO_POINTER (visible));
+
+ root = gdk_screen_get_root_window (gdk_screen_get_default ());
+ xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+
+ if (visible)
+ XFixesShowCursor (xdisplay, GDK_WINDOW_XID (root));
+ else
+ XFixesHideCursor (xdisplay, GDK_WINDOW_XID (root));
+
if (gdk_error_trap_pop ()) {
g_warning ("An error occurred trying to %s the cursor",
visible ? "show" : "hide");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]