[nautilus] window-manage-views: fix a crash when middle-clicking desktop icons
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] window-manage-views: fix a crash when middle-clicking desktop icons
- Date: Mon, 6 Feb 2012 21:22:04 +0000 (UTC)
commit 7c5ebdbbd3c7778af230fc830b5bc6bd706f1d61
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Feb 6 16:20:27 2012 -0500
window-manage-views: fix a crash when middle-clicking desktop icons
We were hitting an assertion when middle clicking a desktop icon, since
we were trying to open it in a tab (same window), and we don't really
want to do that on the desktop.
https://bugzilla.gnome.org/show_bug.cgi?id=655576
src/nautilus-window-manage-views.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index c338569..04f04b6 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -438,17 +438,25 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
g_free (old_uri);
g_free (new_uri);
- g_assert (!((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) != 0 &&
- (flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0));
-
is_desktop = NAUTILUS_IS_DESKTOP_WINDOW (window);
if (is_desktop) {
use_same = !nautilus_desktop_window_loaded (NAUTILUS_DESKTOP_WINDOW (window));
+
+ /* if we're requested to open a new tab on the desktop, open a window
+ * instead.
+ */
+ if (flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) {
+ flags ^= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+ flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+ }
} else {
use_same |= g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER);
}
+ g_assert (!((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) != 0 &&
+ (flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0));
+
/* and if the flags specify so, this is overridden */
if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) != 0) {
use_same = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]