gtk_widget_get_window may return NULL

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

 



I try to cross compile virt-viewer to win32 using Debian Jessie. So far it works,
but only if I apply the following patch to spice-widget.c:

Index: new/gtk/spice-widget.c
===================================================================
--- new.orig/gtk/spice-widget.c	2013-06-26 15:55:08.000000000 +0200
+++ new/gtk/spice-widget.c	2013-09-24 12:00:17.889780000 +0200
@@ -1286,7 +1286,12 @@
 static void update_display(SpiceDisplay *display)
 {
 #ifdef WIN32
-    win32_window = display ? GDK_WINDOW_HWND(gtk_widget_get_window(GTK_WIDGET(display))) : NULL;
+    if (!display)
+        return;
+
+    GdkWindow *win = gtk_widget_get_window(GTK_WIDGET(display));
+
+    win32_window = win ? GDK_WINDOW_HWND(win) : NULL;
 #endif
 }

Seems that update_display() is called early on startup when the window is not realized. 
So this results is a call to GDK_WINDOW_HWND(NULL), which simply crash remote-viewer.exe

I have no idea why this only happens with the binaries I compiled myself.

And ideas?

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]