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

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Sebastien Bacher
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 Approve
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.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Looks fine, thanks

review: Approve
479. By Marco Trevisan (Treviño)

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

Subscribers

People subscribed via source and target branches

to all changes: