commit 6f3ac455553de68f56b651ba01acc4b2a698d7a4 Author: Suresh Kumar Date: Thu Aug 11 12:03:22 2016 +0530 Add cursor scaling fix diff --git a/xorg-server/repos/extra-x86_64/PKGBUILD b/xorg-server/repos/extra-x86_64/PKGBUILD index 40b7adc..9e77262 100644 --- a/xorg-server/repos/extra-x86_64/PKGBUILD +++ b/xorg-server/repos/extra-x86_64/PKGBUILD @@ -19,15 +19,21 @@ makedepends=('pixman' 'libx11' 'mesa' 'mesa-libgl' 'xf86driproto' 'xcmiscproto' 'libxshmfence' 'libunwind') source=(${url}/releases/individual/xserver/${pkgbase}-${pkgver}.tar.bz2{,.sig} xvfb-run - xvfb-run.1) + xvfb-run.1 + xorg-cursor-scaling.patch) validpgpkeys=('7B27A3F1A6E18CD9588B4AE8310180050905E40C' 'C383B778255613DFDB409D91DB221A6900000011' 'DD38563A8A8224537D1F90E45B8A2D50A0ECD0D3') sha256sums=('278459b2c31d61a15655d95a72fb79930c480a6bb8cf9226e48a07df8b1d31c8' 'SKIP' 'ff0156309470fc1d378fd2e104338020a884295e285972cc88e250e031cc35b9' - '2460adccd3362fefd4cdc5f1c70f332d7b578091fb9167bf88b5f91265bbd776') + '2460adccd3362fefd4cdc5f1c70f332d7b578091fb9167bf88b5f91265bbd776' + '6c1cec847ff962ad8d29802a037aa2720ab102148fcf579060657244c80605f6') +prepare() { + cd "${pkgbase}-${pkgver}" + patch -Np1 -i ../xorg-cursor-scaling.patch +} build() { cd "${pkgbase}-${pkgver}" diff --git a/xorg-server/repos/extra-x86_64/xorg-cursor-scaling.patch b/xorg-server/repos/extra-x86_64/xorg-cursor-scaling.patch new file mode 100644 index 0000000..0fdfb65 --- /dev/null +++ b/xorg-server/repos/extra-x86_64/xorg-cursor-scaling.patch @@ -0,0 +1,141 @@ +From 9365c02aba72fd370c7080c875d196f14d8d93bd Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Sat, 1 Mar 2014 08:25:18 +0000 +Subject: [PATCH] randr: Account for panning and transforms when constraining + the cursor + +commit 56c90e29f04727c903bd0f084d23bf44eb1a0a11 [1.10.99.901] +Author: Adam Jackson +Date: Mon Nov 15 14:29:14 2010 -0500 + + randr: Add RRConstrainCursorHarder + +introduced a regression as it ignored the effect of panning and +transforms upon the crtc bounds. The result was that the cursor would be +constrained to the visible area even though the panning arena was much +bigger, or the cursor was constrained to a region that did not even +match the visible area when the output was transformed or reflected. + +This supercedes the hack introduced by +commit 1bf81af4a6be1113bcc3b940ab264d5c9e0f0c5d [1.12.99.904] +Author: Rui Matos +Date: Mon Jul 30 14:32:12 2012 -0400 + + xf86RandR12: Don't call ConstrainCursorHarder() if panning is enabled +which disabled the cursor constraints if a panning mode was active, but +did not fix the regression with arbitrary output transforms. + +Signed-off-by: Chris Wilson +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39949 +Cc: Adam Jackson +Cc: Rui Matos +--- + randr/rrcrtc.c | 60 +++++++++++++++++++++++++++++++++------------------------- + 1 file changed, 34 insertions(+), 26 deletions(-) + +diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c +index 6e181ba..900c7db 100644 +--- a/randr/rrcrtc.c ++++ b/randr/rrcrtc.c +@@ -273,25 +273,34 @@ RRCrtcPendingProperties(RRCrtcPtr crtc) + return FALSE; + } + +-static void +-crtc_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom) ++static Bool ++cursor_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom) + { +- *left = crtc->x; +- *top = crtc->y; ++ rrScrPriv(crtc->pScreen); ++ BoxRec bounds; + +- switch (crtc->rotation) { +- case RR_Rotate_0: +- case RR_Rotate_180: +- default: +- *right = crtc->x + crtc->mode->mode.width; +- *bottom = crtc->y + crtc->mode->mode.height; +- return; +- case RR_Rotate_90: +- case RR_Rotate_270: +- *right = crtc->x + crtc->mode->mode.height; +- *bottom = crtc->y + crtc->mode->mode.width; +- return; ++ if (crtc->mode == NULL) ++ return FALSE; ++ ++ memset(&bounds, 0, sizeof(bounds)); ++ if (pScrPriv->rrGetPanning) ++ pScrPriv->rrGetPanning(crtc->pScreen, crtc, NULL, &bounds, NULL); ++ ++ if (bounds.y2 <= bounds.y1 || bounds.x2 <= bounds.x1) { ++ bounds.x1 = 0; ++ bounds.y1 = 0; ++ bounds.x2 = crtc->mode->mode.width; ++ bounds.y2 = crtc->mode->mode.height; + } ++ ++ pixman_f_transform_bounds(&crtc->f_transform, &bounds); ++ ++ *left = bounds.x1; ++ *right = bounds.x2; ++ *top = bounds.y1; ++ *bottom = bounds.y2; ++ ++ return TRUE; + } + + /* overlapping counts as adjacent */ +@@ -303,8 +312,10 @@ crtcs_adjacent(const RRCrtcPtr a, const RRCrtcPtr b) + int bl, br, bt, bb; + int cl, cr, ct, cb; /* the overlap, if any */ + +- crtc_bounds(a, &al, &ar, &at, &ab); +- crtc_bounds(b, &bl, &br, &bt, &bb); ++ if (!cursor_bounds(a, &al, &ar, &at, &ab)) ++ return FALSE; ++ if (!cursor_bounds(b, &bl, &br, &bt, &bb)) ++ return FALSE; + + cl = max(al, bl); + cr = min(ar, br); +@@ -322,7 +333,7 @@ mark_crtcs(rrScrPrivPtr pScrPriv, int *reachable, int cur) + + reachable[cur] = TRUE; + for (i = 0; i < pScrPriv->numCrtcs; ++i) { +- if (reachable[i] || !pScrPriv->crtcs[i]->mode) ++ if (reachable[i]) + continue; + if (crtcs_adjacent(pScrPriv->crtcs[cur], pScrPriv->crtcs[i])) + mark_crtcs(pScrPriv, reachable, i); +@@ -1573,10 +1584,8 @@ static Bool check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y) + + int left, right, top, bottom; + +- if (!crtc->mode) +- continue; +- +- crtc_bounds(crtc, &left, &right, &top, &bottom); ++ if (!cursor_bounds(crtc, &left, &right, &top, &bottom)) ++ continue; + + if ((*x >= left) && (*x < right) && (*y >= top) && (*y < bottom)) + return TRUE; +@@ -1595,10 +1604,9 @@ static Bool constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int + int nx, ny; + int left, right, top, bottom; + +- if (!crtc->mode) +- continue; ++ if (!cursor_bounds(crtc, &left, &right, &top, &bottom)) ++ continue; + +- crtc_bounds(crtc, &left, &right, &top, &bottom); + miPointerGetPosition(pDev, &nx, &ny); + + if ((nx >= left) && (nx < right) && (ny >= top) && (ny < bottom)) { +-- +1.9.0 +