forked from AuroraMiddleware/gtk
main: Protect against non-GtkWindow toplevels
This commit is contained in:
parent
5fbe26f396
commit
51e25aaff4
@ -1471,6 +1471,7 @@ handle_pointing_event (GdkEvent *event)
|
|||||||
{
|
{
|
||||||
GtkWidget *target = NULL, *old_target = NULL, *widget;
|
GtkWidget *target = NULL, *old_target = NULL, *widget;
|
||||||
GtkWindow *toplevel;
|
GtkWindow *toplevel;
|
||||||
|
GtkWidget *toplevel_widget;
|
||||||
GdkEventSequence *sequence;
|
GdkEventSequence *sequence;
|
||||||
GdkDevice *device;
|
GdkDevice *device;
|
||||||
gdouble x, y;
|
gdouble x, y;
|
||||||
@ -1480,10 +1481,12 @@ handle_pointing_event (GdkEvent *event)
|
|||||||
if (!device || !gdk_event_get_coords (event, &x, &y))
|
if (!device || !gdk_event_get_coords (event, &x, &y))
|
||||||
return widget;
|
return widget;
|
||||||
|
|
||||||
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (widget));
|
toplevel_widget = gtk_widget_get_toplevel (widget);
|
||||||
if (!GTK_IS_WINDOW (toplevel))
|
if (!GTK_IS_WINDOW (toplevel_widget))
|
||||||
return widget;
|
return widget;
|
||||||
|
|
||||||
|
toplevel = GTK_WINDOW (toplevel_widget);
|
||||||
|
|
||||||
sequence = gdk_event_get_event_sequence (event);
|
sequence = gdk_event_get_event_sequence (event);
|
||||||
|
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
|
Loading…
Reference in New Issue
Block a user