diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index e50a6d644e..06a974a032 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1471,6 +1471,7 @@ handle_pointing_event (GdkEvent *event) { GtkWidget *target = NULL, *old_target = NULL, *widget; GtkWindow *toplevel; + GtkWidget *toplevel_widget; GdkEventSequence *sequence; GdkDevice *device; gdouble x, y; @@ -1480,10 +1481,12 @@ handle_pointing_event (GdkEvent *event) if (!device || !gdk_event_get_coords (event, &x, &y)) return widget; - toplevel = GTK_WINDOW (gtk_widget_get_toplevel (widget)); - if (!GTK_IS_WINDOW (toplevel)) + toplevel_widget = gtk_widget_get_toplevel (widget); + if (!GTK_IS_WINDOW (toplevel_widget)) return widget; + toplevel = GTK_WINDOW (toplevel_widget); + sequence = gdk_event_get_event_sequence (event); switch (event->type)