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

Proposed by Marco Trevisan (Treviño) on 2015-11-30
Status: Merged
Merged at revision: 481
Proposed branch: lp:~3v1n0/nautilus/export-active-locations-warning-fix
Merge into: lp:~ubuntu-desktop/nautilus/ubuntu
Diff against target: 123 lines (+22/-18)
1 file modified
debian/patches/19_unity_open_location_xid.patch (+22/-18)
To merge this branch: bzr merge lp:~3v1n0/nautilus/export-active-locations-warning-fix
Reviewer Review Type Date Requested Status
Sebastien Bacher 2015-11-30 Approve on 2015-11-30
Review via email: mp+278983@code.launchpad.net
To post a comment you must log in.
482. By Marco Trevisan (Treviño) on 2015-11-30

debian/patches/19_unity_open_location_xid.patch: check for window type, not display

Sebastien Bacher (seb128) wrote :

thanks, that fixes the segfault

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/patches/19_unity_open_location_xid.patch'
2--- debian/patches/19_unity_open_location_xid.patch 2015-11-26 17:42:33 +0000
3+++ debian/patches/19_unity_open_location_xid.patch 2015-11-30 15:16:32 +0000
4@@ -32,7 +32,7 @@
5 {
6 gint i;
7 GList *l, *sl;
8-@@ -1113,15 +1113,36 @@ update_dbus_opened_locations (NautilusAp
9+@@ -1113,15 +1113,40 @@ update_dbus_opened_locations (NautilusAp
10
11 g_return_if_fail (NAUTILUS_IS_APPLICATION (app));
12
13@@ -47,12 +47,16 @@
14 + g_variant_builder_init (&wb, G_VARIANT_TYPE ("as"));
15 +
16 + NautilusWindowSlot *active_slot = nautilus_window_get_active_slot (window);
17-+ location = nautilus_window_slot_get_location (active_slot);
18-+
19-+ if (location != NULL) {
20-+ gchar *active_uri = g_file_get_uri (location);
21-+ g_variant_builder_add (&wb, "s", active_uri);
22-+ g_free (active_uri);
23++
24++ if (active_slot != NULL)
25++ {
26++ location = nautilus_window_slot_get_location (active_slot);
27++
28++ if (location != NULL) {
29++ gchar *active_uri = g_file_get_uri (location);
30++ g_variant_builder_add (&wb, "s", active_uri);
31++ g_free (active_uri);
32++ }
33 + }
34 +
35 for (sl = nautilus_window_get_slots (window); sl; sl = sl->next) {
36@@ -69,7 +73,7 @@
37 GList *found = g_list_find_custom (locations, uri, (GCompareFunc) g_strcmp0);
38
39 if (!found) {
40-@@ -1132,6 +1153,21 @@ update_dbus_opened_locations (NautilusAp
41+@@ -1132,6 +1157,21 @@ update_dbus_opened_locations (NautilusAp
42 }
43 }
44 }
45@@ -78,7 +82,7 @@
46 + guint32 window_id = 0;
47 + GdkWindow *gdk_win = gtk_widget_get_window (GTK_WIDGET (l->data));
48 +#ifdef GDK_WINDOWING_X11
49-+ if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
50++ if (GDK_IS_X11_WINDOW (gdk_win)) {
51 + window_id = gdk_x11_window_get_xid (gdk_win);
52 + } else {
53 + window_id = GPOINTER_TO_UINT(gdk_win);
54@@ -91,7 +95,7 @@
55 }
56
57 locations_array = g_new (gchar*, locations_size + 1);
58-@@ -1145,6 +1181,8 @@ update_dbus_opened_locations (NautilusAp
59+@@ -1145,6 +1185,8 @@ update_dbus_opened_locations (NautilusAp
60
61 nautilus_freedesktop_dbus_set_open_locations (app->priv->fdb_manager,
62 (const gchar**) locations_array);
63@@ -100,7 +104,7 @@
64
65 g_free (locations_array);
66 g_list_free_full (locations, g_free);
67-@@ -1152,10 +1190,17 @@ update_dbus_opened_locations (NautilusAp
68+@@ -1152,10 +1194,17 @@ update_dbus_opened_locations (NautilusAp
69
70 static void
71 on_slot_location_changed (NautilusWindowSlot *slot,
72@@ -108,20 +112,20 @@
73 - NautilusApplication *application)
74 + GParamSpec *pspec,
75 + NautilusApplication *application)
76- {
77-- update_dbus_opened_locations (application);
78++{
79 + nautilus_application_update_dbus_opened_locations (application);
80 +}
81 +
82 +static void
83 +on_slot_active_changed (NautilusWindowSlot *slot,
84 + NautilusApplication *application)
85-+{
86+ {
87+- update_dbus_opened_locations (application);
88 + nautilus_application_update_dbus_opened_locations (application);
89 }
90
91 static void
92-@@ -1164,10 +1209,11 @@ on_slot_added (NautilusWindow *wind
93+@@ -1164,10 +1213,11 @@ on_slot_added (NautilusWindow *wind
94 NautilusApplication *application)
95 {
96 if (nautilus_window_slot_get_location (slot)) {
97@@ -134,7 +138,7 @@
98 }
99
100 static void
101-@@ -1175,9 +1221,17 @@ on_slot_removed (NautilusWindow *wi
102+@@ -1175,9 +1225,17 @@ on_slot_removed (NautilusWindow *wi
103 NautilusWindowSlot *slot,
104 NautilusApplication *application)
105 {
106@@ -153,7 +157,7 @@
107 }
108
109 static void
110-@@ -1190,6 +1244,7 @@ nautilus_application_window_added (GtkAp
111+@@ -1190,6 +1248,7 @@ nautilus_application_window_added (GtkAp
112
113 if (NAUTILUS_IS_WINDOW (window)) {
114 self->priv->windows = g_list_prepend (self->priv->windows, window);
115@@ -161,7 +165,7 @@
116 g_signal_connect (window, "slot-added", G_CALLBACK (on_slot_added), app);
117 g_signal_connect (window, "slot-removed", G_CALLBACK (on_slot_removed), app);
118 }
119-@@ -1205,6 +1260,7 @@ nautilus_application_window_removed (Gtk
120+@@ -1205,6 +1264,7 @@ nautilus_application_window_removed (Gtk
121
122 if (NAUTILUS_IS_WINDOW (window)) {
123 self->priv->windows = g_list_remove_all (self->priv->windows, window);

Subscribers

People subscribed via source and target branches

to all changes: