[hackers] Re: [dwm][PATCH] manage: disable fullscreen on the old window when a new window is opened
Hello,
What do you think about this issue/patch? Can you reproduce it?
Regards!
On Sat, Mar 14, 2026 at 3:53 AM Ruben Gonzalez <neorubenx_AT_gmail.com> wrote:
>
> When a new window is managed (spawned), it becomes the focused client.
> But, If the previously focused window was in fullscreen mode, it
> remains fullscreen and completely covers the new window, leading to
> "invisible focus" where the user types into an invisible terminal.
>
> Steps to reproduce:
> 1. Open a terminal (terminal A) and make the terminal fullscreen.
> 2. Open a new terminal B (Mod+Shift+Enter)
> 3. You can see that visually nothing happens; terminal A is still fullscreen.
> 4. Try tying the command touch /tmp/foo.txt (you will see nothing in terminal A)
> 5. Exit fullscreen on the current terminal A.
> 6. You will see that the command "touch" was received and executed by
> the new terminal B.
>
> This fix ensures that the fullscreen state is removed from the
> previously focused window when a new client is managed on the same
> monitor, keeping the new window visible.
>
> From 38de8cc3233ffaae88f2e6c3071978c728bd5d7b Mon Sep 17 00:00:00 2001
> From: Ruben Gonzalez <gonzaru_AT_sdf.org>
> Date: Sat, 14 Mar 2026 03:12:04 +0200
> Subject: [PATCH] manage: disable fullscreen on the old window when a new
> window is opened
>
> ---
> dwm.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/dwm.c b/dwm.c
> index ab3a84c..54812dc 100644
> --- a/dwm.c
> +++ b/dwm.c
> _AT_@ -1080,8 +1080,11 @@ manage(Window w, XWindowAttributes *wa)
> (unsigned char *) &(c->win), 1);
> XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h);
> /* some windows require this */
> setclientstate(c, NormalState);
> - if (c->mon == selmon)
> + if (c->mon == selmon) {
> + if (selmon->sel && selmon->sel->isfullscreen)
> + setfullscreen(selmon->sel, 0);
> unfocus(selmon->sel, 0);
> + }
> c->mon->sel = c;
> arrange(c->mon);
> XMapWindow(dpy, c->win);
> --
> 2.43.0
Received on Fri Mar 27 2026 - 13:02:24 CET
This archive was generated by hypermail 2.3.0
: Fri Mar 27 2026 - 13:36:38 CET