From f2f32c9572ac22f546fdd08e64570ee4c1ceb611 Mon Sep 17 00:00:00 2001 From: uint Date: Sat, 13 Dec 2025 17:52:34 +0000 Subject: fix monocle layout: see descrition - fixed new windows not rising - fixed windows not rising on focus in general --- src/sxwm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/sxwm.c') diff --git a/src/sxwm.c b/src/sxwm.c index 6894363..14ddf0b 100644 --- a/src/sxwm.c +++ b/src/sxwm.c @@ -1358,7 +1358,7 @@ void hdl_map_req(XEvent *xev) if (user_config.new_win_focus) { focused = c; - set_input_focus(focused, False, True); + set_input_focus(focused, True, True); return; } update_borders(); @@ -2340,8 +2340,8 @@ void set_input_focus(Client *c, Bool raise_win, Bool warp) send_wm_take_focus(w); if (raise_win) { - /* if floating_on_top, don't raise a tiled window above floats. */ - if (c->floating || !user_config.floating_on_top) + /* always raise in monocle, otherwise respect floating_on_top */ + if (monocle || c->floating || !user_config.floating_on_top) XRaiseWindow(dpy, w); } /* EWMH focus hint */ @@ -2644,7 +2644,7 @@ void tile(void) if (monocle) { for (Client *c = head; c; c = c->next) { - if (!c->mapped || c->fullscreen) + if (!c->mapped || c->floating || c->fullscreen) continue; int border_width = user_config.border_width; @@ -2665,7 +2665,6 @@ void tile(void) }; XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); - XRaiseWindow(dpy, c->win); c->x = wc.x; c->y = wc.y; @@ -2673,6 +2672,9 @@ void tile(void) c->h = wc.height; } + if (focused && focused->mapped && !focused->floating && !focused->fullscreen) + XRaiseWindow(dpy, focused->win); + update_borders(); return; } -- cgit v1.2.3