[gtk/matthiasc/surface-state-rework: 39/80] gdk/wayland: Always configured size when resizing
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/surface-state-rework: 39/80] gdk/wayland: Always configured size when resizing
- Date: Sat, 5 Dec 2020 17:42:39 +0000 (UTC)
commit 536e3c1af14806d0c1cc3899a56d0dbe12feb616
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Dec 2 11:38:17 2020 +0100
gdk/wayland: Always configured size when resizing
GTK4 doesn't support arbitrary constraints when resizing a window (e.g.
steps, or aspect ratio), so we don't need to care about the result from
compute-size when doing interactive resizing.
gdk/wayland/gdksurface-wayland.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 8b16669213..d01d7d4aa3 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -162,6 +162,7 @@ struct _GdkWaylandSurface
int width;
int height;
GdkToplevelState state;
+ gboolean is_resizing;
} toplevel;
struct {
@@ -1435,16 +1436,21 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkToplevelState new_state;
int width, height;
+ gboolean is_resizing;
gboolean fixed_size;
gboolean saved_size;
new_state = impl->pending.toplevel.state;
impl->pending.toplevel.state = 0;
+ is_resizing = impl->pending.toplevel.is_resizing;
+ impl->pending.toplevel.is_resizing = FALSE;
+
fixed_size =
new_state & (GDK_TOPLEVEL_STATE_MAXIMIZED |
GDK_TOPLEVEL_STATE_FULLSCREEN |
- GDK_TOPLEVEL_STATE_TILED);
+ GDK_TOPLEVEL_STATE_TILED) ||
+ is_resizing;
width = impl->pending.toplevel.width;
height = impl->pending.toplevel.height;
@@ -1473,6 +1479,10 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
/* Save size for next time we get 0x0 */
_gdk_wayland_surface_save_size (surface);
}
+ else if (is_resizing)
+ {
+ impl->next_layout.toplevel.should_constrain = TRUE;
+ }
else
{
impl->next_layout.toplevel.should_constrain = FALSE;
@@ -1679,9 +1689,12 @@ xdg_toplevel_configure (void *data,
struct wl_array *states)
{
GdkSurface *surface = GDK_SURFACE (data);
+ GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
uint32_t *p;
GdkToplevelState pending_state = 0;
+ impl->pending.toplevel.is_resizing = FALSE;
+
wl_array_for_each (p, states)
{
uint32_t state = *p;
@@ -1698,6 +1711,7 @@ xdg_toplevel_configure (void *data,
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
break;
case XDG_TOPLEVEL_STATE_RESIZING:
+ impl->pending.toplevel.is_resizing = TRUE;
break;
default:
/* Unknown state */
@@ -1768,9 +1782,12 @@ zxdg_toplevel_v6_configure (void *data,
struct wl_array *states)
{
GdkSurface *surface = GDK_SURFACE (data);
+ GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
uint32_t *p;
GdkToplevelState pending_state = 0;
+ impl->pending.toplevel.is_resizing = FALSE;
+
wl_array_for_each (p, states)
{
uint32_t state = *p;
@@ -1787,6 +1804,7 @@ zxdg_toplevel_v6_configure (void *data,
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
break;
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
+ impl->pending.toplevel.is_resizing = TRUE;
break;
default:
/* Unknown state */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]