[PATCH] Crash when choosing "Up" with keyboard navigation



Hi,
this patch fixes the crash when holding space bar on focused navigation buttons
(Up,Back,Forward,and so on), see http://bugs.gnome.org/580926 for more info.

thanks
From 33d6688760b465fdb0996de4681d140ab68e157d Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= <nbenitezl+gnome gmail com>
Date: Fri, 1 May 2009 00:26:00 +0200
Subject: [PATCH] Avoid crash when holding space bar on focused navigation buttons

Fixes bgo#580926
---
 src/nautilus-navigation-window-menus.c |    5 +++++
 src/nautilus-window-menus.c            |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 89bd1f6..be13e3b 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -77,6 +77,11 @@ should_open_in_new_tab (void)
 	GdkEvent *event;
 
 	event = gtk_get_current_event ();
+
+	if (event == NULL) {
+		return FALSE;
+	}
+
 	if (event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) {
 		return event->button.button == 2;
 	}
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 1e87b0e..bddfe33 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -118,6 +118,11 @@ should_open_in_new_tab (void)
 	GdkEvent *event;
 
 	event = gtk_get_current_event ();
+
+	if (event == NULL) {
+		return FALSE;
+	}
+
 	if (event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) {
 		return event->button.button == 2;
 	}
-- 
1.6.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]