MCDE dtbar: Show All brings every hidden program back (t0202)
This commit is contained in:
1 parent
d72634fd62
commit
ef74fb61ca
2 files changed
+46
-5
No files matched your search
@@ -189,6 +189,16 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt
|
||||
it has the focus. A Firefox window's own Cmd+T/W/L was **not** measured
|
||||
(the user.js sets the accelerator; that measurement needs a person at the
|
||||
keyboard); the `dtexplorer` of the task is its own program, still to come.
|
||||
- **The program menu's Hide / Show All** (dtbar, `AppHide`/`AppShowAll`):
|
||||
Hide and Hide Others send WM_CHANGE_STATE `IconicState` to the clients;
|
||||
Show All sends `NormalState` to the client of every frame of the screen
|
||||
(`XQueryTree` + `XmuClientWindow`, because an iconified window is unmapped
|
||||
and `ClientWindows()` skips it). Measured 2026-11-14: with two dtpads
|
||||
minimized (both `IsUnMapped`) `dtbar -command showall` makes both
|
||||
`IsViewable`; dtwm's WM_CHANGE_STATE handler does accept `NormalState` (an
|
||||
earlier note that it ignores it was wrong -- the test then had sent the
|
||||
message to the wrong window). `dtbar -command showall` is the key-side
|
||||
entry, the menu item calls the same function.
|
||||
- **dtcmprefs** (`programs/dtcmprefs`): the calendar's settings window on
|
||||
the shared McdePrefs pattern -- General (first day of the week, week
|
||||
numbers, default appointment length), Accounts (a read-only note: the
|
||||
|
||||
+36
-5
@@ -917,6 +917,39 @@ AppHide(Widget w, XtPointer data, XtPointer call)
|
||||
XFlush(dpy);
|
||||
}
|
||||
|
||||
/* every hidden program comes back: WM_CHANGE_STATE NormalState, the
|
||||
* ICCCM's way, to the client of each frame -- iconified windows are
|
||||
* unmapped, so they are not in ClientWindows() (measured: dtwm restores the
|
||||
* window on this message) */
|
||||
static void
|
||||
AppShowAll(Widget w, XtPointer data, XtPointer call)
|
||||
{
|
||||
Window root, parent, *kids = NULL;
|
||||
unsigned int n = 0, i;
|
||||
|
||||
(void) w;
|
||||
(void) data;
|
||||
(void) call;
|
||||
if (!XQueryTree(dpy, DefaultRootWindow(dpy), &root, &parent, &kids,
|
||||
&n))
|
||||
return;
|
||||
for (i = 0; i < n; i++) {
|
||||
XWindowAttributes a;
|
||||
Window c;
|
||||
|
||||
if (!XGetWindowAttributes(dpy, kids[i], &a) ||
|
||||
a.override_redirect)
|
||||
continue;
|
||||
c = XmuClientWindow(dpy, kids[i]);
|
||||
if (c == None || c == XtWindow(barShell))
|
||||
continue;
|
||||
ChangeState(c, NormalState);
|
||||
}
|
||||
if (kids != NULL)
|
||||
XFree(kids);
|
||||
XFlush(dpy);
|
||||
}
|
||||
|
||||
static void
|
||||
AppQuit(Widget w, XtPointer data, XtPointer call)
|
||||
{
|
||||
@@ -972,11 +1005,7 @@ MakeAppMenu(void)
|
||||
SetAccel(item, "Cmd+H");
|
||||
item = Push(menu, "Hide Others", 'O', AppHide, (XtPointer) 1);
|
||||
SetAccel(item, "Option+Cmd+H");
|
||||
/* dtwm restores a window from its icon itself (a double click on
|
||||
* the icon); a client message does not make it (measured
|
||||
* 2026-11-14: WM_CHANGE_STATE NormalState is ignored), so the item
|
||||
* of the reference is here, insensitive, until dtwm has it */
|
||||
Push(menu, "Show All", 'S', NULL, NULL);
|
||||
Push(menu, "Show All", 'S', AppShowAll, NULL);
|
||||
Separator(menu);
|
||||
(void)snprintf(label, sizeof label, "Quit %s", appName);
|
||||
item = Push(menu, label, 'Q', AppQuit, NULL);
|
||||
@@ -1301,6 +1330,8 @@ Command(const char *name)
|
||||
LogOutNow();
|
||||
else if (strcmp(name, "power") == 0)
|
||||
AskShutDown();
|
||||
else if (strcmp(name, "showall") == 0)
|
||||
AppShowAll(NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in new issue
Block a user