diff options
author | Simon McVittie <smcv@debian.org> | 2017-10-26 15:51:51 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-01-20 13:10:49 +0100 |
commit | e22990302a050fa5b037a3e21ccaa1c130b59fbb (patch) | |
tree | aa3fe280798af9ecd81d6243d110c46f9108662e | |
parent | 42ff22f222566448b97d4c980b91ac5f66ea9448 (diff) | |
download | gtk+-e22990302a050fa5b037a3e21ccaa1c130b59fbb.tar.gz |
Set GDK_WINDOW_STATE_TILED if any edge is tiled
This state flag is used in several places in GTK+, for example to
ignore RESIZE_INC hints if tiled. Setting it is also necessary for
backwards compatibility with applications that changed their behaviour
when tiled, such as GNOME Terminal and its MATE fork.
Signed-off-by: Simon McVittie <smcv@debian.org>
https://bugzilla.gnome.org/show_bug.cgi?id=789357
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 8 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 20 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index f5611f09db..3f9db70882 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -2890,16 +2890,16 @@ gtk_surface_configure (void *data, /* Since v2 */ case GTK_SURFACE1_STATE_TILED_TOP: - new_state |= GDK_WINDOW_STATE_TOP_TILED; + new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_TOP_TILED); break; case GTK_SURFACE1_STATE_TILED_RIGHT: - new_state |= GDK_WINDOW_STATE_RIGHT_TILED; + new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_RIGHT_TILED); break; case GTK_SURFACE1_STATE_TILED_BOTTOM: - new_state |= GDK_WINDOW_STATE_BOTTOM_TILED; + new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_BOTTOM_TILED); break; case GTK_SURFACE1_STATE_TILED_LEFT: - new_state |= GDK_WINDOW_STATE_LEFT_TILED; + new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_LEFT_TILED); break; default: /* Unknown state */ diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 84a1b2f1ae..67a7217b4f 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -199,6 +199,11 @@ gdk_x11_display_event_translator_init (GdkEventTranslatorIface *iface) iface->translate_event = gdk_x11_display_translate_event; } +#define ANY_EDGE_TILED (GDK_WINDOW_STATE_LEFT_TILED | \ + GDK_WINDOW_STATE_RIGHT_TILED | \ + GDK_WINDOW_STATE_TOP_TILED | \ + GDK_WINDOW_STATE_BOTTOM_TILED) + static void do_edge_constraint_state_check (GdkWindow *window, GdkWindowState old_state, @@ -214,8 +219,9 @@ do_edge_constraint_state_check (GdkWindow *window, edge_constraints = toplevel->edge_constraints; /* If the WM doesn't support _GTK_EDGE_CONSTRAINTS, rely on the fallback - * implementation. If it supports _GTK_EDGE_CONSTRAINTS, however, remove - * the GDK_WINDOW_STATE_TILED flag explicitly. + * implementation. If it supports _GTK_EDGE_CONSTRAINTS, arrange for + * GDK_WINDOW_STATE_TILED to be set if any edge is tiled, and cleared + * if no edge is tiled. */ if (!gdk_window_supports_edge_constraints (window)) { @@ -237,7 +243,15 @@ do_edge_constraint_state_check (GdkWindow *window, else { if (old_state & GDK_WINDOW_STATE_TILED) - local_unset |= GDK_WINDOW_STATE_TILED; + { + if (!(edge_constraints & ANY_EDGE_TILED)) + local_unset |= GDK_WINDOW_STATE_TILED; + } + else + { + if (edge_constraints & ANY_EDGE_TILED) + local_set |= GDK_WINDOW_STATE_TILED; + } } /* Top edge */ |