summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-11-12 17:06:09 +0100
committerCarlos Soriano <csoriano@gnome.org>2015-11-12 22:51:11 +0100
commit49c03251ee4b1de798e5675d74a7d30d281f22e8 (patch)
treee1f10ae353fd5f0d5707807f7d5cda5e37103109
parent773fc4bdb72d86045bbf288eb994b4fd616226f3 (diff)
downloadnautilus-49c03251ee4b1de798e5675d74a7d30d281f22e8.tar.gz
window: explicitily set active window
We were relying on getting the current active window from gtk to switch open locations, but what people found is that some times another window change its location instead of the current one. I couldn't figure out the root of the problem, so I'm going to pass explicitly the window on the callers as previous 3.18 we were doing. Would be cool to find the root of the problem though... https://bugzilla.gnome.org/show_bug.cgi?id=756499
-rw-r--r--src/nautilus-application.c4
-rw-r--r--src/nautilus-window.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 2e3530b11..8a491e747 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -446,6 +446,10 @@ nautilus_application_open_location_full (NautilusApplication *application,
gboolean use_same;
use_same = TRUE;
+ /* FIXME: We are having problems on getting the current focused window with
+ * gtk_application_get_active_window, see https://bugzilla.gnome.org/show_bug.cgi?id=756499
+ * so what we do is never rely on this on the callers, but would be cool to
+ * make it work withouth explicitly setting the active window on the callers. */
active_window = NAUTILUS_WINDOW (gtk_application_get_active_window (GTK_APPLICATION (application)));
active_slot = nautilus_window_get_active_slot (active_window);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 6a15bf2b0..d7adb93db 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -926,8 +926,11 @@ open_location_cb (NautilusWindow *window,
break;
}
+ /* FIXME: We shouldn't need to provide the window, but seems gtk_application_get_active_window
+ * is not working properly in GtkApplication, so we cannot rely on that...
+ */
nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
- location, flags, NULL, NULL, NULL);
+ location, flags, NULL, window, NULL);
}
/* Callback used when the places sidebar needs us to present an error message */