mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-04-08 08:21:00 -04:00
an attempt at atomic arrange
Currently freezes rendering with clients that ignore our size demands, but it seems to eliminate resize flicker for well-behaved programs.
This commit is contained in:
parent
e2887f2cfd
commit
5b917ec3ed
1 changed files with 17 additions and 0 deletions
17
dwl.c
17
dwl.c
|
|
@ -1214,6 +1214,8 @@ void
|
||||||
rendermon(struct wl_listener *listener, void *data)
|
rendermon(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_output *output = data;
|
struct wlr_output *output = data;
|
||||||
|
Client *c;
|
||||||
|
int defer = 0;
|
||||||
|
|
||||||
/* This function is called every time an output is ready to display a frame,
|
/* This function is called every time an output is ready to display a frame,
|
||||||
* generally at the output's refresh rate (e.g. 60Hz). */
|
* generally at the output's refresh rate (e.g. 60Hz). */
|
||||||
|
|
@ -1222,6 +1224,21 @@ rendermon(struct wl_listener *listener, void *data)
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
|
|
||||||
|
wl_list_for_each(c, &stack, slink) {
|
||||||
|
if (c->xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL)
|
||||||
|
continue;
|
||||||
|
if (c->xdg_surface->toplevel->server_pending.width !=
|
||||||
|
c->xdg_surface->surface->current.width ||
|
||||||
|
c->xdg_surface->toplevel->server_pending.height !=
|
||||||
|
c->xdg_surface->surface->current.height) {
|
||||||
|
defer = 1;
|
||||||
|
/* Lie */
|
||||||
|
wlr_surface_send_frame_done(c->xdg_surface->surface, &now);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (defer)
|
||||||
|
return;
|
||||||
|
|
||||||
/* wlr_output_attach_render makes the OpenGL context current. */
|
/* wlr_output_attach_render makes the OpenGL context current. */
|
||||||
if (!wlr_output_attach_render(m->wlr_output, NULL))
|
if (!wlr_output_attach_render(m->wlr_output, NULL))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue