diff options
author | Keith Packard <keithp@keithp.com> | 2011-11-02 21:20:07 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-11-02 21:20:07 -0700 |
commit | d91aa0e6601bdf3e2cfa57b3412ab14ac486edc4 (patch) | |
tree | 7c18b19cfd5fb4d05f54549121fda33e1b9cd249 /dix/devices.c | |
parent | 8df3a9ca5abbd56eb2013fa65250d21a8f18865b (diff) | |
parent | 401150d7dcad08be7c1f07e076f810cd61e2105c (diff) |
Merge remote-tracking branch 'whot/two-screen-coordinates'
Diffstat (limited to 'dix/devices.c')
-rw-r--r-- | dix/devices.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dix/devices.c b/dix/devices.c index 673a360fb..da817a8af 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -612,6 +612,7 @@ CorePointerProc(DeviceIntPtr pDev, int what) int i = 0; Atom btn_labels[NBUTTONS] = {0}; Atom axes_labels[NAXES] = {0}; + ScreenPtr scr = screenInfo.screens[0]; switch (what) { case DEVICE_INIT: @@ -638,10 +639,11 @@ CorePointerProc(DeviceIntPtr pDev, int what) pDev->name); return BadAlloc; /* IPDS only fails on allocs */ } - pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; - pDev->last.valuators[0] = pDev->valuator->axisVal[0]; - pDev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; - pDev->last.valuators[1] = pDev->valuator->axisVal[1]; + /* axisVal is per-screen, last.valuators is desktop-wide */ + pDev->valuator->axisVal[0] = scr->width / 2; + pDev->last.valuators[0] = pDev->valuator->axisVal[0] + scr->x; + pDev->valuator->axisVal[1] = scr->height / 2; + pDev->last.valuators[1] = pDev->valuator->axisVal[1] + scr->y; break; case DEVICE_CLOSE: |