diff options
-rw-r--r-- | src/gs-grab-x11.c | 8 | ||||
-rw-r--r-- | src/gs-lock-plug.c | 16 | ||||
-rw-r--r-- | src/gs-window-x11.c | 9 |
3 files changed, 33 insertions, 0 deletions
diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c index 421398b..004fddd 100644 --- a/src/gs-grab-x11.c +++ b/src/gs-grab-x11.c @@ -204,12 +204,20 @@ gs_grab_get_mouse (GSGrab *grab, gboolean hide_cursor) { GdkGrabStatus status; +#if GTK_CHECK_VERSION (3, 16, 0) + GdkDisplay *display; +#endif GdkCursor *cursor; g_return_val_if_fail (window != NULL, FALSE); g_return_val_if_fail (screen != NULL, FALSE); +#if GTK_CHECK_VERSION (3, 16, 0) + display = gtk_widget_get_display (GTK_WIDGET (window)); + cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR); +#else cursor = gdk_cursor_new (GDK_BLANK_CURSOR); +#endif gs_debug ("Grabbing mouse widget=%X", (guint32) GDK_WINDOW_XID (window)); status = gdk_pointer_grab (window, TRUE, 0, NULL, diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c index 9585a05..b8f5294 100644 --- a/src/gs-lock-plug.c +++ b/src/gs-lock-plug.c @@ -1556,12 +1556,20 @@ logout_button_clicked (GtkButton *button, void gs_lock_plug_set_busy (GSLockPlug *plug) { +#if GTK_CHECK_VERSION (3, 16, 0) + GdkDisplay *display; +#endif GdkCursor *cursor; GtkWidget *top_level; top_level = gtk_widget_get_toplevel (GTK_WIDGET (plug)); +#if GTK_CHECK_VERSION (3, 16, 0) + display = gtk_widget_get_display (GTK_WIDGET (plug)); + cursor = gdk_cursor_new_for_display (display, GDK_WATCH); +#else cursor = gdk_cursor_new (GDK_WATCH); +#endif gdk_window_set_cursor (gtk_widget_get_window (top_level), cursor); #if GTK_CHECK_VERSION (3, 0, 0) @@ -1574,12 +1582,20 @@ gs_lock_plug_set_busy (GSLockPlug *plug) void gs_lock_plug_set_ready (GSLockPlug *plug) { +#if GTK_CHECK_VERSION (3, 16, 0) + GdkDisplay *display; +#endif GdkCursor *cursor; GtkWidget *top_level; top_level = gtk_widget_get_toplevel (GTK_WIDGET (plug)); +#if GTK_CHECK_VERSION (3, 16, 0) + display = gtk_widget_get_display (GTK_WIDGET (plug)); + cursor = gdk_cursor_new_for_display (display, GDK_LEFT_PTR); +#else cursor = gdk_cursor_new (GDK_LEFT_PTR); +#endif gdk_window_set_cursor (gtk_widget_get_window (top_level), cursor); #if GTK_CHECK_VERSION (3, 0, 0) g_object_unref (cursor); diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c index c3d7495..15fb677 100644 --- a/src/gs-window-x11.c +++ b/src/gs-window-x11.c @@ -159,11 +159,20 @@ static void set_invisible_cursor (GdkWindow *window, gboolean invisible) { +#if GTK_CHECK_VERSION (3, 16, 0) + GdkDisplay *display; +#endif GdkCursor *cursor = NULL; if (invisible) { + +#if GTK_CHECK_VERSION (3, 16, 0) + display = gtk_widget_get_display (GTK_WIDGET (window)); + cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR); +#else cursor = gdk_cursor_new (GDK_BLANK_CURSOR); +#endif } gdk_window_set_cursor (window, cursor); |