hw/xwin: Remove allowOtherWM, which is now always FALSE
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
parent
8407d30962
commit
b6bdf36842
|
@ -118,7 +118,6 @@ typedef struct _WMInfo {
|
||||||
Atom atmWmDelete;
|
Atom atmWmDelete;
|
||||||
Atom atmWmTakeFocus;
|
Atom atmWmTakeFocus;
|
||||||
Atom atmPrivMap;
|
Atom atmPrivMap;
|
||||||
Bool fAllowOtherWM;
|
|
||||||
} WMInfoRec, *WMInfoPtr;
|
} WMInfoRec, *WMInfoPtr;
|
||||||
|
|
||||||
typedef struct _WMProcArgRec {
|
typedef struct _WMProcArgRec {
|
||||||
|
@ -184,9 +183,7 @@ static void
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen);
|
||||||
CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
|
|
||||||
Bool fAllowOtherWM);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle);
|
winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle);
|
||||||
|
@ -206,7 +203,6 @@ static XIOErrorHandler g_winMultiWindowXMsgProcOldIOErrorHandler;
|
||||||
static pthread_t g_winMultiWindowXMsgProcThread;
|
static pthread_t g_winMultiWindowXMsgProcThread;
|
||||||
static Bool g_shutdown = FALSE;
|
static Bool g_shutdown = FALSE;
|
||||||
static Bool redirectError = FALSE;
|
static Bool redirectError = FALSE;
|
||||||
static Bool g_fAnotherWMRunning = FALSE;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Translate msg id to text, for debug purposes
|
* Translate msg id to text, for debug purposes
|
||||||
|
@ -739,11 +735,6 @@ winMultiWindowWMProc(void *pArg)
|
||||||
for (;;) {
|
for (;;) {
|
||||||
WMMsgNodePtr pNode;
|
WMMsgNodePtr pNode;
|
||||||
|
|
||||||
if (g_fAnotherWMRunning) { /* Another Window manager exists. */
|
|
||||||
Sleep(1000);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Pop a message off of our queue */
|
/* Pop a message off of our queue */
|
||||||
pNode = PopMessage(&pWMInfo->wmMsgQueue, pWMInfo);
|
pNode = PopMessage(&pWMInfo->wmMsgQueue, pWMInfo);
|
||||||
if (pNode == NULL) {
|
if (pNode == NULL) {
|
||||||
|
@ -1047,11 +1038,7 @@ winMultiWindowXMsgProc(void *pArg)
|
||||||
"successfully opened the display.\n");
|
"successfully opened the display.\n");
|
||||||
|
|
||||||
/* Check if another window manager is already running */
|
/* Check if another window manager is already running */
|
||||||
g_fAnotherWMRunning =
|
if (CheckAnotherWindowManager(pProcArg->pDisplay, pProcArg->dwScreen)) {
|
||||||
CheckAnotherWindowManager(pProcArg->pDisplay, pProcArg->dwScreen,
|
|
||||||
pProcArg->pWMInfo->fAllowOtherWM);
|
|
||||||
|
|
||||||
if (g_fAnotherWMRunning && !pProcArg->pWMInfo->fAllowOtherWM) {
|
|
||||||
ErrorF("winMultiWindowXMsgProc - "
|
ErrorF("winMultiWindowXMsgProc - "
|
||||||
"another window manager is running. Exiting.\n");
|
"another window manager is running. Exiting.\n");
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
|
@ -1093,24 +1080,6 @@ winMultiWindowXMsgProc(void *pArg)
|
||||||
if (g_shutdown)
|
if (g_shutdown)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (pProcArg->pWMInfo->fAllowOtherWM && !XPending(pProcArg->pDisplay)) {
|
|
||||||
if (CheckAnotherWindowManager
|
|
||||||
(pProcArg->pDisplay, pProcArg->dwScreen, TRUE)) {
|
|
||||||
if (!g_fAnotherWMRunning) {
|
|
||||||
g_fAnotherWMRunning = TRUE;
|
|
||||||
SendMessage(pProcArg->hwndScreen, WM_UNMANAGE, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (g_fAnotherWMRunning) {
|
|
||||||
g_fAnotherWMRunning = FALSE;
|
|
||||||
SendMessage(pProcArg->hwndScreen, WM_MANAGE, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Sleep(500);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fetch next event */
|
/* Fetch next event */
|
||||||
XNextEvent(pProcArg->pDisplay, &event);
|
XNextEvent(pProcArg->pDisplay, &event);
|
||||||
|
|
||||||
|
@ -1272,7 +1241,7 @@ winInitWM(void **ppWMInfo,
|
||||||
pthread_t * ptWMProc,
|
pthread_t * ptWMProc,
|
||||||
pthread_t * ptXMsgProc,
|
pthread_t * ptXMsgProc,
|
||||||
pthread_mutex_t * ppmServerStarted,
|
pthread_mutex_t * ppmServerStarted,
|
||||||
int dwScreen, HWND hwndScreen, BOOL allowOtherWM)
|
int dwScreen, HWND hwndScreen)
|
||||||
{
|
{
|
||||||
WMProcArgPtr pArg = malloc(sizeof(WMProcArgRec));
|
WMProcArgPtr pArg = malloc(sizeof(WMProcArgRec));
|
||||||
WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec));
|
WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec));
|
||||||
|
@ -1294,7 +1263,6 @@ winInitWM(void **ppWMInfo,
|
||||||
|
|
||||||
/* Set a return pointer to the Window Manager info structure */
|
/* Set a return pointer to the Window Manager info structure */
|
||||||
*ppWMInfo = pWMInfo;
|
*ppWMInfo = pWMInfo;
|
||||||
pWMInfo->fAllowOtherWM = allowOtherWM;
|
|
||||||
|
|
||||||
/* Setup the argument structure for the thread function */
|
/* Setup the argument structure for the thread function */
|
||||||
pArg->dwScreen = dwScreen;
|
pArg->dwScreen = dwScreen;
|
||||||
|
@ -1575,8 +1543,7 @@ winRedirectErrorHandler(Display * pDisplay, XErrorEvent * pErr)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
|
CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen)
|
||||||
Bool fAllowOtherWM)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Try to select the events which only one client at a time is allowed to select.
|
Try to select the events which only one client at a time is allowed to select.
|
||||||
|
@ -1593,12 +1560,11 @@ CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
|
||||||
/*
|
/*
|
||||||
Side effect: select the events we are actually interested in...
|
Side effect: select the events we are actually interested in...
|
||||||
|
|
||||||
If other WMs are not allowed, also select one of the events which only one client
|
Other WMs are not allowed, also select one of the events which only one client
|
||||||
at a time is allowed to select, so other window managers won't start...
|
at a time is allowed to select, so other window managers won't start...
|
||||||
*/
|
*/
|
||||||
XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen),
|
XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen),
|
||||||
SubstructureNotifyMask | (!fAllowOtherWM ? ButtonPressMask :
|
SubstructureNotifyMask | ButtonPressMask);
|
||||||
0));
|
|
||||||
XSync(pDisplay, 0);
|
XSync(pDisplay, 0);
|
||||||
return redirectError;
|
return redirectError;
|
||||||
}
|
}
|
||||||
|
|
|
@ -544,8 +544,8 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
|
||||||
&pScreenPriv->ptWMProc,
|
&pScreenPriv->ptWMProc,
|
||||||
&pScreenPriv->ptXMsgProc,
|
&pScreenPriv->ptXMsgProc,
|
||||||
&pScreenPriv->pmServerStarted,
|
&pScreenPriv->pmServerStarted,
|
||||||
pScreenInfo->dwScreen, (HWND) &pScreenPriv->hwndScreen,
|
pScreenInfo->dwScreen,
|
||||||
FALSE)) {
|
(HWND) &pScreenPriv->hwndScreen)) {
|
||||||
ErrorF("winFinishScreenInitFB - winInitWM () failed.\n");
|
ErrorF("winFinishScreenInitFB - winInitWM () failed.\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ winInitWM(void **ppWMInfo,
|
||||||
pthread_t * ptWMProc,
|
pthread_t * ptWMProc,
|
||||||
pthread_t * ptXMsgProc,
|
pthread_t * ptXMsgProc,
|
||||||
pthread_mutex_t * ppmServerStarted,
|
pthread_mutex_t * ppmServerStarted,
|
||||||
int dwScreen, HWND hwndScreen, BOOL allowOtherWM);
|
int dwScreen, HWND hwndScreen);
|
||||||
|
|
||||||
void
|
void
|
||||||
winDeinitMultiWindowWM(void);
|
winDeinitMultiWindowWM(void);
|
||||||
|
|
Loading…
Reference in New Issue