[nautilus/wip/antoniof/switch-to-gtk4: 38/40] 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: 38/40] window: gtk_window_get_size() -> gtk_window_get_default_size()
- Date: Sun, 9 Jan 2022 00:43:49 +0000 (UTC)
commit 32ce5ab9cd048ad4875cabeafca6f46547884967
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 9627455f8..244adbf2a 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -2210,29 +2210,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]