Merge lp:~3v1n0/nautilus/export-active-locations into lp:~ubuntu-desktop/nautilus/ubuntu

Proposed by Marco Trevisan (Treviño) on 2015-11-26
Status: Merged
Approved by: Sebastien Bacher on 2015-11-26
Approved revision: 479
Merged at revision: 478
Proposed branch: lp:~3v1n0/nautilus/export-active-locations
Merge into: lp:~ubuntu-desktop/nautilus/ubuntu
Diff against target: 160 lines (+51/-20)
2 files modified
debian/changelog (+5/-0)
debian/patches/19_unity_open_location_xid.patch (+46/-20)
To merge this branch: bzr merge lp:~3v1n0/nautilus/export-active-locations
Reviewer Review Type Date Requested Status
Sebastien Bacher 2015-11-26 Approve on 2015-11-26
Review via email: mp+278730@code.launchpad.net

Commit message

debian/patches/19_unity_open_location_xid.patch: ensure that the active location is always the first listed

Description of the change

debian/patches/19_unity_open_location_xid.patch: ensure that the active location is always the first listed

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

Looks fine, thanks

review: Approve
479. By Marco Trevisan (Treviño) on 2015-11-26

19_unity_open_location_xid.patch: only use window xid on X11

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 2015-11-09 17:33:59 +0000
3+++ debian/changelog 2015-11-26 17:05:10 +0000
4@@ -1,5 +1,6 @@
5 nautilus (1:3.18.1-1ubuntu1) UNRELEASED; urgency=medium
6
7+ [ Sebastien Bacher ]
8 * Work in progress, those patches still need to be updated/dropped before
9 uploading to xenial
10 - the menubar patch needs to be rewritten
11@@ -101,6 +102,10 @@
12 length allowed, and this tripped us up and crashed nautilus. (LP:
13 #1280867)
14
15+ [ Marco Trevisan (Treviño) ]
16+ * debian/patches/19_unity_open_location_xid.patch:
17+ ensure that the active location is always the first listed
18+
19 -- Sebastien Bacher <seb128@ubuntu.com> Mon, 09 Nov 2015 16:09:54 +0100
20
21 nautilus (3.18.1-1) unstable; urgency=medium
22
23=== modified file 'debian/patches/19_unity_open_location_xid.patch'
24--- debian/patches/19_unity_open_location_xid.patch 2015-11-09 17:33:59 +0000
25+++ debian/patches/19_unity_open_location_xid.patch 2015-11-26 17:05:10 +0000
26@@ -32,7 +32,7 @@
27 {
28 gint i;
29 GList *l, *sl;
30-@@ -1113,15 +1113,24 @@ update_dbus_opened_locations (NautilusAp
31+@@ -1113,15 +1113,36 @@ update_dbus_opened_locations (NautilusAp
32
33 g_return_if_fail (NAUTILUS_IS_APPLICATION (app));
34
35@@ -46,18 +46,30 @@
36
37 + g_variant_builder_init (&wb, G_VARIANT_TYPE ("as"));
38 +
39++ NautilusWindowSlot *active_slot = nautilus_window_get_active_slot (window);
40++ location = nautilus_window_slot_get_location (active_slot);
41++
42++ if (location != NULL) {
43++ gchar *active_uri = g_file_get_uri (location);
44++ g_variant_builder_add (&wb, "s", active_uri);
45++ g_free (active_uri);
46++ }
47++
48 for (sl = nautilus_window_get_slots (window); sl; sl = sl->next) {
49 NautilusWindowSlot *slot = sl->data;
50 location = nautilus_window_slot_get_location (slot);
51
52 if (location != NULL) {
53 gchar *uri = g_file_get_uri (location);
54-+ g_variant_builder_add (&wb, "s", uri);
55++
56++ if (slot != active_slot) {
57++ g_variant_builder_add (&wb, "s", uri);
58++ }
59 +
60 GList *found = g_list_find_custom (locations, uri, (GCompareFunc) g_strcmp0);
61
62 if (!found) {
63-@@ -1132,6 +1141,17 @@ update_dbus_opened_locations (NautilusAp
64+@@ -1132,6 +1153,17 @@ update_dbus_opened_locations (NautilusAp
65 }
66 }
67 }
68@@ -75,7 +87,7 @@
69 }
70
71 locations_array = g_new (gchar*, locations_size + 1);
72-@@ -1145,6 +1165,8 @@ update_dbus_opened_locations (NautilusAp
73+@@ -1145,6 +1177,8 @@ update_dbus_opened_locations (NautilusAp
74
75 nautilus_freedesktop_dbus_set_open_locations (app->priv->fdb_manager,
76 (const gchar**) locations_array);
77@@ -84,16 +96,28 @@
78
79 g_free (locations_array);
80 g_list_free_full (locations, g_free);
81-@@ -1155,7 +1177,7 @@ on_slot_location_changed (NautilusWindow
82- GParamSpec *pspec,
83- NautilusApplication *application)
84+@@ -1152,10 +1186,17 @@ update_dbus_opened_locations (NautilusAp
85+
86+ static void
87+ on_slot_location_changed (NautilusWindowSlot *slot,
88+- GParamSpec *pspec,
89+- NautilusApplication *application)
90++ GParamSpec *pspec,
91++ NautilusApplication *application)
92++{
93++ nautilus_application_update_dbus_opened_locations (application);
94++}
95++
96++static void
97++on_slot_active_changed (NautilusWindowSlot *slot,
98++ NautilusApplication *application)
99 {
100 - update_dbus_opened_locations (application);
101 + nautilus_application_update_dbus_opened_locations (application);
102 }
103
104 static void
105-@@ -1164,7 +1186,7 @@ on_slot_added (NautilusWindow *wind
106+@@ -1164,10 +1205,11 @@ on_slot_added (NautilusWindow *wind
107 NautilusApplication *application)
108 {
109 if (nautilus_window_slot_get_location (slot)) {
110@@ -102,7 +126,11 @@
111 }
112
113 g_signal_connect (slot, "notify::location", G_CALLBACK (on_slot_location_changed), application);
114-@@ -1175,12 +1197,19 @@ on_slot_removed (NautilusWindow *wi
115++ g_signal_connect (slot, "active", G_CALLBACK (on_slot_active_changed), application);
116+ }
117+
118+ static void
119+@@ -1175,9 +1217,17 @@ on_slot_removed (NautilusWindow *wi
120 NautilusWindowSlot *slot,
121 NautilusApplication *application)
122 {
123@@ -110,20 +138,18 @@
124 + nautilus_application_update_dbus_opened_locations (application);
125
126 g_signal_handlers_disconnect_by_func (slot, on_slot_location_changed, application);
127- }
128-
129- static void
130++ g_signal_handlers_disconnect_by_func (slot, on_slot_active_changed, application);
131++}
132++
133++static void
134 +on_realize (GtkWidget *widget,
135 + NautilusApplication *application)
136 +{
137 + nautilus_application_update_dbus_opened_locations (application);
138-+}
139-+
140-+static void
141- nautilus_application_window_added (GtkApplication *app,
142- GtkWindow *window)
143- {
144-@@ -1190,6 +1219,7 @@ nautilus_application_window_added (GtkAp
145+ }
146+
147+ static void
148+@@ -1190,6 +1240,7 @@ nautilus_application_window_added (GtkAp
149
150 if (NAUTILUS_IS_WINDOW (window)) {
151 self->priv->windows = g_list_prepend (self->priv->windows, window);
152@@ -131,7 +157,7 @@
153 g_signal_connect (window, "slot-added", G_CALLBACK (on_slot_added), app);
154 g_signal_connect (window, "slot-removed", G_CALLBACK (on_slot_removed), app);
155 }
156-@@ -1205,6 +1235,7 @@ nautilus_application_window_removed (Gtk
157+@@ -1205,6 +1256,7 @@ nautilus_application_window_removed (Gtk
158
159 if (NAUTILUS_IS_WINDOW (window)) {
160 self->priv->windows = g_list_remove_all (self->priv->windows, window);

Subscribers

People subscribed via source and target branches

to all changes: