[gnome-terminal] window: Fix tiled check



commit e7cee82959617d2b70d0dfdbb1463ad5057bab1f
Author: Christian Persch <chpe src gnome org>
Date:   Mon Oct 23 18:44:19 2017 +0200

    window: Fix tiled check
    
    Add new tiled window states to the check.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789356

 src/terminal-window.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/terminal-window.c b/src/terminal-window.c
index cd5d4a3..ec6d070 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -115,6 +115,17 @@ struct _TerminalWindowPrivate
 #endif
 #endif
 
+/* See bug #789356 */
+#if GTK_CHECK_VERSION (3, 22, 23)
+#define WINDOW_STATE_TILED (GDK_WINDOW_STATE_TILED       |
+                            GDK_WINDOW_STATE_LEFT_TILED  |
+                            GDK_WINDOW_STATE_RIGHT_TILED |
+                            GDK_WINDOW_STATE_TOP_TILED   |
+                            GDK_WINDOW_STATE_BOTTOM_TILED)
+#else
+#define WINDOW_STATE_TILED (GDK_WINDOW_STATE_TILED)
+#endif
+
 static void terminal_window_dispose     (GObject             *object);
 static void terminal_window_finalize    (GObject             *object);
 static gboolean terminal_window_state_event (GtkWidget            *widget,
@@ -1613,7 +1624,7 @@ screen_resize_window_cb (TerminalScreen *screen,
   if (gtk_widget_get_realized (widget) &&
       (gdk_window_get_state (gtk_widget_get_window (widget)) & (GDK_WINDOW_STATE_MAXIMIZED |
                                                                 GDK_WINDOW_STATE_FULLSCREEN |
-                                                                GDK_WINDOW_STATE_TILED)) != 0)
+                                                                WINDOW_STATE_TILED)) != 0)
     return;
 
   vte_terminal_set_size (VTE_TERMINAL (priv->active_screen), columns, rows);
@@ -2718,7 +2729,7 @@ terminal_window_update_size (TerminalWindow *window)
 
   if (gdk_window != NULL &&
       (gdk_window_get_state (gdk_window) &
-       (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED)))
+       (GDK_WINDOW_STATE_MAXIMIZED | WINDOW_STATE_TILED)))
     {
       /* Don't adjust the size of maximized or tiled (snapped, half-maximized)
        * windows: if we do, there will be ugly gaps of up to 1 character cell


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