External windowmanagers could connect in multiwindow mode which lead to
strange results with the internal windowmanager.
This commit is contained in:
parent
426282268b
commit
3af77ad3e7
|
@ -1,3 +1,11 @@
|
||||||
|
2005-07-05 Alexander Gottwald <ago at freedesktop dot org>
|
||||||
|
|
||||||
|
* winwindow.h:
|
||||||
|
* winmultiwindowwm.c:
|
||||||
|
* winscrinit.c:
|
||||||
|
External windowmanagers could connect in multiwindow mode which lead
|
||||||
|
to strange results with the internal windowmanager.
|
||||||
|
|
||||||
2005-07-05 Alexander Gottwald <ago at freedesktop dot org>
|
2005-07-05 Alexander Gottwald <ago at freedesktop dot org>
|
||||||
|
|
||||||
* *.c:
|
* *.c:
|
||||||
|
|
|
@ -112,6 +112,7 @@ typedef struct _WMInfo {
|
||||||
Atom atmWmProtos;
|
Atom atmWmProtos;
|
||||||
Atom atmWmDelete;
|
Atom atmWmDelete;
|
||||||
Atom atmPrivMap;
|
Atom atmPrivMap;
|
||||||
|
Bool fAllowOtherWM;
|
||||||
} WMInfoRec, *WMInfoPtr;
|
} WMInfoRec, *WMInfoPtr;
|
||||||
|
|
||||||
typedef struct _WMProcArgRec {
|
typedef struct _WMProcArgRec {
|
||||||
|
@ -933,7 +934,25 @@ 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_fAnotherWMRunnig = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen);
|
if (pProcArg->pWMInfo->fAllowOtherWM)
|
||||||
|
{
|
||||||
|
g_fAnotherWMRunnig = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen);
|
||||||
|
} else {
|
||||||
|
redirectError = FALSE;
|
||||||
|
XSetErrorHandler (winRedirectErrorHandler);
|
||||||
|
XSelectInput(pProcArg->pDisplay,
|
||||||
|
RootWindow (pProcArg->pDisplay, pProcArg->dwScreen),
|
||||||
|
SubstructureNotifyMask | ButtonPressMask);
|
||||||
|
XSync (pProcArg->pDisplay, 0);
|
||||||
|
XSetErrorHandler (winMultiWindowXMsgProcErrorHandler);
|
||||||
|
if (redirectError)
|
||||||
|
{
|
||||||
|
ErrorF ("winMultiWindowXMsgProc - "
|
||||||
|
"another window manager is running. Exiting.\n");
|
||||||
|
pthread_exit (NULL);
|
||||||
|
}
|
||||||
|
g_fAnotherWMRunnig = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set up the supported icon sizes */
|
/* Set up the supported icon sizes */
|
||||||
xis = XAllocIconSize ();
|
xis = XAllocIconSize ();
|
||||||
|
@ -962,7 +981,7 @@ winMultiWindowXMsgProc (void *pArg)
|
||||||
/* Loop until we explicitly break out */
|
/* Loop until we explicitly break out */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (!XPending (pProcArg->pDisplay))
|
if (pProcArg->pWMInfo->fAllowOtherWM && !XPending (pProcArg->pDisplay))
|
||||||
{
|
{
|
||||||
if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen))
|
if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen))
|
||||||
{
|
{
|
||||||
|
@ -1057,7 +1076,8 @@ winInitWM (void **ppWMInfo,
|
||||||
pthread_t *ptXMsgProc,
|
pthread_t *ptXMsgProc,
|
||||||
pthread_mutex_t *ppmServerStarted,
|
pthread_mutex_t *ppmServerStarted,
|
||||||
int dwScreen,
|
int dwScreen,
|
||||||
HWND hwndScreen)
|
HWND hwndScreen,
|
||||||
|
BOOL allowOtherWM)
|
||||||
{
|
{
|
||||||
WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec));
|
WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec));
|
||||||
WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec));
|
WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec));
|
||||||
|
@ -1077,6 +1097,7 @@ 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;
|
||||||
|
|
|
@ -610,7 +610,8 @@ winFinishScreenInitFB (int index,
|
||||||
&pScreenPriv->ptXMsgProc,
|
&pScreenPriv->ptXMsgProc,
|
||||||
&pScreenPriv->pmServerStarted,
|
&pScreenPriv->pmServerStarted,
|
||||||
pScreenInfo->dwScreen,
|
pScreenInfo->dwScreen,
|
||||||
(HWND)&pScreenPriv->hwndScreen))
|
(HWND)&pScreenPriv->hwndScreen,
|
||||||
|
pScreenInfo->fInternalWM))
|
||||||
{
|
{
|
||||||
ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n");
|
ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -124,7 +124,8 @@ winInitWM (void **ppWMInfo,
|
||||||
pthread_t *ptXMsgProc,
|
pthread_t *ptXMsgProc,
|
||||||
pthread_mutex_t *ppmServerStarted,
|
pthread_mutex_t *ppmServerStarted,
|
||||||
int dwScreen,
|
int dwScreen,
|
||||||
HWND hwndScreen);
|
HWND hwndScreen,
|
||||||
|
BOOL allowOtherWM);
|
||||||
|
|
||||||
void
|
void
|
||||||
winDeinitMultiWindowWM (void);
|
winDeinitMultiWindowWM (void);
|
||||||
|
|
Loading…
Reference in New Issue