[nautilus/gnome-3-22] application: use default screen with no active window
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-22] application: use default screen with no active window
- Date: Sat, 15 Oct 2016 14:09:50 +0000 (UTC)
commit 4c9c16281b25d6d3c65f034c18f6de26a36b1002
Author: Ernestas Kulik <ernestask src gnome org>
Date: Sat Oct 15 16:43:24 2016 +0300
application: use default screen with no active window
Opening a new window emits critical warnings if no active window is
present in real_open_location_full(). A default screen should be used in
that case instead of trying to get it from the window unconditionally.
https://bugzilla.gnome.org/show_bug.cgi?id=772856
src/nautilus-application.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 0a580ff..9c1a78c 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -379,6 +379,7 @@ real_open_location_full (NautilusApplication *self,
GFile *old_location = NULL;
char *old_uri, *new_uri;
gboolean use_same;
+ GdkScreen *screen;
use_same = TRUE;
/* FIXME: We are having problems on getting the current focused window with
@@ -450,8 +451,11 @@ real_open_location_full (NautilusApplication *self,
}
else
{
- target_window = nautilus_application_create_window (self,
- gtk_window_get_screen (GTK_WINDOW
(active_window)));
+ screen = active_window != NULL ?
+ gtk_window_get_screen (GTK_WINDOW (active_window)) :
+ gdk_screen_get_default ();
+
+ target_window = nautilus_application_create_window (self, screen);
/* Whatever the caller says, the slot won't be the same */
target_slot = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]