mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-15 05:00:09 +00:00
GtkPlacesSidebar: Don't crash on dnd
gtk_get_current_event() can return NULL. Don't crash if it does. https://bugzilla.gnome.org/show_bug.cgi?id=739150
This commit is contained in:
parent
e35d91d18f
commit
041ccd7f87
@ -1420,11 +1420,13 @@ static gboolean
|
||||
clicked_eject_button (GtkPlacesSidebar *sidebar,
|
||||
GtkTreePath **path)
|
||||
{
|
||||
GdkEvent *event = gtk_get_current_event ();
|
||||
GdkEventButton *button_event = (GdkEventButton *) event;
|
||||
GdkEvent *event;
|
||||
|
||||
if ((event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) &&
|
||||
over_eject_button (sidebar, button_event->x, button_event->y, path))
|
||||
event = gtk_get_current_event ();
|
||||
|
||||
if (event &&
|
||||
(event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) &&
|
||||
over_eject_button (sidebar, ((GdkEventButton *)event)->x, ((GdkEventButton *)event)->y, path))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user