[gtk+] GtkPlacesSidebar: Don't crash on dnd
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkPlacesSidebar: Don't crash on dnd
- Date: Sat, 25 Oct 2014 20:10:04 +0000 (UTC)
commit 041ccd7f878f6412c3a47eec4665ea86123ea048
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Oct 25 15:55:54 2014 -0400
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
gtk/gtkplacessidebar.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index c6d53f7..cdc5ce1 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]