Select for SubstructureRedirectMask on screen window and make sure

no WM is running when using back-end server root window.
This commit is contained in:
David Reveman 2008-07-10 03:18:43 -04:00
parent d23a64fb67
commit 95106e7245
4 changed files with 26 additions and 2 deletions

View file

@ -1793,6 +1793,17 @@ dmxAttachScreen (int idx,
dmxCheckForWM(dmxScreen);
dmxGetScreenAttribs(dmxScreen);
if (dmxScreen->beUseRoot && dmxScreen->WMRunningOnBE)
{
dmxLogErrorSet (dmxWarning, errorSet, error, errorName,
"WM running. cannot use back-end server "
"root window\n");
/* Restore the old screen */
*dmxScreen = oldDMXScreen;
return 1;
}
#ifdef RANDR
dmxScreen->beRandr = FALSE;
#endif

View file

@ -611,6 +611,19 @@ static Bool dmxDisplayInit(DMXScreenInfo *dmxScreen)
dmxCheckForWM(dmxScreen);
dmxGetScreenAttribs(dmxScreen);
if (dmxScreen->beUseRoot && dmxScreen->WMRunningOnBE)
{
dmxLog (dmxWarning,
"WM running. cannot use back-end server root window\n");
XLIB_PROLOGUE (dmxScreen);
XCloseDisplay(dmxScreen->beDisplay);
XLIB_EPILOGUE (dmxScreen);
dmxScreen->beDisplay = NULL;
return FALSE;
}
if (!dmxGetVisualInfo(dmxScreen))
{
dmxLog(dmxWarning,

View file

@ -1421,7 +1421,7 @@ void dmxBEScreenInit(int idx, ScreenPtr pScreen)
/* Create root window for screen */
mask = CWBackPixel | CWEventMask | CWColormap | CWOverrideRedirect;
attribs.background_pixel = dmxScreen->beBlackPixel;
attribs.event_mask = StructureNotifyMask;
attribs.event_mask = StructureNotifyMask | SubstructureRedirectMask;
attribs.colormap = dmxScreen->beDefColormaps[dmxScreen->beDefVisualIndex];
attribs.override_redirect = True;

View file

@ -621,7 +621,7 @@ void dmxBackendInit(DevicePtr pDev)
/* Finish initialization using computed values or constants. */
dmxBackendComputeCenter(priv);
priv->eventMask = StructureNotifyMask;
priv->eventMask = StructureNotifyMask | SubstructureRedirectMask;
priv->myScreen = dmxScreen->index;
priv->lastX = priv->centerX;
priv->lastY = priv->centerY;