diff options
author | Ernestas Kulik <ernestask@src.gnome.org> | 2016-10-15 16:43:24 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@src.gnome.org> | 2016-10-15 17:07:38 +0300 |
commit | 301e4270f9ac7ca9213b1a9530635b024a1dca57 (patch) | |
tree | ffec6c5081e32424e1461e20f5432f191ec827cb /src/nautilus-application.c | |
parent | 676382d587894686c0901d79c6531f8f8b160db7 (diff) | |
download | nautilus-301e4270f9ac7ca9213b1a9530635b024a1dca57.tar.gz |
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
Diffstat (limited to 'src/nautilus-application.c')
-rw-r--r-- | 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 0a580ff02..9c1a78cdf 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; } |