summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElias Projahn <johrpan@gmail.com>2020-12-17 22:45:20 +0100
committerAntónio Fernandes <antoniof@gnome.org>2021-01-08 12:41:39 +0000
commit5b09ddac4d491df1566543b3815f6fbf28caee2c (patch)
treed942c63069459e7bf9ef03bd1a7e9e46db589fa1
parentcda0d493bf245f10e1fbcc815582dc0879568647 (diff)
downloadnautilus-antoniof/backports-for-3-38-3.tar.gz
window: Don't save state when tiledantoniof/backports-for-3-38-3
The saved window state (whether the window is maximized and its initial size) should be the state, that the user would most likely want the next opened window to start with. As the tiled state doesn't make sense without other windows and because it's not really possible to properly restore it, it will not be saved anymore. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1685
-rw-r--r--src/nautilus-window.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index c81d150d1..494e20eb8 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -2401,12 +2401,23 @@ nautilus_window_save_geometry (NautilusWindow *window)
gint width;
gint height;
GVariant *initial_size;
+ GdkWindowState window_state;
gtk_window_get_size (GTK_WINDOW (window), &width, &height);
initial_size = g_variant_new_parsed ("(%i, %i)", width, height);
- is_maximized = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window)))
- & GDK_WINDOW_STATE_MAXIMIZED;
+
+ window_state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window)));
+
+ /* Don't save the window state for tiled windows. This is a special case,
+ * where the geometry only makes sense in combination with other tiled
+ * windows, that we can't possibly restore. */
+ if (window_state & GDK_WINDOW_STATE_TILED)
+ {
+ return;
+ }
+
+ is_maximized = window_state & GDK_WINDOW_STATE_MAXIMIZED;
if (!is_maximized)
{