[balsa] Save the main window state more carefully



commit d5854f888413ff59d7589049fa8f3e79ad7d60f8
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Nov 20 10:45:47 2016 -0500

    Save the main window state more carefully
    
        * src/main-window.c (bw_window_state_event_cb): note when the
        main window is either maximized or fullscreen, and save the
        information as TRUE or FALSE.

 ChangeLog         |    8 ++++++++
 src/main-window.c |    8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 73e92b4..69e291b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2016-11-20  Peter Bloomfield  <pbloomfield bellsouth net>
 
+       Save the main window state more carefully
+
+       * src/main-window.c (bw_window_state_event_cb): note when the
+       main window is either maximized or fullscreen, and save the
+       information as TRUE or FALSE.
+
+2016-11-20  Peter Bloomfield  <pbloomfield bellsouth net>
+
        Save the correct window geometry
 
        * src/main-window.c (bw_size_allocate_cb): save the window
diff --git a/src/main-window.c b/src/main-window.c
index 02002bf..4b6e98a 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -645,17 +645,17 @@ balsa_window_get_toolbar_model(void)
 
 /*
  * "window-state-event" signal handler
- *
- * If the window is maximized, the resize grip is still sensitive but
- * does nothing, so leaving it showing could be confusing.
  */
 static gboolean
 bw_window_state_event_cb(BalsaWindow * window,
                          GdkEventWindowState * event,
                          GtkStatusbar * statusbar)
 {
+    /* Note when we are either maximized or fullscreen, to avoid saving
+     * nonsensical geometry. */
     balsa_app.mw_maximized =
-        event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
+        (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0
+        || (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
 
     return FALSE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]