forked from pyrite-dev/milsko
wayland: prevent xdg_toplevel_configure from firing too often
This commit is contained in:
parent
fdf73ab9e7
commit
0788297ed3
2 changed files with 19 additions and 12 deletions
|
|
@ -502,6 +502,8 @@ struct _MwLLWayland {
|
||||||
MwU32 ww, wh; /* Window position */
|
MwU32 ww, wh; /* Window position */
|
||||||
MwPoint cur_mouse_pos; /* Currently known mouse position */
|
MwPoint cur_mouse_pos; /* Currently known mouse position */
|
||||||
|
|
||||||
|
int resizing;
|
||||||
|
|
||||||
MwU32 mw, mh; /* Monitor width and height as advertised by wl_output.mode */
|
MwU32 mw, mh; /* Monitor width and height as advertised by wl_output.mode */
|
||||||
|
|
||||||
MwLL parent;
|
MwLL parent;
|
||||||
|
|
|
||||||
|
|
@ -1162,6 +1162,7 @@ static void xdg_toplevel_configure(void* data,
|
||||||
self->wayland.ww = width;
|
self->wayland.ww = width;
|
||||||
self->wayland.wh = height;
|
self->wayland.wh = height;
|
||||||
|
|
||||||
|
if(self->wayland.resizing == 0) {
|
||||||
xdg_surface_set_window_geometry(self->wayland.toplevel->xdg_surface, 0, 0, self->wayland.ww, self->wayland.wh);
|
xdg_surface_set_window_geometry(self->wayland.toplevel->xdg_surface, 0, 0, self->wayland.ww, self->wayland.wh);
|
||||||
|
|
||||||
backbuffer_destroy(&self->wayland);
|
backbuffer_destroy(&self->wayland);
|
||||||
|
|
@ -1178,6 +1179,8 @@ static void xdg_toplevel_configure(void* data,
|
||||||
zwp_locked_pointer_v1_set_cursor_position_hint(self->wayland.locked_pointer, 0, CSD_BORDER_FRAME_TOP);
|
zwp_locked_pointer_v1_set_cursor_position_hint(self->wayland.locked_pointer, 0, CSD_BORDER_FRAME_TOP);
|
||||||
wl_surface_commit(self->wayland.framebuffer.surface);
|
wl_surface_commit(self->wayland.framebuffer.surface);
|
||||||
}
|
}
|
||||||
|
self->wayland.resizing = 1;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* `xdg_surface.close` callback */
|
/* `xdg_surface.close` callback */
|
||||||
|
|
@ -2220,6 +2223,8 @@ static int MwLLPendingImpl(MwLL handle) {
|
||||||
};
|
};
|
||||||
int pending = 0;
|
int pending = 0;
|
||||||
|
|
||||||
|
handle->wayland.resizing = 0;
|
||||||
|
|
||||||
#ifdef USE_DBUS
|
#ifdef USE_DBUS
|
||||||
if(wl_call_tbl.has_dbus) {
|
if(wl_call_tbl.has_dbus) {
|
||||||
if(handle->wayland.dark_theme_detection) {
|
if(handle->wayland.dark_theme_detection) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue