[gtk+] Update cursor theme on wayland



commit 75f4f7a47179c6ab48ecbf07acfab16f9cd762b4
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 22 20:31:50 2013 -0400

    Update cursor theme on wayland
    
    Call the new new api from gtksettings.c when it changes, just
    as we do for X11.
    https://bugzilla.gnome.org/show_bug.cgi?id=696428

 gtk/gtksettings.c |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 3c9036c..0288c61 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -40,6 +40,10 @@
 #include <pango/pangofc-fontmap.h>
 #endif
 
+#ifdef GDK_WINDOWING_WAYLAND
+#include "wayland/gdkwayland.h"
+#endif
+
 #ifdef GDK_WINDOWING_QUARTZ
 #include "quartz/gdkquartz.h"
 #endif
@@ -2552,23 +2556,27 @@ settings_update_modules (GtkSettings *settings)
 static void
 settings_update_cursor_theme (GtkSettings *settings)
 {
-#ifdef GDK_WINDOWING_X11
-  GdkDisplay *display = gdk_screen_get_display (settings->priv->screen);
   gchar *theme = NULL;
   gint size = 0;
+  GdkDisplay *display = gdk_screen_get_display (settings->priv->screen);
 
-  if (GDK_IS_X11_DISPLAY (display))
-    {
-      g_object_get (settings,
-                    "gtk-cursor-theme-name", &theme,
-                    "gtk-cursor-theme-size", &size,
-                    NULL);
-
-      gdk_x11_display_set_cursor_theme (display, theme, size);
+  g_object_get (settings,
+                "gtk-cursor-theme-name", &theme,
+                "gtk-cursor-theme-size", &size,
+                NULL);
 
-      g_free (theme);
-    }
+#ifdef GDK_WINDOWING_X11
+  if (GDK_IS_X11_DISPLAY (display))
+    gdk_x11_display_set_cursor_theme (display, theme, size);
+  else
+#endif
+#ifdef GDK_WINDOWING_WAYLAND
+  if (GDK_IS_WAYLAND_DISPLAY (display))
+    gdk_wayland_display_set_cursor_theme (display, theme, size);
+  else
 #endif
+    g_warning ("unsupported GDK backend\n");
+  g_free (theme);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]