[gtk-vnc] vncdisplay: check whether the widget is realized in focus_in_event()



commit 6f4a70d2a8540d121d1a794bef467bb3f54f9f0d
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Tue Feb 17 19:09:17 2015 +0100

    vncdisplay: check whether the widget is realized in focus_in_event()
    
    Returning early on focus_in_event(), when widget is not realized, avoids
    segfault when running on Windows using GTK3.

 src/vncdisplay.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index d8afba2..8e03b03 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -1052,6 +1052,9 @@ static gboolean enter_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC
 {
     VncDisplayPrivate *priv = VNC_DISPLAY(widget)->priv;
 
+    if (!gtk_widget_get_realized(widget))
+        return TRUE;
+
     if (priv->conn == NULL || !vnc_connection_is_initialized(priv->conn))
         return FALSE;
 


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