Addition of console input after removal of core backend input that is not
on screen 0 can cause a segfault. Fix by preventing reinitialization of detached inputs. When Xinerama is active and screen 0 is detached, pixmaps for XGetImage must be obtained from another screen.
This commit is contained in:
parent
0addd0d499
commit
c042647278
|
@ -227,14 +227,14 @@ static void dmxAdjustCursorBoundaries(void)
|
||||||
dmxConnectionBlockCallback();
|
dmxConnectionBlockCallback();
|
||||||
for (i = 0; i < dmxNumInputs; i++) {
|
for (i = 0; i < dmxNumInputs; i++) {
|
||||||
DMXInputInfo *dmxInput = &dmxInputs[i];
|
DMXInputInfo *dmxInput = &dmxInputs[i];
|
||||||
dmxInputReInit(dmxInput);
|
if (!dmxInput->detached) dmxInputReInit(dmxInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
dmxCheckCursor();
|
dmxCheckCursor();
|
||||||
|
|
||||||
for (i = 0; i < dmxNumInputs; i++) {
|
for (i = 0; i < dmxNumInputs; i++) {
|
||||||
DMXInputInfo *dmxInput = &dmxInputs[i];
|
DMXInputInfo *dmxInput = &dmxInputs[i];
|
||||||
dmxInputLateReInit(dmxInput);
|
if (!dmxInput->detached) dmxInputLateReInit(dmxInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
|
|
||||||
|
#include "panoramiXsrv.h"
|
||||||
|
|
||||||
#define DMX_GCOPS_SET_DRAWABLE(_pDraw, _draw) \
|
#define DMX_GCOPS_SET_DRAWABLE(_pDraw, _draw) \
|
||||||
do { \
|
do { \
|
||||||
if ((_pDraw)->type == DRAWABLE_WINDOW) { \
|
if ((_pDraw)->type == DRAWABLE_WINDOW) { \
|
||||||
|
@ -503,6 +505,42 @@ void dmxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
||||||
* Miscellaneous drawing commands
|
* Miscellaneous drawing commands
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** When Xinerama is active, the client pixmaps are always obtained from
|
||||||
|
* screen 0. When screen 0 is detached, the pixmaps must be obtained
|
||||||
|
* from any other screen that is not detached. Usually, this is screen
|
||||||
|
* 1. */
|
||||||
|
static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
|
||||||
|
{
|
||||||
|
#ifdef PANORAMIX
|
||||||
|
PanoramiXRes *pXinPix;
|
||||||
|
int i;
|
||||||
|
DMXScreenInfo *dmxScreen;
|
||||||
|
|
||||||
|
if (noPanoramiXExtension) return NULL;
|
||||||
|
if (pDrawable->type != DRAWABLE_PIXMAP) return NULL;
|
||||||
|
|
||||||
|
if (!(pXinPix = (PanoramiXRes *)LookupIDByType(pDrawable->id, XRT_PIXMAP)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (i = 1; i < PanoramiXNumScreens; i++) {
|
||||||
|
dmxScreen = &dmxScreens[i];
|
||||||
|
if (dmxScreen->beDisplay) {
|
||||||
|
PixmapPtr pSrc;
|
||||||
|
dmxPixPrivPtr pSrcPriv;
|
||||||
|
|
||||||
|
pSrc = (PixmapPtr)LookupIDByType(pXinPix->info[i].id,
|
||||||
|
RT_PIXMAP);
|
||||||
|
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
|
||||||
|
if (pSrcPriv->pixmap) {
|
||||||
|
*draw = pSrcPriv->pixmap;
|
||||||
|
return dmxScreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/** Get an image from the back-end server associated with \a pDrawable's
|
/** Get an image from the back-end server associated with \a pDrawable's
|
||||||
* screen. If \a pDrawable is a window, it must be viewable to get an
|
* screen. If \a pDrawable is a window, it must be viewable to get an
|
||||||
* image from it. If it is not viewable, then get the image from the
|
* image from it. If it is not viewable, then get the image from the
|
||||||
|
@ -533,8 +571,11 @@ void dmxGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
|
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
|
||||||
if (DMX_GCOPS_OFFSCREEN(pDrawable))
|
if (DMX_GCOPS_OFFSCREEN(pDrawable)) {
|
||||||
return;
|
/* Try to find the pixmap on a non-detached Xinerama screen */
|
||||||
|
dmxScreen = dmxFindAlternatePixmap(pDrawable, &draw);
|
||||||
|
if (!dmxScreen) return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img = XGetImage(dmxScreen->beDisplay, draw,
|
img = XGetImage(dmxScreen->beDisplay, draw,
|
||||||
|
|
Loading…
Reference in New Issue