Merge lp:~mitya57/ubuntu/precise/nautilus/desktop-window-fixes into lp:ubuntu/precise/nautilus

Proposed by Dmitry Shachnev on 2011-10-24
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~mitya57/ubuntu/precise/nautilus/desktop-window-fixes
Merge into: lp:ubuntu/precise/nautilus
Diff against target: 259 lines (+76/-43)
5 files modified
debian/changelog (+10/-0)
debian/patches/05_desktop_menu_export.patch (+36/-35)
debian/patches/17_dont_allow_new_tab_on_desktop.patch (+20/-0)
debian/patches/series (+1/-0)
src/nautilus-desktop-window.c (+9/-8)
To merge this branch: bzr merge lp:~mitya57/ubuntu/precise/nautilus/desktop-window-fixes
Reviewer Review Type Date Requested Status
Martin Pitt 2011-10-24 Approve on 2011-10-25
Canonical Desktop Team 2011-10-24 Pending
Review via email: mp+80207@code.launchpad.net

Description of the change

Look at the changelog to see what's fixed.

You can test this branch using a PPA package provided by Matthieu Baerts (in ppa:matttbe/ppa).

To post a comment you must log in.
Martin Pitt (pitti) wrote :

Thanks for this! This is the wrong branch, but I grabbed the diffs and put them into http://bazaar.launchpad.net/~ubuntu-desktop/nautilus/ubuntu/changes (see Vcs-Bzr:).

I also did a small correction to avoid a crash if $DESKTOP_SESSION is not set at all.

Thanks!

review: Approve
Dmitry Shachnev (mitya57) wrote :

Thanks! Sebastien pointed me too bug 880938, I hope to fix that too (probably later today).

Dmitry Shachnev (mitya57) wrote :

Never mind, there's already a patch there.

Sebastien Bacher (seb128) wrote :

the fix there creates bug #912379, spamming .xsession-errors with:
"Gtk-CRITICAL **: gtk_container_foreach: assertion `GTK_IS_CONTAINER (container)' failed"

the bookmarks code seems to be trying to update the menus which is an issue with bar destroyed...

do you have any idea how to fix that? if not we should probably revert the fix until somebody comes with a better one...

Sebastien Bacher (seb128) wrote :

the issue got fixed in gtk in precise the hack should not be required so I'm dropping it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-10-18 09:52:20 +0000
3+++ debian/changelog 2011-10-24 12:47:24 +0000
4@@ -1,3 +1,13 @@
5+nautilus (1:3.2.1-0ubuntu2) oneiric-proposed; urgency=low
6+
7+ * debian/patches/05_desktop_menu_export.patch (updated):
8+ - Destroy menubar on non-ubuntu sessions (LP: #826771)
9+ - Remove duplicate lines (LP: #874847)
10+ * debian/patches/17_dont_allow_new_tab_on_desktop.patch:
11+ - Don't allow "New tab" shortcut on desktop (LP: #814799)
12+
13+ -- Dmitry Shachnev <mitya57@gmail.com> Sun, 23 Oct 2011 13:43:50 +0400
14+
15 nautilus (1:3.2.1-0ubuntu1) oneiric-proposed; urgency=low
16
17 * New upstream release:
18
19=== modified file 'debian/patches/05_desktop_menu_export.patch'
20--- debian/patches/05_desktop_menu_export.patch 2011-09-30 12:23:46 +0000
21+++ debian/patches/05_desktop_menu_export.patch 2011-10-24 12:47:24 +0000
22@@ -2,10 +2,10 @@
23 ## Origin/Author: Ted Gould <ted@ubuntu.com>
24 ## Bug: https://bugs.launchpad.net/bugs/805252
25 === modified file 'libnautilus-private/nautilus-ui-utilities.c'
26-Index: nautilus-3.2.0/libnautilus-private/nautilus-ui-utilities.c
27+Index: nautilus/libnautilus-private/nautilus-ui-utilities.c
28 ===================================================================
29---- nautilus-3.2.0.orig/libnautilus-private/nautilus-ui-utilities.c 2011-09-12 19:14:31.000000000 -0400
30-+++ nautilus-3.2.0/libnautilus-private/nautilus-ui-utilities.c 2011-09-30 01:53:00.650985292 -0400
31+--- nautilus.orig/libnautilus-private/nautilus-ui-utilities.c 2011-10-23 13:36:39.033935576 +0400
32++++ nautilus/libnautilus-private/nautilus-ui-utilities.c 2011-10-23 13:36:39.677950486 +0400
33 @@ -97,8 +97,11 @@
34 path = nautilus_ui_file (filename);
35 if (path == NULL || !g_file_get_contents (path, &ui, NULL, NULL)) {
36@@ -18,10 +18,10 @@
37 g_hash_table_insert (ui_cache,
38 g_strdup (filename),
39 ui);
40-Index: nautilus-3.2.0/src/Makefile.am
41+Index: nautilus/src/Makefile.am
42 ===================================================================
43---- nautilus-3.2.0.orig/src/Makefile.am 2011-09-21 14:11:33.000000000 -0400
44-+++ nautilus-3.2.0/src/Makefile.am 2011-09-30 01:53:00.650985292 -0400
45+--- nautilus.orig/src/Makefile.am 2011-10-23 13:36:38.925933075 +0400
46++++ nautilus/src/Makefile.am 2011-10-23 13:36:39.677950486 +0400
47 @@ -179,6 +179,7 @@
48 nautilus-file-management-properties.ui \
49 nautilus-bookmarks-window.ui \
50@@ -30,10 +30,10 @@
51 nautilus-directory-view-ui.xml \
52 nautilus-icon-view-ui.xml \
53 nautilus-list-view-ui.xml \
54-Index: nautilus-3.2.0/src/nautilus-desktop-icon-view.c
55+Index: nautilus/src/nautilus-desktop-icon-view.c
56 ===================================================================
57---- nautilus-3.2.0.orig/src/nautilus-desktop-icon-view.c 2011-09-30 01:52:58.578975016 -0400
58-+++ nautilus-3.2.0/src/nautilus-desktop-icon-view.c 2011-09-30 01:53:00.654985307 -0400
59+--- nautilus.orig/src/nautilus-desktop-icon-view.c 2011-10-23 13:36:39.625949277 +0400
60++++ nautilus/src/nautilus-desktop-icon-view.c 2011-10-23 13:36:39.697950950 +0400
61 @@ -830,6 +830,15 @@
62 ui = nautilus_ui_string_get ("nautilus-desktop-icon-view-ui.xml");
63 desktop_view->details->desktop_merge_id =
64@@ -50,10 +50,10 @@
65 }
66
67 static NautilusView *
68-Index: nautilus-3.2.0/src/nautilus-desktop-window-ui.xml
69+Index: nautilus/src/nautilus-desktop-window-ui.xml
70 ===================================================================
71 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
72-+++ nautilus-3.2.0/src/nautilus-desktop-window-ui.xml 2011-09-30 01:53:00.654985307 -0400
73++++ nautilus/src/nautilus-desktop-window-ui.xml 2011-10-23 13:36:39.697950950 +0400
74 @@ -0,0 +1,14 @@
75 +<ui>
76 +<menubar name="MenuBar">
77@@ -69,10 +69,10 @@
78 + </menu>
79 +</menubar>
80 +</ui>
81-Index: nautilus-3.2.0/src/nautilus-desktop-window.c
82+Index: nautilus/src/nautilus-desktop-window.c
83 ===================================================================
84---- nautilus-3.2.0.orig/src/nautilus-desktop-window.c 2011-09-12 21:14:23.000000000 -0400
85-+++ nautilus-3.2.0/src/nautilus-desktop-window.c 2011-09-30 01:55:28.231717184 -0400
86+--- nautilus.orig/src/nautilus-desktop-window.c 2011-10-23 13:36:38.957933815 +0400
87++++ nautilus/src/nautilus-desktop-window.c 2011-10-23 13:42:29.010081687 +0400
88 @@ -37,6 +37,7 @@
89 #include <libnautilus-private/nautilus-file-utilities.h>
90 #include <libnautilus-private/nautilus-icon-names.h>
91@@ -113,24 +113,25 @@
92 G_DEFINE_TYPE (NautilusDesktopWindow, nautilus_desktop_window,
93 NAUTILUS_TYPE_WINDOW);
94
95-@@ -76,6 +102,138 @@
96+@@ -71,11 +97,139 @@
97+ gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
98+ gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);
99+
100++ if (!g_str_has_prefix(g_getenv("DESKTOP_SESSION"), "ubuntu")) {
101++ gtk_widget_destroy (NAUTILUS_WINDOW (window)->details->menubar);
102++ NAUTILUS_WINDOW (window)->details->menubar=0;
103++ }
104++
105+ /* Don't allow close action on desktop */
106+ action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
107 NAUTILUS_ACTION_CLOSE);
108 gtk_action_set_sensitive (action, FALSE);
109
110-+ gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
111-+ gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);
112-+
113 + UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();
114 + if (proxy != NULL) {
115 + ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);
116 + }
117 +
118-+ action = NULL;
119-+ /* Don't allow close action on desktop */
120-+ action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
121-+ NAUTILUS_ACTION_CLOSE);
122-+ gtk_action_set_sensitive (action, FALSE);
123-+
124 + /* Add actions for the desktop */
125 + GtkActionGroup * desktop_agroup = gtk_action_group_new("DesktopActions");
126 + gtk_action_group_set_translation_domain(desktop_agroup, GETTEXT_PACKAGE);
127@@ -252,7 +253,7 @@
128 /* Set the accessible name so that it doesn't inherit the cryptic desktop URI. */
129 accessible = gtk_widget_get_accessible (GTK_WIDGET (window));
130
131-@@ -106,6 +264,8 @@
132+@@ -106,6 +260,8 @@
133
134 g_object_set_data (G_OBJECT (window), "is_desktop_window",
135 GINT_TO_POINTER (1));
136@@ -261,10 +262,10 @@
137 }
138
139 static gint
140-Index: nautilus-3.2.0/src/nautilus-shell-ui.xml
141+Index: nautilus/src/nautilus-shell-ui.xml
142 ===================================================================
143---- nautilus-3.2.0.orig/src/nautilus-shell-ui.xml 2011-09-30 01:52:57.602970174 -0400
144-+++ nautilus-3.2.0/src/nautilus-shell-ui.xml 2011-09-30 01:53:00.654985307 -0400
145+--- nautilus.orig/src/nautilus-shell-ui.xml 2011-10-23 13:36:39.609948913 +0400
146++++ nautilus/src/nautilus-shell-ui.xml 2011-10-23 13:36:39.697950950 +0400
147 @@ -49,6 +49,8 @@
148 <placeholder name="Extension Actions"/>
149 <separator/>
150@@ -283,10 +284,10 @@
151 </menu>
152 </menubar>
153 <popup name="background">
154-Index: nautilus-3.2.0/src/nautilus-window.c
155+Index: nautilus/src/nautilus-window.c
156 ===================================================================
157---- nautilus-3.2.0.orig/src/nautilus-window.c 2011-09-21 14:11:33.000000000 -0400
158-+++ nautilus-3.2.0/src/nautilus-window.c 2011-09-30 01:53:00.654985307 -0400
159+--- nautilus.orig/src/nautilus-window.c 2011-10-23 13:36:38.985934466 +0400
160++++ nautilus/src/nautilus-window.c 2011-10-23 13:36:39.709951227 +0400
161 @@ -37,6 +37,7 @@
162 #include "nautilus-location-bar.h"
163 #include "nautilus-mime-actions.h"
164@@ -295,7 +296,7 @@
165 #include "nautilus-places-sidebar.h"
166 #include "nautilus-search-bar.h"
167 #include "nautilus-tree-sidebar.h"
168-@@ -1215,6 +1216,10 @@
169+@@ -1229,6 +1230,10 @@
170 window->details->view_as_radio_action = action;
171 }
172
173@@ -306,10 +307,10 @@
174 data = g_slice_new (ActivateViewData);
175 data->window = window;
176 data->id = g_strdup (identifier);
177-Index: nautilus-3.2.0/src/Makefile.in
178+Index: nautilus/src/Makefile.in
179 ===================================================================
180---- nautilus-3.2.0.orig/src/Makefile.in 2011-09-26 10:18:27.000000000 -0400
181-+++ nautilus-3.2.0/src/Makefile.in 2011-09-30 01:53:00.654985307 -0400
182+--- nautilus.orig/src/Makefile.in 2011-10-23 13:36:39.005934925 +0400
183++++ nautilus/src/Makefile.in 2011-10-23 13:36:39.709951227 +0400
184 @@ -551,6 +551,7 @@
185 nautilus-file-management-properties.ui \
186 nautilus-bookmarks-window.ui \
187
188=== added file 'debian/patches/17_dont_allow_new_tab_on_desktop.patch'
189--- debian/patches/17_dont_allow_new_tab_on_desktop.patch 1970-01-01 00:00:00 +0000
190+++ debian/patches/17_dont_allow_new_tab_on_desktop.patch 2011-10-24 12:47:24 +0000
191@@ -0,0 +1,20 @@
192+## Description: Don't allow "New Tab" shortcut on desktop
193+## Author: Dmitry Shachnev <mitya57@gmail.com>
194+## Bug: https://bugs.launchpad.net/bugs/814799
195+## Forwarded: yes
196+Index: nautilus/src/nautilus-desktop-window.c
197+===================================================================
198+--- nautilus.orig/src/nautilus-desktop-window.c 2011-10-23 13:47:25.401047441 +0400
199++++ nautilus/src/nautilus-desktop-window.c 2011-10-23 13:46:36.527894946 +0400
200+@@ -107,6 +107,11 @@
201+ NAUTILUS_ACTION_CLOSE);
202+ gtk_action_set_sensitive (action, FALSE);
203+
204++ /* Don't allow new tab on desktop */
205++ action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
206++ NAUTILUS_ACTION_NEW_TAB);
207++ gtk_action_set_sensitive (action, FALSE);
208++
209+ UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();
210+ if (proxy != NULL) {
211+ ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);
212
213=== modified file 'debian/patches/series'
214--- debian/patches/series 2011-10-18 09:52:20 +0000
215+++ debian/patches/series 2011-10-24 12:47:24 +0000
216@@ -13,3 +13,4 @@
217 14_bring_del_instead_ctrl_del.patch
218 15_use-ubuntu-help.patch
219 16_run_in_gnome_unity.patch
220+17_dont_allow_new_tab_on_desktop.patch
221
222=== modified file 'src/nautilus-desktop-window.c'
223--- src/nautilus-desktop-window.c 2011-09-30 12:23:46 +0000
224+++ src/nautilus-desktop-window.c 2011-10-24 12:47:24 +0000
225@@ -97,25 +97,26 @@
226 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
227 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);
228
229+ if (!g_str_has_prefix(g_getenv("DESKTOP_SESSION"), "ubuntu")) {
230+ gtk_widget_destroy (NAUTILUS_WINDOW (window)->details->menubar);
231+ NAUTILUS_WINDOW (window)->details->menubar=0;
232+ }
233+
234 /* Don't allow close action on desktop */
235 action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
236 NAUTILUS_ACTION_CLOSE);
237 gtk_action_set_sensitive (action, FALSE);
238
239- gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
240- gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);
241+ /* Don't allow new tab on desktop */
242+ action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
243+ NAUTILUS_ACTION_NEW_TAB);
244+ gtk_action_set_sensitive (action, FALSE);
245
246 UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();
247 if (proxy != NULL) {
248 ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);
249 }
250
251- action = NULL;
252- /* Don't allow close action on desktop */
253- action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
254- NAUTILUS_ACTION_CLOSE);
255- gtk_action_set_sensitive (action, FALSE);
256-
257 /* Add actions for the desktop */
258 GtkActionGroup * desktop_agroup = gtk_action_group_new("DesktopActions");
259 gtk_action_group_set_translation_domain(desktop_agroup, GETTEXT_PACKAGE);

Subscribers

People subscribed via source and target branches