[gtk+/wip/carlosg/event-delivery: 50/72] gtkwidget: Visually update cursors inside widget when changing cursor



commit bcbaf8b17354a5f23f7e6c3771eeb03ac94d73ac
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Apr 4 17:09:41 2017 +0200

    gtkwidget: Visually update cursors inside widget when changing cursor

 gtk/gtkwidget.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 50ccd15..dd4c1a2 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15597,7 +15597,14 @@ void
 gtk_widget_set_cursor (GtkWidget *widget,
                        GdkCursor *cursor)
 {
-  g_set_object (&widget->priv->cursor, cursor);
+  GtkWidget *toplevel;
+
+  if (!g_set_object (&widget->priv->cursor, cursor))
+    return;
+
+  toplevel = gtk_widget_get_toplevel (widget);
+  if (GTK_IS_WINDOW (toplevel))
+    gtk_window_maybe_update_cursor (GTK_WINDOW (toplevel), widget, NULL);
 }
 
 GdkCursor *


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