fix(popup): raise the popup whenever it is shown

The popup window is created once at startup and only mapped afterwards,
and MapWindow does not restack, so every application window (or WM
frame) opened after the daemon sat above it: candidates and preedit were
invisible in those windows until the daemon restarted. Configure the
window above its siblings on every show. The XIM live test now checks
the popup stacks above a client window created after the daemon.
This commit is contained in:
2026-08-16 20:23:29 +09:00
parent 333300b297
commit f6adb117c9
2 changed files with 41 additions and 3 deletions

8
win.c
View File

@@ -316,7 +316,7 @@ winshow(Drawcmd *dc)
Area area;
Popup p;
int ax, ay, px, py, x, y;
u32int vals[4];
u32int vals[5];
xcb_query_pointer_reply_t *ptr;
xcb_query_pointer_cookie_t cookie;
@@ -339,14 +339,16 @@ winshow(Drawcmd *dc)
if(p.w <= 0 || p.h <= 0 || !resizebacking(p.w, p.h))
return 0;
popupposition(&dc->caret, px, py, &area, p.w, p.h, &x, &y);
/* Mapping does not restack: raise above windows opened since. */
vals[0] = x;
vals[1] = y;
vals[2] = p.w;
vals[3] = p.h;
vals[4] = XCB_STACK_MODE_ABOVE;
xcb_configure_window(conn, win,
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
vals);
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT |
XCB_CONFIG_WINDOW_STACK_MODE, vals);
popupdraw(img, dc, &p);
putimage(p.w, p.h);
xcb_map_window(conn, win);