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



commit c7ff8790ec0733c384a8f32dd9ee9ca945dd512e
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Wed Feb 18 14:27:11 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..cd4dc4a 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -1114,6 +1114,9 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UN
     if (priv->conn == NULL || !vnc_connection_is_initialized(priv->conn))
         return FALSE;
 
+    if (!gtk_widget_get_realized(widget))
+        return TRUE;
+
 #ifdef G_OS_WIN32
     win32_window = GDK_WINDOW_HWND(gtk_widget_get_window(widget));
 #endif


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