mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
dtwm: Trigger fullscreen in an "edge trigger" manner to avoid wrong
behaviors caused by some unusual operations. E.g., after entered fullscreen, applications change windows to other states instead of leaving fullscreen.
This commit is contained in:
parent
3e81d4c4de
commit
8fa32b3db5
6 changed files with 19 additions and 12 deletions
|
@ -2575,9 +2575,11 @@ void HandleClientMessage (ClientData *pCD, XClientMessageEvent *clientEvent)
|
|||
}
|
||||
else if (clientEvent->data.l[0] == NormalState)
|
||||
{
|
||||
if (pCD->isFullscreen)
|
||||
if (pCD->enterFullscreen)
|
||||
{
|
||||
Boolean enterFullscreen = pCD->enterFullscreen;
|
||||
SetClientState (pCD, NORMAL_STATE, GetTimestamp ());
|
||||
pCD->enterFullscreen = enterFullscreen;
|
||||
newState = MAXIMIZED_STATE;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -149,16 +149,10 @@ static void ProcessNetWmStateFullscreen (ClientData *pCD, Boolean en)
|
|||
|
||||
if (pHints != &hints) XFree (pHints);
|
||||
|
||||
pCD->isFullscreen = en;
|
||||
pCD->enterFullscreen = en;
|
||||
|
||||
XSendEvent (DISPLAY, ROOT_FOR_CLIENT (pCD), False, SubstructureRedirectMask,
|
||||
(XEvent *) &clientMsgEvent);
|
||||
|
||||
if (en) XChangeProperty (DISPLAY, pCD->client, wmGD.xa_NET_WM_STATE,
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(unsigned char *) &wmGD.xa_NET_WM_STATE_FULLSCREEN,
|
||||
1);
|
||||
else XDeleteProperty (DISPLAY, pCD->client, wmGD.xa_NET_WM_STATE);
|
||||
} /* END OF FUNCTION ProcessNetWmStateFullscreen */
|
||||
|
||||
|
||||
|
|
|
@ -1629,7 +1629,7 @@ typedef struct _ClientData
|
|||
int xBorderWidth; /* original X border width */
|
||||
FrameInfo frameInfo; /* frame geometry data */
|
||||
Boolean decorUpdated; /* True => decoration updated */
|
||||
Boolean isFullscreen; /* True => fullscreen */
|
||||
Boolean enterFullscreen; /* True => enter fullscreen */
|
||||
Boolean monitorSizeIsSet; /* True => X, Y, W, H is set */
|
||||
int monitorX; /* monitor X loc */
|
||||
int monitorY; /* monitor Y loc */
|
||||
|
|
|
@ -1008,6 +1008,7 @@ void WithdrawWindow (ClientData *pCD)
|
|||
}
|
||||
}
|
||||
|
||||
XDeleteProperty (DISPLAY, pCD->client, wmGD.xa_NET_WM_STATE);
|
||||
XUnmapWindow (DISPLAY, pCD->client);
|
||||
XReparentWindow (DISPLAY, pCD->client, ROOT_FOR_CLIENT(pCD), x, y);
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ InitClientData (Window clientWindow)
|
|||
pCD->smClientID = (String)NULL;
|
||||
|
||||
pCD->decorUpdated = False;
|
||||
pCD->isFullscreen = False;
|
||||
pCD->enterFullscreen = False;
|
||||
pCD->monitorSizeIsSet = False;
|
||||
|
||||
return (pCD);
|
||||
|
|
|
@ -181,7 +181,6 @@ 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;
|
||||
}
|
||||
|
@ -614,10 +613,12 @@ void ConfigureNewState (ClientData *pcd)
|
|||
XResizeWindow (DISPLAY, pcd->client,
|
||||
(unsigned int) pcd->clientWidth,
|
||||
(unsigned int) pcd->clientHeight);
|
||||
|
||||
XDeleteProperty (DISPLAY, pcd->client, wmGD.xa_NET_WM_STATE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pcd->isFullscreen && pcd->monitorSizeIsSet)
|
||||
if (pcd->enterFullscreen && pcd->monitorSizeIsSet)
|
||||
{
|
||||
pcd->maxX = pcd->monitorX;
|
||||
pcd->maxY = pcd->monitorY;
|
||||
|
@ -646,7 +647,16 @@ void ConfigureNewState (ClientData *pcd)
|
|||
(unsigned int) pcd->maxHeight);
|
||||
pcd->maxConfig = TRUE;
|
||||
RegenerateClientFrame(pcd);
|
||||
|
||||
if (pcd->enterFullscreen)
|
||||
XChangeProperty (DISPLAY, pcd->client, wmGD.xa_NET_WM_STATE,
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(unsigned char *) &wmGD.xa_NET_WM_STATE_FULLSCREEN,
|
||||
1);
|
||||
}
|
||||
|
||||
pcd->enterFullscreen = False;
|
||||
|
||||
SendConfigureNotify (pcd);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue