mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 16:05:02 +02:00
Ignore out of order surface configure events
This commit is contained in:
1
glfw/wl_platform.h
vendored
1
glfw/wl_platform.h
vendored
@@ -219,6 +219,7 @@ typedef struct _GLFWwindowWayland
|
|||||||
struct {
|
struct {
|
||||||
int width, height;
|
int width, height;
|
||||||
uint32_t toplevel_states;
|
uint32_t toplevel_states;
|
||||||
|
bool set;
|
||||||
} current, pending;
|
} current, pending;
|
||||||
} _GLFWwindowWayland;
|
} _GLFWwindowWayland;
|
||||||
|
|
||||||
|
|||||||
5
glfw/wl_window.c
vendored
5
glfw/wl_window.c
vendored
@@ -479,6 +479,7 @@ xdgToplevelHandleConfigure(void* data,
|
|||||||
window->wl.pending.toplevel_states = new_states;
|
window->wl.pending.toplevel_states = new_states;
|
||||||
window->wl.pending.width = width;
|
window->wl.pending.width = width;
|
||||||
window->wl.pending.height = height;
|
window->wl.pending.height = height;
|
||||||
|
window->wl.pending.set = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xdgToplevelHandleClose(void* data,
|
static void xdgToplevelHandleClose(void* data,
|
||||||
@@ -499,7 +500,8 @@ static void xdgSurfaceHandleConfigure(void* data,
|
|||||||
{
|
{
|
||||||
_GLFWwindow* window = data;
|
_GLFWwindow* window = data;
|
||||||
xdg_surface_ack_configure(surface, serial);
|
xdg_surface_ack_configure(surface, serial);
|
||||||
|
if (!window->wl.pending.set) return;
|
||||||
|
|
||||||
|
|
||||||
uint32_t new_states = window->wl.pending.toplevel_states;
|
uint32_t new_states = window->wl.pending.toplevel_states;
|
||||||
int width = window->wl.pending.width;
|
int width = window->wl.pending.width;
|
||||||
@@ -509,6 +511,7 @@ static void xdgSurfaceHandleConfigure(void* data,
|
|||||||
width != window->wl.current.width ||
|
width != window->wl.current.width ||
|
||||||
height != window->wl.current.height) {
|
height != window->wl.current.height) {
|
||||||
|
|
||||||
|
window->wl.pending.set = false;
|
||||||
bool live_resize_done = !(new_states & TOPLEVEL_STATE_RESIZING) && (window->wl.current.toplevel_states & TOPLEVEL_STATE_RESIZING);
|
bool live_resize_done = !(new_states & TOPLEVEL_STATE_RESIZING) && (window->wl.current.toplevel_states & TOPLEVEL_STATE_RESIZING);
|
||||||
window->wl.current.toplevel_states = new_states;
|
window->wl.current.toplevel_states = new_states;
|
||||||
set_csd_window_geometry(window, &width, &height);
|
set_csd_window_geometry(window, &width, &height);
|
||||||
|
|||||||
Reference in New Issue
Block a user