[gtk+/gtk-3-18] entry: ensure valid GdkWindow before set_invisible_cursor()



commit bd3ea23655bee3ff51647131bf2294afd245dd5a
Author: Christian Hergert <christian hergert me>
Date:   Wed Nov 18 14:41:29 2015 -0800

    entry: ensure valid GdkWindow before set_invisible_cursor()
    
    If the window has not yet been created, then we can't set the invisible
    cursor yet. This can happen in situations where the widget is in a
    revealer with type-to-search functionality.

 gtk/gtkentry.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index ea0bd61..8565636 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -4778,9 +4778,11 @@ gtk_entry_obscure_mouse_cursor (GtkEntry *entry)
   if (priv->mouse_cursor_obscured)
     return;
 
-  set_invisible_cursor (priv->text_area);
-
-  priv->mouse_cursor_obscured = TRUE;
+  if (priv->text_area)
+    {
+      set_invisible_cursor (priv->text_area);
+      priv->mouse_cursor_obscured = TRUE;
+    }
 }
 
 static gint


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