forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
64f6118af4
commit
048a0172a0
@ -162,6 +162,7 @@ struct _GdkWaylandSurface
|
|||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
GdkToplevelState state;
|
GdkToplevelState state;
|
||||||
|
gboolean is_resizing;
|
||||||
} toplevel;
|
} toplevel;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
@ -1435,16 +1436,21 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
|
|||||||
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||||
GdkToplevelState new_state;
|
GdkToplevelState new_state;
|
||||||
int width, height;
|
int width, height;
|
||||||
|
gboolean is_resizing;
|
||||||
gboolean fixed_size;
|
gboolean fixed_size;
|
||||||
gboolean saved_size;
|
gboolean saved_size;
|
||||||
|
|
||||||
new_state = impl->pending.toplevel.state;
|
new_state = impl->pending.toplevel.state;
|
||||||
impl->pending.toplevel.state = 0;
|
impl->pending.toplevel.state = 0;
|
||||||
|
|
||||||
|
is_resizing = impl->pending.toplevel.is_resizing;
|
||||||
|
impl->pending.toplevel.is_resizing = FALSE;
|
||||||
|
|
||||||
fixed_size =
|
fixed_size =
|
||||||
new_state & (GDK_TOPLEVEL_STATE_MAXIMIZED |
|
new_state & (GDK_TOPLEVEL_STATE_MAXIMIZED |
|
||||||
GDK_TOPLEVEL_STATE_FULLSCREEN |
|
GDK_TOPLEVEL_STATE_FULLSCREEN |
|
||||||
GDK_TOPLEVEL_STATE_TILED);
|
GDK_TOPLEVEL_STATE_TILED) ||
|
||||||
|
is_resizing;
|
||||||
|
|
||||||
width = impl->pending.toplevel.width;
|
width = impl->pending.toplevel.width;
|
||||||
height = impl->pending.toplevel.height;
|
height = impl->pending.toplevel.height;
|
||||||
@ -1473,6 +1479,10 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
|
|||||||
/* Save size for next time we get 0x0 */
|
/* Save size for next time we get 0x0 */
|
||||||
_gdk_wayland_surface_save_size (surface);
|
_gdk_wayland_surface_save_size (surface);
|
||||||
}
|
}
|
||||||
|
else if (is_resizing)
|
||||||
|
{
|
||||||
|
impl->next_layout.toplevel.should_constrain = TRUE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
impl->next_layout.toplevel.should_constrain = FALSE;
|
impl->next_layout.toplevel.should_constrain = FALSE;
|
||||||
@ -1679,9 +1689,12 @@ xdg_toplevel_configure (void *data,
|
|||||||
struct wl_array *states)
|
struct wl_array *states)
|
||||||
{
|
{
|
||||||
GdkSurface *surface = GDK_SURFACE (data);
|
GdkSurface *surface = GDK_SURFACE (data);
|
||||||
|
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||||
uint32_t *p;
|
uint32_t *p;
|
||||||
GdkToplevelState pending_state = 0;
|
GdkToplevelState pending_state = 0;
|
||||||
|
|
||||||
|
impl->pending.toplevel.is_resizing = FALSE;
|
||||||
|
|
||||||
wl_array_for_each (p, states)
|
wl_array_for_each (p, states)
|
||||||
{
|
{
|
||||||
uint32_t state = *p;
|
uint32_t state = *p;
|
||||||
@ -1698,6 +1711,7 @@ xdg_toplevel_configure (void *data,
|
|||||||
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
|
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
|
||||||
break;
|
break;
|
||||||
case XDG_TOPLEVEL_STATE_RESIZING:
|
case XDG_TOPLEVEL_STATE_RESIZING:
|
||||||
|
impl->pending.toplevel.is_resizing = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* Unknown state */
|
/* Unknown state */
|
||||||
@ -1768,9 +1782,12 @@ zxdg_toplevel_v6_configure (void *data,
|
|||||||
struct wl_array *states)
|
struct wl_array *states)
|
||||||
{
|
{
|
||||||
GdkSurface *surface = GDK_SURFACE (data);
|
GdkSurface *surface = GDK_SURFACE (data);
|
||||||
|
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||||
uint32_t *p;
|
uint32_t *p;
|
||||||
GdkToplevelState pending_state = 0;
|
GdkToplevelState pending_state = 0;
|
||||||
|
|
||||||
|
impl->pending.toplevel.is_resizing = FALSE;
|
||||||
|
|
||||||
wl_array_for_each (p, states)
|
wl_array_for_each (p, states)
|
||||||
{
|
{
|
||||||
uint32_t state = *p;
|
uint32_t state = *p;
|
||||||
@ -1787,6 +1804,7 @@ zxdg_toplevel_v6_configure (void *data,
|
|||||||
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
|
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
|
||||||
break;
|
break;
|
||||||
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
|
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
|
||||||
|
impl->pending.toplevel.is_resizing = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* Unknown state */
|
/* Unknown state */
|
||||||
|
Loading…
Reference in New Issue
Block a user