xf86RandR12: Don't call ConstrainCursorHarder() if panning is enabled
Panning is at odds with CRTC cursor confinement. This disables CRTC cursor
confinement as long as panning is enabled.
Fixes regression introduced in 56c90e29f0
.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
ff56f88616
commit
1bf81af4a6
|
@ -60,6 +60,9 @@ typedef struct _xf86RandR12Info {
|
||||||
* See https://bugs.freedesktop.org/show_bug.cgi?id=21554
|
* See https://bugs.freedesktop.org/show_bug.cgi?id=21554
|
||||||
*/
|
*/
|
||||||
xf86EnterVTProc *orig_EnterVT;
|
xf86EnterVTProc *orig_EnterVT;
|
||||||
|
|
||||||
|
Bool panning;
|
||||||
|
ConstrainCursorHarderProcPtr orig_ConstrainCursorHarder;
|
||||||
} XF86RandRInfoRec, *XF86RandRInfoPtr;
|
} XF86RandRInfoRec, *XF86RandRInfoPtr;
|
||||||
|
|
||||||
#ifdef RANDR_12_INTERFACE
|
#ifdef RANDR_12_INTERFACE
|
||||||
|
@ -665,6 +668,10 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define PANNING_ENABLED(crtc) \
|
||||||
|
((crtc)->panningTotalArea.x2 > (crtc)->panningTotalArea.x1 || \
|
||||||
|
(crtc)->panningTotalArea.y2 > (crtc)->panningTotalArea.y1)
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xf86RandR12ScreenSetSize(ScreenPtr pScreen,
|
xf86RandR12ScreenSetSize(ScreenPtr pScreen,
|
||||||
CARD16 width,
|
CARD16 width,
|
||||||
|
@ -676,6 +683,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen,
|
||||||
WindowPtr pRoot = pScreen->root;
|
WindowPtr pRoot = pScreen->root;
|
||||||
PixmapPtr pScrnPix;
|
PixmapPtr pScrnPix;
|
||||||
Bool ret = FALSE;
|
Bool ret = FALSE;
|
||||||
|
Bool panning = FALSE;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
if (xf86RandR12Key) {
|
if (xf86RandR12Key) {
|
||||||
|
@ -696,8 +704,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen,
|
||||||
for (c = 0; c < config->num_crtc; c++) {
|
for (c = 0; c < config->num_crtc; c++) {
|
||||||
xf86CrtcPtr crtc = config->crtc[c];
|
xf86CrtcPtr crtc = config->crtc[c];
|
||||||
|
|
||||||
if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 ||
|
if (PANNING_ENABLED (crtc)) {
|
||||||
crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
|
|
||||||
if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
|
if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
|
||||||
crtc->panningTotalArea.x2 += width - pScreen->width;
|
crtc->panningTotalArea.x2 += width - pScreen->width;
|
||||||
if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
|
if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
|
||||||
|
@ -708,6 +715,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen,
|
||||||
crtc->panningTrackingArea.y2 += height - pScreen->height;
|
crtc->panningTrackingArea.y2 += height - pScreen->height;
|
||||||
xf86RandR13VerifyPanningArea(crtc, width, height);
|
xf86RandR13VerifyPanningArea(crtc, width, height);
|
||||||
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
||||||
|
panning = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -903,6 +911,7 @@ xf86RandR12CloseScreen(ScreenPtr pScreen)
|
||||||
randrp = XF86RANDRINFO(pScreen);
|
randrp = XF86RANDRINFO(pScreen);
|
||||||
#if RANDR_12_INTERFACE
|
#if RANDR_12_INTERFACE
|
||||||
xf86ScreenToScrn(pScreen)->EnterVT = randrp->orig_EnterVT;
|
xf86ScreenToScrn(pScreen)->EnterVT = randrp->orig_EnterVT;
|
||||||
|
pScreen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
free(randrp);
|
free(randrp);
|
||||||
|
@ -1216,6 +1225,7 @@ xf86RandR12CrtcSet(ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height);
|
xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height);
|
||||||
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
||||||
|
randrp->panning = PANNING_ENABLED (crtc);
|
||||||
/*
|
/*
|
||||||
* Save the last successful setting for EnterVT
|
* Save the last successful setting for EnterVT
|
||||||
*/
|
*/
|
||||||
|
@ -1650,6 +1660,7 @@ xf86RandR13SetPanning(ScreenPtr pScreen,
|
||||||
BoxRec oldTotalArea;
|
BoxRec oldTotalArea;
|
||||||
BoxRec oldTrackingArea;
|
BoxRec oldTrackingArea;
|
||||||
INT16 oldBorder[4];
|
INT16 oldBorder[4];
|
||||||
|
Bool oldPanning = randrp->panning;
|
||||||
|
|
||||||
if (crtc->version < 2)
|
if (crtc->version < 2)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1667,6 +1678,7 @@ xf86RandR13SetPanning(ScreenPtr pScreen,
|
||||||
|
|
||||||
if (xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height)) {
|
if (xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height)) {
|
||||||
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY);
|
||||||
|
randrp->panning = PANNING_ENABLED (crtc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1674,6 +1686,7 @@ xf86RandR13SetPanning(ScreenPtr pScreen,
|
||||||
memcpy(&crtc->panningTotalArea, &oldTotalArea, sizeof(BoxRec));
|
memcpy(&crtc->panningTotalArea, &oldTotalArea, sizeof(BoxRec));
|
||||||
memcpy(&crtc->panningTrackingArea, &oldTrackingArea, sizeof(BoxRec));
|
memcpy(&crtc->panningTrackingArea, &oldTrackingArea, sizeof(BoxRec));
|
||||||
memcpy(crtc->panningBorder, oldBorder, 4 * sizeof(INT16));
|
memcpy(crtc->panningBorder, oldBorder, 4 * sizeof(INT16));
|
||||||
|
randrp->panning = oldPanning;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1762,8 +1775,6 @@ xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen,
|
||||||
RRProviderPtr provider,
|
RRProviderPtr provider,
|
||||||
RRProviderPtr source_provider)
|
RRProviderPtr source_provider)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (!source_provider) {
|
if (!source_provider) {
|
||||||
if (provider->output_source) {
|
if (provider->output_source) {
|
||||||
ScreenPtr cmScreen = pScreen->current_master;
|
ScreenPtr cmScreen = pScreen->current_master;
|
||||||
|
@ -1859,6 +1870,21 @@ xf86CrtcSetScanoutPixmap(RRCrtcPtr randr_crtc, PixmapPtr pixmap)
|
||||||
return crtc->funcs->set_scanout_pixmap(crtc, pixmap);
|
return crtc->funcs->set_scanout_pixmap(crtc, pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y)
|
||||||
|
{
|
||||||
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(screen);
|
||||||
|
|
||||||
|
if (randrp->panning)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (randrp->orig_ConstrainCursorHarder) {
|
||||||
|
screen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder;
|
||||||
|
screen->ConstrainCursorHarder(dev, screen, mode, x, y);
|
||||||
|
screen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xf86RandR12Init12(ScreenPtr pScreen)
|
xf86RandR12Init12(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
@ -1895,6 +1921,10 @@ xf86RandR12Init12(ScreenPtr pScreen)
|
||||||
randrp->orig_EnterVT = pScrn->EnterVT;
|
randrp->orig_EnterVT = pScrn->EnterVT;
|
||||||
pScrn->EnterVT = xf86RandR12EnterVT;
|
pScrn->EnterVT = xf86RandR12EnterVT;
|
||||||
|
|
||||||
|
randrp->panning = FALSE;
|
||||||
|
randrp->orig_ConstrainCursorHarder = pScreen->ConstrainCursorHarder;
|
||||||
|
pScreen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder;
|
||||||
|
|
||||||
if (!xf86RandR12CreateObjects12(pScreen))
|
if (!xf86RandR12CreateObjects12(pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue