]> Skullheadx's Git Forge - dwm.git/commitdiff
sendmon: resize fullscreen windows to target monitor
authorRuben Gonzalez <gonzaru@sdf.org>
Sun, 8 Mar 2026 09:24:40 +0000 (11:24 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Tue, 10 Mar 2026 18:52:48 +0000 (19:52 +0100)
When a fullscreen window is moved to another monitor (e.g. via
tagmon), its geometry does not always match the new monitor's
dimensions.

Steps to reproduce:
1. Start dwm with two monitors (A and B).
2. Open a window on Monitor A.
3. Make the window fullscreen (e.g. Firefox with F11).
4. Move the window to Monitor B using the tagmon shortcut (Mod+Shift+>).
5. Go to the other monitor (B), observe that the window is still
visible on Monitor A and its contents, even though the window's title
is seen on Monitor B bar.
6. Go to the monitor A where the window is still in fullscreen, remove
the fullscreen and the window automatically will go to monitor B.

This fix ensures that fullscreen windows are correctly resized to the
new monitor's geometry during the move.

dwm.c

diff --git a/dwm.c b/dwm.c
index 0a6710382a9b2f5d3409d390400f65ab2ee528f3..6fe226f3dff5800cea8689e5b326d3f03345aa2f 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -1429,6 +1429,8 @@ sendmon(Client *c, Monitor *m)
        c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
        attach(c);
        attachstack(c);
+       if (c->isfullscreen)
+               resizeclient(c, m->mx, m->my, m->mw, m->mh);
        focus(NULL);
        arrange(NULL);
 }