[gtranslator: 1/2] improve src/gtr-window.c to save main window layout
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator: 1/2] improve src/gtr-window.c to save main window layout
- Date: Mon, 25 Nov 2019 11:49:20 +0000 (UTC)
commit 62dbb3b0f63a8b2a77b36d2ae011008407c5370f
Author: Priyanka Saggu <priyankasaggu11929 gmail com>
Date: Mon Nov 25 11:49:04 2019 +0000
improve src/gtr-window.c to save main window layout
src/gtr-window.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 21a03377..19175f06 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -802,14 +802,17 @@ gtr_window_init (GtrWindow *window)
}
static void
-save_panes_state (GtrWindow * window)
+save_window_state (GtrWindow * window)
{
GtrWindowPrivate *priv = gtr_window_get_instance_private(window);
- g_settings_set (priv->state_settings, GTR_SETTINGS_WINDOW_SIZE, "(ii)",
- priv->width, priv->height);
- g_settings_set_int (priv->state_settings, GTR_SETTINGS_WINDOW_STATE,
- priv->window_state);
+ if ((priv->window_state &
+ (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) == 0)
+ {
+ gtk_window_get_size (GTK_WINDOW (window), &priv->width, &priv->height);
+ g_settings_set (priv->state_settings, GTR_SETTINGS_WINDOW_SIZE,
+ "(ii)", priv->width, priv->height);
+ }
}
static void
@@ -820,8 +823,7 @@ gtr_window_dispose (GObject * object)
if (!priv->dispose_has_run)
{
- save_panes_state (window);
-
+ save_window_state (window);
priv->dispose_has_run = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]