From 78c82417385b6c5f46906d83ca678f3f7fe5c189 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 7 Aug 2021 15:09:28 +0800 Subject: [PATCH] dtwm: Support multi-monitor fullscreen. --- cde/programs/dtwm/WmWinState.c | 35 +++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/cde/programs/dtwm/WmWinState.c b/cde/programs/dtwm/WmWinState.c index 5c02c0d36..22ab205c0 100644 --- a/cde/programs/dtwm/WmWinState.c +++ b/cde/programs/dtwm/WmWinState.c @@ -181,6 +181,7 @@ void SetClientStateWithEventMask (ClientData *pCD, int newState, Time setTime, u * WM_STATE property is set in WithdrawWindow. */ + XDeleteProperty (DISPLAY, pCD->client, wmGD.xa_NET_WM_STATE); UnManageWindow (pCD); break; } @@ -616,17 +617,29 @@ void ConfigureNewState (ClientData *pcd) } else { - /* - * Update client config to reflect underlying head, if MultiHead is active - */ - if (WmHI = GetHeadInfo(pcd)) { - FrameToClient(pcd, &WmHI->x_org, &WmHI->y_org, - &WmHI->width, &WmHI->height); - pcd->maxX = WmHI->x_org; - pcd->maxY = WmHI->y_org; - pcd->maxWidth = WmHI->width; - pcd->maxHeight = WmHI->height; - } + if (pcd->isFullscreen && pcd->monitorSizeIsSet) + { + pcd->maxX = pcd->monitorX; + pcd->maxY = pcd->monitorY; + pcd->maxWidth = pcd->monitorWidth; + pcd->maxHeight = pcd->monitorHeight; + + FrameToClient(pcd, &pcd->maxX, &pcd->maxY, &pcd->maxWidth, + &pcd->maxHeight); + } + else if (WmHI = GetHeadInfo(pcd)) { + /* + * Update client config to reflect underlying head, if MultiHead is + * active + */ + FrameToClient(pcd, &WmHI->x_org, &WmHI->y_org, + &WmHI->width, &WmHI->height); + pcd->maxX = WmHI->x_org; + pcd->maxY = WmHI->y_org; + pcd->maxWidth = WmHI->width; + pcd->maxHeight = WmHI->height; + free(WmHI); + } XResizeWindow (DISPLAY, pcd->client, (unsigned int) pcd->maxWidth,