summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2011-01-08 00:56:41 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2011-01-08 00:56:41 +0100
commit2f965e05b25ec0df637a90540f777d194a6c5311 (patch)
tree40b6eca2464e9b871e8683b7590b1389fe86e8f1
parent27d786f2265946c86da4575bc4680a428600efb8 (diff)
gtk: be more careful when accessing GDK_WINDOW_XDISPLAY
-rw-r--r--gtk/spice-widget-x11.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/spice-widget-x11.c b/gtk/spice-widget-x11.c
index 2b2215a..6ebf82c 100644
--- a/gtk/spice-widget-x11.c
+++ b/gtk/spice-widget-x11.c
@@ -356,8 +356,12 @@ void spicex_sync_keyboard_lock_modifiers(SpiceDisplay *display)
Display *x_display;
spice_display *d = SPICE_DISPLAY_GET_PRIVATE(display);
guint32 modifiers;
+ GdkWindow *w;
- x_display = GDK_WINDOW_XDISPLAY(gtk_widget_get_parent_window(GTK_WIDGET(display)));
+ w = gtk_widget_get_parent_window(GTK_WIDGET(display));
+ g_return_if_fail(w != NULL);
+
+ x_display = GDK_WINDOW_XDISPLAY(w);
modifiers = get_keyboard_lock_modifiers(x_display);
if (d->inputs)
spice_inputs_set_key_locks(d->inputs, modifiers);