mcde: dtwm places and maximizes windows below dtbar
McdeExcludeBar (WmMultiHead.c) takes the bar's height off the area at the top of the screen while dtbar owns _MCDE_BAR_S<screen>; used for the placement area and for maximizing, not for full screen. Tested on Xvfb: dtcalc placed at frame y=23 (the bar is 23 high), maximized to 1012x648 below the bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e8240130d8
commit
38674be8b2
4 files changed
+44
No files matched your search
@@ -58,6 +58,8 @@ place of CDE; pkgsrc builds it on any platform from `pkgsrc/`.
|
||||
with a shell (a shell stops on "Event with wrong window").
|
||||
`MCDE_NO_GLOBAL_MENU` keeps a program's menu bar in its window,
|
||||
`MCDE_GLOBAL_MENU_DEBUG` logs what the program side does.
|
||||
dtwm places and maximizes windows below the bar (`McdeExcludeBar` in
|
||||
`programs/dtwm/WmMultiHead.c`); a full-screen window covers it.
|
||||
- `programs/dtterm/Profiles.c` -- terminal profiles (font, colours, command)
|
||||
from `~/.dt/dtterm.profiles`, else `config/dtterm.profiles`; the parser is
|
||||
plain C with its own test (`test_profiles.c`, `make check`). A view with a
|
||||
|
||||
@@ -169,3 +169,25 @@ WmHeadInfo_t *GetHeadInfoById(int id) {
|
||||
free(WmHI);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* MCDE: the area below the top bar (WmMultiHead.h) */
|
||||
void
|
||||
McdeExcludeBar(int screen, int *px, int *py, int *pwidth, int *pheight)
|
||||
{
|
||||
char name[32];
|
||||
Window bar;
|
||||
XWindowAttributes a;
|
||||
|
||||
(void) px;
|
||||
(void) pwidth;
|
||||
if (*py != 0)
|
||||
return;
|
||||
snprintf(name, sizeof name, "_MCDE_BAR_S%d", screen);
|
||||
bar = XGetSelectionOwner(DISPLAY, XInternAtom(DISPLAY, name, False));
|
||||
if (bar == None || !XGetWindowAttributes(DISPLAY, bar, &a) ||
|
||||
a.map_state != IsViewable || a.y != 0 || a.height >= *pheight)
|
||||
return;
|
||||
*py += a.height;
|
||||
*pheight -= a.height;
|
||||
}
|
||||
@@ -35,4 +35,12 @@ typedef struct _WmHeadInfo {
|
||||
WmHeadInfo_t *GetHeadInfo(const ClientData *pcd);
|
||||
WmHeadInfo_t *GetHeadInfoById(int id);
|
||||
|
||||
/*
|
||||
* MCDE: the bar at the top of the screen (programs/dtbar) is no window dtwm
|
||||
* manages (override-redirect); while it runs, it owns _MCDE_BAR_S<screen>.
|
||||
* An area at the top of the screen (*PY == 0) loses the bar's height, so
|
||||
* that windows are placed and maximized below it.
|
||||
*/
|
||||
void McdeExcludeBar(int screen, int *px, int *py, int *pwidth, int *pheight);
|
||||
|
||||
#endif /* _WmMultiHead_h */
|
||||
@@ -3499,6 +3499,14 @@ FindClientPlacement (ClientData *pCD)
|
||||
screenWidth = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD));
|
||||
screenHeight = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pCD));
|
||||
}
|
||||
{
|
||||
/* MCDE: below the top bar (WmMultiHead.c) */
|
||||
int bx = screenX, by = screenY, bw = screenWidth, bh = screenHeight;
|
||||
|
||||
McdeExcludeBar(SCREEN_FOR_CLIENT(pCD), &bx, &by, &bw, &bh);
|
||||
screenY = by;
|
||||
screenHeight = bh;
|
||||
}
|
||||
|
||||
while (!placed)
|
||||
{
|
||||
@@ -4031,6 +4039,10 @@ void GetMaxInfo (ClientData *pCD, int *pX, int *pY, int *pWidth, int *pHeight)
|
||||
width = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT (pCD));
|
||||
height = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT (pCD));
|
||||
}
|
||||
/* MCDE: a maximized window stays below the top bar (WmMultiHead.c);
|
||||
* a full-screen one covers it */
|
||||
if (!pCD->maxConfig && !(pCD->fullscreen && !pCD->fullscreenAuto))
|
||||
McdeExcludeBar (SCREEN_FOR_CLIENT (pCD), &x, &y, &width, &height);
|
||||
|
||||
FrameToClient (pCD, &x, &y, &width, &height);
|
||||
|
||||
|
||||
Reference in new issue
Block a user