Don't apply GDK_HINT_RESIZE_INC to GDK_WINDOW_STATE_TILED windows

This matches the behaviour of Mutter, Metacity and traditional X11
window managers on the window manager side, and is what we want
for at least gnome-terminal. I can't think of any reason why we'd
want incremental resize in any other tiled window.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=760944

https://bugzilla.gnome.org/show_bug.cgi?id=755947
This commit is contained in:
Simon McVittie
2016-06-06 09:48:36 +01:00
committed by Matthias Clasen
parent d9dd7eb757
commit f65c116d2a
2 changed files with 7 additions and 7 deletions

View File

@@ -1223,7 +1223,7 @@ xdg_surface_configure (void *data,
GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWindowState new_state = 0;
gboolean maximized_or_fullscreen;
gboolean fixed_size;
uint32_t *p;
wl_array_for_each (p, states)
@@ -1252,8 +1252,8 @@ xdg_surface_configure (void *data,
}
}
maximized_or_fullscreen =
new_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN);
fixed_size =
new_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_TILED);
/* According to xdg_shell, an xdg_surface.configure with size 0x0
* should be interpreted as that it is up to the client to set a
@@ -1263,7 +1263,7 @@ xdg_surface_configure (void *data,
* the client should configure its size back to what it was before
* being maximize or fullscreen.
*/
if (width == 0 && height == 0 && !maximized_or_fullscreen)
if (width == 0 && height == 0 && !fixed_size)
{
width = impl->saved_width;
height = impl->saved_height;
@@ -1274,7 +1274,7 @@ xdg_surface_configure (void *data,
GdkWindowHints geometry_mask = impl->geometry_mask;
/* Ignore size increments for maximized/fullscreen windows */
if (maximized_or_fullscreen)
if (fixed_size)
geometry_mask &= ~GDK_HINT_RESIZE_INC;
gdk_window_constrain_size (&impl->geometry_hints,

View File

@@ -9912,8 +9912,8 @@ gtk_window_constrain_size (GtkWindow *window,
GtkWindowPrivate *priv = window->priv;
guint geometry_flags;
/* ignore size increments for maximized/fullscreen windows */
if (priv->maximized || priv->fullscreen)
/* ignore size increments for windows that fit in a fixed space */
if (priv->maximized || priv->fullscreen || priv->tiled)
geometry_flags = flags & ~GDK_HINT_RESIZE_INC;
else
geometry_flags = flags;