From a39a46c908011de913b142dbd1dd427eb7fbca0a Mon Sep 17 00:00:00 2001 From: Ben Jargowsky Date: Thu, 15 Dec 2022 17:34:03 -0500 Subject: Check width and height are not negative in client_set_bounds() --- client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client.h') diff --git a/client.h b/client.h index dbf018f..06c2073 100644 --- a/client.h +++ b/client.h @@ -141,7 +141,7 @@ client_set_bounds(Client *c, int32_t width, int32_t height) return 0; #endif if (c->surface.xdg->client->shell->version >= - XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION) + XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0) return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height); return 0; } -- cgit v1.2.1 From 7eaa01ac1f074511ae1013326172d51c6fdf8866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Tue, 6 Dec 2022 14:47:55 -0600 Subject: Revert "Revert "fix flickering when resizing/spawning windows"" This reverts commit 4a32293548667e68cd9a103e22368b8db1754deb. --- client.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'client.h') diff --git a/client.h b/client.h index 06c2073..064e093 100644 --- a/client.h +++ b/client.h @@ -240,6 +240,21 @@ client_is_mapped(Client *c) return c->surface.xdg->mapped; } +static inline int +client_is_rendered_on_mon(Client *c, Monitor *m) +{ + /* This is needed for when you don't want to check formal assignment, + * but rather actual displaying of the pixels. + * Usually VISIBLEON suffices and is also faster. */ + struct wlr_surface_output *s; + if (!c->scene->node.enabled) + return 0; + wl_list_for_each(s, &client_surface(c)->current_outputs, link) + if (s->output == m->wlr_output) + return 1; + return 0; +} + static inline int client_is_unmanaged(Client *c) { -- cgit v1.2.1 From 6ca011430a18980f12f7314cdeeff36051268a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Wed, 21 Dec 2022 14:28:27 -0600 Subject: do not skip frames if a client is stopped and have a pending resize --- client.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'client.h') diff --git a/client.h b/client.h index 064e093..295e8ff 100644 --- a/client.h +++ b/client.h @@ -255,6 +255,32 @@ client_is_rendered_on_mon(Client *c, Monitor *m) return 0; } +static inline int +client_is_stopped(Client *c) +{ + int pid; + siginfo_t in = {0}; +#ifdef XWAYLAND + if (client_is_x11(c)) + return 0; +#endif + + wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL); + if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) { + /* This process is not our child process, while is very unluckely that + * it is stopped, in order to do not skip frames assume that it is. */ + if (errno == ECHILD) + return 1; + } else if (in.si_pid) { + if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED) + return 1; + if (in.si_code == CLD_CONTINUED) + return 0; + } + + return 0; +} + static inline int client_is_unmanaged(Client *c) { -- cgit v1.2.1 From be854cab35bc090ab3f6fbad3a0f93013294226d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Wed, 14 Dec 2022 23:21:58 -0600 Subject: do not try to resize if size wouldn't change --- client.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'client.h') diff --git a/client.h b/client.h index 295e8ff..5a45edc 100644 --- a/client.h +++ b/client.h @@ -345,6 +345,9 @@ client_set_size(Client *c, uint32_t width, uint32_t height) return 0; } #endif + if (width == c->surface.xdg->toplevel->current.width + && height ==c->surface.xdg->toplevel->current.height) + return 0; return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, width, height); } -- cgit v1.2.1