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
=== modified file 'debian/changelog'
--- debian/changelog 2011-10-18 09:52:20 +0000
+++ debian/changelog 2011-10-24 12:47:24 +0000
@@ -1,3 +1,13 @@
1nautilus (1:3.2.1-0ubuntu2) oneiric-proposed; urgency=low
2
3 * debian/patches/05_desktop_menu_export.patch (updated):
4 - Destroy menubar on non-ubuntu sessions (LP: #826771)
5 - Remove duplicate lines (LP: #874847)
6 * debian/patches/17_dont_allow_new_tab_on_desktop.patch:
7 - Don't allow "New tab" shortcut on desktop (LP: #814799)
8
9 -- Dmitry Shachnev <mitya57@gmail.com> Sun, 23 Oct 2011 13:43:50 +0400
10
1nautilus (1:3.2.1-0ubuntu1) oneiric-proposed; urgency=low11nautilus (1:3.2.1-0ubuntu1) oneiric-proposed; urgency=low
212
3 * New upstream release:13 * New upstream release:
414
=== modified file 'debian/patches/05_desktop_menu_export.patch'
--- debian/patches/05_desktop_menu_export.patch 2011-09-30 12:23:46 +0000
+++ debian/patches/05_desktop_menu_export.patch 2011-10-24 12:47:24 +0000
@@ -2,10 +2,10 @@
2## Origin/Author: Ted Gould <ted@ubuntu.com> 2## Origin/Author: Ted Gould <ted@ubuntu.com>
3## Bug: https://bugs.launchpad.net/bugs/8052523## Bug: https://bugs.launchpad.net/bugs/805252
4=== modified file 'libnautilus-private/nautilus-ui-utilities.c'4=== modified file 'libnautilus-private/nautilus-ui-utilities.c'
5Index: nautilus-3.2.0/libnautilus-private/nautilus-ui-utilities.c5Index: nautilus/libnautilus-private/nautilus-ui-utilities.c
6===================================================================6===================================================================
7--- nautilus-3.2.0.orig/libnautilus-private/nautilus-ui-utilities.c 2011-09-12 19:14:31.000000000 -04007--- nautilus.orig/libnautilus-private/nautilus-ui-utilities.c 2011-10-23 13:36:39.033935576 +0400
8+++ nautilus-3.2.0/libnautilus-private/nautilus-ui-utilities.c 2011-09-30 01:53:00.650985292 -04008+++ nautilus/libnautilus-private/nautilus-ui-utilities.c 2011-10-23 13:36:39.677950486 +0400
9@@ -97,8 +97,11 @@9@@ -97,8 +97,11 @@
10 path = nautilus_ui_file (filename);10 path = nautilus_ui_file (filename);
11 if (path == NULL || !g_file_get_contents (path, &ui, NULL, NULL)) {11 if (path == NULL || !g_file_get_contents (path, &ui, NULL, NULL)) {
@@ -18,10 +18,10 @@
18 g_hash_table_insert (ui_cache,18 g_hash_table_insert (ui_cache,
19 g_strdup (filename),19 g_strdup (filename),
20 ui);20 ui);
21Index: nautilus-3.2.0/src/Makefile.am21Index: nautilus/src/Makefile.am
22===================================================================22===================================================================
23--- nautilus-3.2.0.orig/src/Makefile.am 2011-09-21 14:11:33.000000000 -040023--- nautilus.orig/src/Makefile.am 2011-10-23 13:36:38.925933075 +0400
24+++ nautilus-3.2.0/src/Makefile.am 2011-09-30 01:53:00.650985292 -040024+++ nautilus/src/Makefile.am 2011-10-23 13:36:39.677950486 +0400
25@@ -179,6 +179,7 @@25@@ -179,6 +179,7 @@
26 nautilus-file-management-properties.ui \26 nautilus-file-management-properties.ui \
27 nautilus-bookmarks-window.ui \27 nautilus-bookmarks-window.ui \
@@ -30,10 +30,10 @@
30 nautilus-directory-view-ui.xml \30 nautilus-directory-view-ui.xml \
31 nautilus-icon-view-ui.xml \31 nautilus-icon-view-ui.xml \
32 nautilus-list-view-ui.xml \32 nautilus-list-view-ui.xml \
33Index: nautilus-3.2.0/src/nautilus-desktop-icon-view.c33Index: nautilus/src/nautilus-desktop-icon-view.c
34===================================================================34===================================================================
35--- nautilus-3.2.0.orig/src/nautilus-desktop-icon-view.c 2011-09-30 01:52:58.578975016 -040035--- nautilus.orig/src/nautilus-desktop-icon-view.c 2011-10-23 13:36:39.625949277 +0400
36+++ nautilus-3.2.0/src/nautilus-desktop-icon-view.c 2011-09-30 01:53:00.654985307 -040036+++ nautilus/src/nautilus-desktop-icon-view.c 2011-10-23 13:36:39.697950950 +0400
37@@ -830,6 +830,15 @@37@@ -830,6 +830,15 @@
38 ui = nautilus_ui_string_get ("nautilus-desktop-icon-view-ui.xml");38 ui = nautilus_ui_string_get ("nautilus-desktop-icon-view-ui.xml");
39 desktop_view->details->desktop_merge_id =39 desktop_view->details->desktop_merge_id =
@@ -50,10 +50,10 @@
50 }50 }
51 51
52 static NautilusView *52 static NautilusView *
53Index: nautilus-3.2.0/src/nautilus-desktop-window-ui.xml53Index: nautilus/src/nautilus-desktop-window-ui.xml
54===================================================================54===================================================================
55--- /dev/null 1970-01-01 00:00:00.000000000 +000055--- /dev/null 1970-01-01 00:00:00.000000000 +0000
56+++ nautilus-3.2.0/src/nautilus-desktop-window-ui.xml 2011-09-30 01:53:00.654985307 -040056+++ nautilus/src/nautilus-desktop-window-ui.xml 2011-10-23 13:36:39.697950950 +0400
57@@ -0,0 +1,14 @@57@@ -0,0 +1,14 @@
58+<ui>58+<ui>
59+<menubar name="MenuBar">59+<menubar name="MenuBar">
@@ -69,10 +69,10 @@
69+ </menu>69+ </menu>
70+</menubar>70+</menubar>
71+</ui>71+</ui>
72Index: nautilus-3.2.0/src/nautilus-desktop-window.c72Index: nautilus/src/nautilus-desktop-window.c
73===================================================================73===================================================================
74--- nautilus-3.2.0.orig/src/nautilus-desktop-window.c 2011-09-12 21:14:23.000000000 -040074--- nautilus.orig/src/nautilus-desktop-window.c 2011-10-23 13:36:38.957933815 +0400
75+++ nautilus-3.2.0/src/nautilus-desktop-window.c 2011-09-30 01:55:28.231717184 -040075+++ nautilus/src/nautilus-desktop-window.c 2011-10-23 13:42:29.010081687 +0400
76@@ -37,6 +37,7 @@76@@ -37,6 +37,7 @@
77 #include <libnautilus-private/nautilus-file-utilities.h>77 #include <libnautilus-private/nautilus-file-utilities.h>
78 #include <libnautilus-private/nautilus-icon-names.h>78 #include <libnautilus-private/nautilus-icon-names.h>
@@ -113,24 +113,25 @@
113 G_DEFINE_TYPE (NautilusDesktopWindow, nautilus_desktop_window, 113 G_DEFINE_TYPE (NautilusDesktopWindow, nautilus_desktop_window,
114 NAUTILUS_TYPE_WINDOW);114 NAUTILUS_TYPE_WINDOW);
115 115
116@@ -76,6 +102,138 @@116@@ -71,11 +97,139 @@
117 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
118 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);
119
120+ if (!g_str_has_prefix(g_getenv("DESKTOP_SESSION"), "ubuntu")) {
121+ gtk_widget_destroy (NAUTILUS_WINDOW (window)->details->menubar);
122+ NAUTILUS_WINDOW (window)->details->menubar=0;
123+ }
124+
125 /* Don't allow close action on desktop */
126 action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
117 NAUTILUS_ACTION_CLOSE);127 NAUTILUS_ACTION_CLOSE);
118 gtk_action_set_sensitive (action, FALSE);128 gtk_action_set_sensitive (action, FALSE);
119 129
120+ gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
121+ gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);
122+
123+ UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();130+ UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();
124+ if (proxy != NULL) {131+ if (proxy != NULL) {
125+ ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);132+ ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);
126+ }133+ }
127+134+
128+ action = NULL;
129+ /* Don't allow close action on desktop */
130+ action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
131+ NAUTILUS_ACTION_CLOSE);
132+ gtk_action_set_sensitive (action, FALSE);
133+
134+ /* Add actions for the desktop */135+ /* Add actions for the desktop */
135+ GtkActionGroup * desktop_agroup = gtk_action_group_new("DesktopActions");136+ GtkActionGroup * desktop_agroup = gtk_action_group_new("DesktopActions");
136+ gtk_action_group_set_translation_domain(desktop_agroup, GETTEXT_PACKAGE);137+ gtk_action_group_set_translation_domain(desktop_agroup, GETTEXT_PACKAGE);
@@ -252,7 +253,7 @@
252 /* Set the accessible name so that it doesn't inherit the cryptic desktop URI. */253 /* Set the accessible name so that it doesn't inherit the cryptic desktop URI. */
253 accessible = gtk_widget_get_accessible (GTK_WIDGET (window));254 accessible = gtk_widget_get_accessible (GTK_WIDGET (window));
254 255
255@@ -106,6 +264,8 @@256@@ -106,6 +260,8 @@
256 257
257 g_object_set_data (G_OBJECT (window), "is_desktop_window", 258 g_object_set_data (G_OBJECT (window), "is_desktop_window",
258 GINT_TO_POINTER (1));259 GINT_TO_POINTER (1));
@@ -261,10 +262,10 @@
261 }262 }
262 263
263 static gint264 static gint
264Index: nautilus-3.2.0/src/nautilus-shell-ui.xml265Index: nautilus/src/nautilus-shell-ui.xml
265===================================================================266===================================================================
266--- nautilus-3.2.0.orig/src/nautilus-shell-ui.xml 2011-09-30 01:52:57.602970174 -0400267--- nautilus.orig/src/nautilus-shell-ui.xml 2011-10-23 13:36:39.609948913 +0400
267+++ nautilus-3.2.0/src/nautilus-shell-ui.xml 2011-09-30 01:53:00.654985307 -0400268+++ nautilus/src/nautilus-shell-ui.xml 2011-10-23 13:36:39.697950950 +0400
268@@ -49,6 +49,8 @@269@@ -49,6 +49,8 @@
269 <placeholder name="Extension Actions"/>270 <placeholder name="Extension Actions"/>
270 <separator/>271 <separator/>
@@ -283,10 +284,10 @@
283 </menu>284 </menu>
284 </menubar>285 </menubar>
285 <popup name="background">286 <popup name="background">
286Index: nautilus-3.2.0/src/nautilus-window.c287Index: nautilus/src/nautilus-window.c
287===================================================================288===================================================================
288--- nautilus-3.2.0.orig/src/nautilus-window.c 2011-09-21 14:11:33.000000000 -0400289--- nautilus.orig/src/nautilus-window.c 2011-10-23 13:36:38.985934466 +0400
289+++ nautilus-3.2.0/src/nautilus-window.c 2011-09-30 01:53:00.654985307 -0400290+++ nautilus/src/nautilus-window.c 2011-10-23 13:36:39.709951227 +0400
290@@ -37,6 +37,7 @@291@@ -37,6 +37,7 @@
291 #include "nautilus-location-bar.h"292 #include "nautilus-location-bar.h"
292 #include "nautilus-mime-actions.h"293 #include "nautilus-mime-actions.h"
@@ -295,7 +296,7 @@
295 #include "nautilus-places-sidebar.h"296 #include "nautilus-places-sidebar.h"
296 #include "nautilus-search-bar.h"297 #include "nautilus-search-bar.h"
297 #include "nautilus-tree-sidebar.h"298 #include "nautilus-tree-sidebar.h"
298@@ -1215,6 +1216,10 @@299@@ -1229,6 +1230,10 @@
299 window->details->view_as_radio_action = action;300 window->details->view_as_radio_action = action;
300 }301 }
301 302
@@ -306,10 +307,10 @@
306 data = g_slice_new (ActivateViewData);307 data = g_slice_new (ActivateViewData);
307 data->window = window;308 data->window = window;
308 data->id = g_strdup (identifier);309 data->id = g_strdup (identifier);
309Index: nautilus-3.2.0/src/Makefile.in310Index: nautilus/src/Makefile.in
310===================================================================311===================================================================
311--- nautilus-3.2.0.orig/src/Makefile.in 2011-09-26 10:18:27.000000000 -0400312--- nautilus.orig/src/Makefile.in 2011-10-23 13:36:39.005934925 +0400
312+++ nautilus-3.2.0/src/Makefile.in 2011-09-30 01:53:00.654985307 -0400313+++ nautilus/src/Makefile.in 2011-10-23 13:36:39.709951227 +0400
313@@ -551,6 +551,7 @@314@@ -551,6 +551,7 @@
314 nautilus-file-management-properties.ui \315 nautilus-file-management-properties.ui \
315 nautilus-bookmarks-window.ui \316 nautilus-bookmarks-window.ui \
316317
=== added file 'debian/patches/17_dont_allow_new_tab_on_desktop.patch'
--- debian/patches/17_dont_allow_new_tab_on_desktop.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/17_dont_allow_new_tab_on_desktop.patch 2011-10-24 12:47:24 +0000
@@ -0,0 +1,20 @@
1## Description: Don't allow "New Tab" shortcut on desktop
2## Author: Dmitry Shachnev <mitya57@gmail.com>
3## Bug: https://bugs.launchpad.net/bugs/814799
4## Forwarded: yes
5Index: nautilus/src/nautilus-desktop-window.c
6===================================================================
7--- nautilus.orig/src/nautilus-desktop-window.c 2011-10-23 13:47:25.401047441 +0400
8+++ nautilus/src/nautilus-desktop-window.c 2011-10-23 13:46:36.527894946 +0400
9@@ -107,6 +107,11 @@
10 NAUTILUS_ACTION_CLOSE);
11 gtk_action_set_sensitive (action, FALSE);
12
13+ /* Don't allow new tab on desktop */
14+ action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
15+ NAUTILUS_ACTION_NEW_TAB);
16+ gtk_action_set_sensitive (action, FALSE);
17+
18 UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();
19 if (proxy != NULL) {
20 ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);
021
=== modified file 'debian/patches/series'
--- debian/patches/series 2011-10-18 09:52:20 +0000
+++ debian/patches/series 2011-10-24 12:47:24 +0000
@@ -13,3 +13,4 @@
1314_bring_del_instead_ctrl_del.patch1314_bring_del_instead_ctrl_del.patch
1415_use-ubuntu-help.patch1415_use-ubuntu-help.patch
1516_run_in_gnome_unity.patch1516_run_in_gnome_unity.patch
1617_dont_allow_new_tab_on_desktop.patch
1617
=== modified file 'src/nautilus-desktop-window.c'
--- src/nautilus-desktop-window.c 2011-09-30 12:23:46 +0000
+++ src/nautilus-desktop-window.c 2011-10-24 12:47:24 +0000
@@ -97,25 +97,26 @@
97 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);97 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
98 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);98 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);
9999
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
100 /* Don't allow close action on desktop */105 /* Don't allow close action on desktop */
101 action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,106 action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
102 NAUTILUS_ACTION_CLOSE);107 NAUTILUS_ACTION_CLOSE);
103 gtk_action_set_sensitive (action, FALSE);108 gtk_action_set_sensitive (action, FALSE);
104109
105 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);110 /* Don't allow new tab on desktop */
106 gtk_widget_hide (NAUTILUS_WINDOW (window)->details->menubar);111 action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
112 NAUTILUS_ACTION_NEW_TAB);
113 gtk_action_set_sensitive (action, FALSE);
107114
108 UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();115 UbuntuMenuProxy * proxy = ubuntu_menu_proxy_get();
109 if (proxy != NULL) {116 if (proxy != NULL) {
110 ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);117 ubuntu_menu_proxy_insert(proxy, GTK_WIDGET(window), NAUTILUS_WINDOW(window)->details->menubar, 0);
111 }118 }
112119
113 action = NULL;
114 /* Don't allow close action on desktop */
115 action = gtk_action_group_get_action (NAUTILUS_WINDOW (window)->details->main_action_group,
116 NAUTILUS_ACTION_CLOSE);
117 gtk_action_set_sensitive (action, FALSE);
118
119 /* Add actions for the desktop */120 /* Add actions for the desktop */
120 GtkActionGroup * desktop_agroup = gtk_action_group_new("DesktopActions");121 GtkActionGroup * desktop_agroup = gtk_action_group_new("DesktopActions");
121 gtk_action_group_set_translation_domain(desktop_agroup, GETTEXT_PACKAGE);122 gtk_action_group_set_translation_domain(desktop_agroup, GETTEXT_PACKAGE);

Subscribers

People subscribed via source and target branches