summaryrefslogtreecommitdiff
path: root/src/sxwm.c
diff options
context:
space:
mode:
authorAbhinav <abhinav.prsai@gmail.com>2025-06-04 19:18:52 +0100
committerAbhinav <abhinav.prsai@gmail.com>2025-06-04 19:18:52 +0100
commit485e2b676a0a2380274de2d1b5ad6c6cdc16ce7e (patch)
tree4fcb58b9703619e747c93b703387f79605362a45 /src/sxwm.c
parent7abf3c09260c6ed226045c8586231ecdf51f8368 (diff)
set input focus AFTER mapping to avoid input mixing bug
Diffstat (limited to 'src/sxwm.c')
-rw-r--r--src/sxwm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index 579a393..ac9e62e 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -782,6 +782,12 @@ void hdl_map_req(XEvent *xev)
XRaiseWindow(dpy, w);
}
+ XMapWindow(dpy, w);
+ for (Client *c = workspaces[current_ws]; c; c = c->next) {
+ if (c->win == w) {
+ c->mapped = True;
+ }
+ }
if (user_config.new_win_focus) {
focused = c;
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
@@ -790,13 +796,6 @@ void hdl_map_req(XEvent *xev)
warp_cursor(c);
}
}
-
- XMapWindow(dpy, w);
- for (Client *c = workspaces[current_ws]; c; c = c->next) {
- if (c->win == w) {
- c->mapped = True;
- }
- }
update_borders();
}