[nautilus] application: use default screen with no active window



commit 301e4270f9ac7ca9213b1a9530635b024a1dca57
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]