[nautilus/wip/antoniof/switch-to-gtk4: 34/36] window: gtk_window_get_size() -> gtk_window_get_default_size()
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/switch-to-gtk4: 34/36] window: gtk_window_get_size() -> gtk_window_get_default_size()
- Date: Fri, 7 Jan 2022 08:00:54 +0000 (UTC)
commit 73d5a3fe4bc9317ff8cc0c02109d65e6bcdb6896
Author: António Fernandes <antoniof gnome org>
Date: Fri Dec 31 17:57:46 2021 +0000
window: gtk_window_get_size() -> gtk_window_get_default_size()
The new method ignores maximized and tiled size, which is convenient.
src/nautilus-window.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
---
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index a2230f736..19ebd74fc 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -2206,29 +2206,11 @@ nautilus_window_finalize (GObject *object)
static void
nautilus_window_save_geometry (NautilusWindow *window)
{
- GdkWindow *gdk_window;
- GdkWindowState window_state;
gint width;
gint height;
GVariant *initial_size;
- g_assert (NAUTILUS_IS_WINDOW (window));
-
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- if (!gdk_window)
- {
- return;
- }
- window_state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window)));
- if (window_state & (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_MAXIMIZED))
- {
- /* Don't save the window state for tiled or maximized windows. In GTK
- * gtk_window_get_default_size() is going to do this for us.
- */
- return;
- }
-
- gtk_window_get_size (GTK_WINDOW (window), &width, &height);
+ gtk_window_get_default_size (GTK_WINDOW (window), &width, &height);
initial_size = g_variant_new_parsed ("(%i, %i)", width, height);
g_settings_set_value (nautilus_window_state,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]