diff --git a/AGENTS.md b/AGENTS.md index 05965774..62847cf1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -150,7 +150,11 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt `4DWm` app-defaults say; `Alt+Button2` resizes a window like `Alt+Button1` moves it. The palette `IRIX.dp` carries the reference's greys (`sgilightgray` #c0c0c0, `sgibrightgray` #e0e0e0); focus follows the - pointer without auto-raise by default; zones and full screen use Command+Ctrl + pointer without auto-raise by default; a client straight onto a desktop + icon or the bar clears the keyboard focus (the icon windows select + EnterWindowMask and WmMcdeDesktop calls Do_Focus_Key(NULL); dtbar sets the + input focus to PointerRoot on its EnterNotify), so a non-client area never + leaves the last terminal focused (t0255); zones and full screen use Command+Ctrl keys; the outline is XOR or four thin windows, never FlashOutline. An iconified window shows image and label (`Dtwm*iconDecoration: label image`, 85x67 pictures) and the icons fill a tight column at the left edge diff --git a/programs/dtbar/dtbar.c b/programs/dtbar/dtbar.c index 1704c0d7..8fd0e43c 100644 --- a/programs/dtbar/dtbar.c +++ b/programs/dtbar/dtbar.c @@ -1413,6 +1413,21 @@ Events(Widget w, XtPointer data, XEvent *ev, Boolean *cont) /* the program brings its menus up to date before one opens */ if (ev->xcrossing.window == XtWindow(shell)) Send(aRefresh, 0, 0); + /* A client straight onto the bar is no window crossing for + * dtwm, so the terminal kept the focus over the bar (t0255). + * The bar is not a text window: the focus goes to the + * pointer root, and dtwm clears the active client. */ + if (ev->xcrossing.window == XtWindow(shell) && + ev->xcrossing.mode == NotifyNormal) { + Window f = None; + int revert = 0; + + XGetInputFocus(dpy, &f, &revert); + if (f != PointerRoot && f != None && + f != XtWindow(shell)) + XSetInputFocus(dpy, PointerRoot, + RevertToPointerRoot, ev->xcrossing.time); + } break; case VisibilityNotify: if (ev->xvisibility.window == XtWindow(shell) && diff --git a/programs/dtwm/WmMcdeDesktop.c b/programs/dtwm/WmMcdeDesktop.c index 2a3a9728..ec4a6ae8 100644 --- a/programs/dtwm/WmMcdeDesktop.c +++ b/programs/dtwm/WmMcdeDesktop.c @@ -1197,6 +1197,13 @@ McdeDesktopEvent(XEvent *event) if (event->xexpose.count == 0) DeskDraw(i); return True; + case EnterNotify: + /* From a client straight onto an icon there is no root or + * backdrop crossing, so the workspace's enter handler never + * runs: the focus goes to the desktop here (tasksd t0255). */ + Do_Focus_Key((ClientData *) NULL, event->xcrossing.time, + ALWAYS_SET_FOCUS); + return True; case ClientMessage: if (event->xclient.message_type == deskXdndEnter) { deskXdndSource = (Window) event->xclient.data.l[0]; @@ -1724,7 +1731,8 @@ DeskWindow(int i) a.background_pixel = deskBg; a.border_pixel = deskFg; a.event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | - Button1MotionMask | StructureNotifyMask | PropertyChangeMask; + Button1MotionMask | StructureNotifyMask | PropertyChangeMask | + EnterWindowMask; it->win = XCreateWindow(deskDpy, deskRoot, it->x, it->y, DESK_CELL_W, DESK_CELL_H, 0, CopyFromParent, InputOutput, CopyFromParent,