[nautilus] window: explicitily set active window
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] window: explicitily set active window
- Date: Thu, 12 Nov 2015 21:57:43 +0000 (UTC)
commit 49c03251ee4b1de798e5675d74a7d30d281f22e8
Author: Carlos Soriano <csoriano gnome org>
Date: Thu Nov 12 17:06:09 2015 +0100
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
src/nautilus-application.c | 4 ++++
src/nautilus-window.c | 5 ++++-
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 2e3530b..8a491e7 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 6a15bf2..d7adb93 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]