1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00

dtwm: Respond to the following EWMH:

_NET_WM_FULLSCREEN_MONITORS
      _NET_WM_STATE_FULLSCREEN
This commit is contained in:
Liang Chang 2021-08-07 16:19:25 +08:00
parent 78c8241738
commit 3886c7d09c
3 changed files with 62 additions and 2 deletions

View file

@ -44,8 +44,10 @@
*/ */
#include "WmCEvent.h" #include "WmCEvent.h"
#include "WmCDecor.h" #include "WmCDecor.h"
#include "WmCDInfo.h"
#include "WmColormap.h" #include "WmColormap.h"
#include "WmEvent.h" #include "WmEvent.h"
#include "WmEwmh.h"
#include "WmFeedback.h" #include "WmFeedback.h"
#include "WmFunction.h" #include "WmFunction.h"
#include "WmIDecor.h" #include "WmIDecor.h"
@ -508,6 +510,7 @@ Boolean HandleEventsOnSpecialWindows (XEvent *pEvent)
{ {
Boolean dispatchEvent = True; Boolean dispatchEvent = True;
WmScreenData *pSD; WmScreenData *pSD;
ClientData *pCD;
/* /*
@ -604,6 +607,15 @@ Boolean HandleEventsOnSpecialWindows (XEvent *pEvent)
} }
break; break;
} }
case ClientMessage:
{
if (pCD = InitClientData (pEvent->xclient.window)) {
ProcessEwmh (pCD, (XClientMessageEvent *) pEvent);
dispatchEvent = False;
}
break;
}
} }
} }
@ -828,6 +840,22 @@ void HandleCPropertyNotify (ClientData *pCD, XPropertyEvent *propertyEvent)
ProcessColormapList (ACTIVE_PSD, pCD); ProcessColormapList (ACTIVE_PSD, pCD);
} }
} }
else if (propertyEvent->atom == wmGD.xa_MWM_HINTS) {
long suppliedReturn;
XSizeHints hintsReturn = {0};
XGetWMNormalHints (DISPLAY, pCD->client, &hintsReturn,
&suppliedReturn);
hintsReturn.flags |= P_MAX_SIZE;
hintsReturn.max_width = -1;
hintsReturn.max_height = -1;
XSetWMNormalHints (DISPLAY, pCD->client, &hintsReturn);
ProcessMwmHints (pCD);
SetClientOffset (pCD);
}
break; break;
} }
} }
@ -2547,7 +2575,20 @@ void HandleClientMessage (ClientData *pCD, XClientMessageEvent *clientEvent)
} }
else if (clientEvent->data.l[0] == NormalState) else if (clientEvent->data.l[0] == NormalState)
{ {
newState = NORMAL_STATE; if (pCD->isFullscreen)
{
SetClientState (pCD, NORMAL_STATE, GetTimestamp ());
newState = MAXIMIZED_STATE;
}
else
{
if (pCD->decorUpdated)
{
SetClientState (pCD, MAXIMIZED_STATE, GetTimestamp ());
}
newState = NORMAL_STATE;
}
} }
if (!ClientInWorkspace (ACTIVE_WS, pCD)) if (!ClientInWorkspace (ACTIVE_WS, pCD))
{ {
@ -2557,7 +2598,10 @@ void HandleClientMessage (ClientData *pCD, XClientMessageEvent *clientEvent)
SetClientState (pCD, newState, GetTimestamp ()); SetClientState (pCD, newState, GetTimestamp ());
} }
else
{
ProcessEwmh (pCD, clientEvent);
}
} /* END OF FUNCTION HandleClientMessage */ } /* END OF FUNCTION HandleClientMessage */

View file

@ -1628,6 +1628,13 @@ typedef struct _ClientData
Window clientBaseWin; /* for matte & reparenting */ Window clientBaseWin; /* for matte & reparenting */
int xBorderWidth; /* original X border width */ int xBorderWidth; /* original X border width */
FrameInfo frameInfo; /* frame geometry data */ FrameInfo frameInfo; /* frame geometry data */
Boolean decorUpdated; /* True => decoration updated */
Boolean isFullscreen; /* True => fullscreen */
Boolean monitorSizeIsSet; /* True => X, Y, W, H is set */
int monitorX; /* monitor X loc */
int monitorY; /* monitor Y loc */
int monitorWidth; /* monitor width */
int monitorHeight; /* monitor height */
/* client window frame graphic data: */ /* client window frame graphic data: */
@ -1826,6 +1833,7 @@ typedef struct _WmGlobalData
Widget topLevelW1; /* from which WM components hang */ Widget topLevelW1; /* from which WM components hang */
Boolean confirmDialogMapped; /* confirm dialog is mapped */ Boolean confirmDialogMapped; /* confirm dialog is mapped */
XtAppContext mwmAppContext; /* application context for mwm */ XtAppContext mwmAppContext; /* application context for mwm */
XContext tmpWindowContextType; /* temporary window context */
XContext windowContextType; /* window context for XSaveContext */ XContext windowContextType; /* window context for XSaveContext */
XContext screenContextType; /* screen context for XSaveContext */ XContext screenContextType; /* screen context for XSaveContext */
#ifndef IBM_169380 #ifndef IBM_169380
@ -1927,6 +1935,9 @@ typedef struct _WmGlobalData
Atom xa_SM_CLIENT_ID; Atom xa_SM_CLIENT_ID;
Atom xa_WMSAVE_HINT; Atom xa_WMSAVE_HINT;
Atom xa_NET_WM_FULLSCREEN_MONITORS;
Atom xa_NET_WM_STATE;
Atom xa_NET_WM_STATE_FULLSCREEN;
/* atoms used for workspace management: */ /* atoms used for workspace management: */

View file

@ -87,6 +87,7 @@ typedef struct
#include "WmColormap.h" #include "WmColormap.h"
#include "WmError.h" #include "WmError.h"
#include "WmEvent.h" #include "WmEvent.h"
#include "WmEwmh.h"
#include "WmFeedback.h" #include "WmFeedback.h"
#include "WmFunction.h" #include "WmFunction.h"
#include "WmIDecor.h" #include "WmIDecor.h"
@ -410,6 +411,7 @@ void InitWmGlobal (int argc, char *argv [], char *environ [])
* Do (pre-toolkit) initialization: * Do (pre-toolkit) initialization:
*/ */
wmGD.tmpWindowContextType = XUniqueContext ();
wmGD.windowContextType = XUniqueContext (); wmGD.windowContextType = XUniqueContext ();
wmGD.screenContextType = XUniqueContext (); wmGD.screenContextType = XUniqueContext ();
#ifndef IBM_169380 #ifndef IBM_169380
@ -1001,6 +1003,9 @@ void InitWmGlobal (int argc, char *argv [], char *environ [])
/* setup window manager inter-client communications conventions handling */ /* setup window manager inter-client communications conventions handling */
SetupWmICCC (); SetupWmICCC ();
/* setup EWMH handling */
SetupWmEwmh ();
/* /*
* Use the WM_SAVE_YOURSELF protocol * Use the WM_SAVE_YOURSELF protocol
* for notification of when to save ourself * for notification of when to save ourself