diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-08-05 18:11:39 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-08-05 18:11:39 +0000 |
commit | 9366a4edcadcd46d8250f82e79f0925d2ebecac9 (patch) | |
tree | 28a840e0625fa988a866e9a78edce6c13e409790 /xserver/hw/xfree86 | |
parent | b4fa65f9703e9da8db366bfae869f6bcf90ac7f4 (diff) |
Update to xserver 1.12.3.
Diffstat (limited to 'xserver/hw/xfree86')
-rw-r--r-- | xserver/hw/xfree86/common/xf86Config.c | 1 | ||||
-rw-r--r-- | xserver/hw/xfree86/common/xf86Init.c | 2 | ||||
-rw-r--r-- | xserver/hw/xfree86/common/xf86Xinput.c | 94 | ||||
-rw-r--r-- | xserver/hw/xfree86/modes/xf86EdidModes.c | 13 |
4 files changed, 90 insertions, 20 deletions
diff --git a/xserver/hw/xfree86/common/xf86Config.c b/xserver/hw/xfree86/common/xf86Config.c index 9e05438a4..09ea3fa8c 100644 --- a/xserver/hw/xfree86/common/xf86Config.c +++ b/xserver/hw/xfree86/common/xf86Config.c @@ -2334,6 +2334,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) current = dev; free(*dev); + *dev = NULL; do { *current = *(current + 1); diff --git a/xserver/hw/xfree86/common/xf86Init.c b/xserver/hw/xfree86/common/xf86Init.c index 81326b6bb..697e4bdff 100644 --- a/xserver/hw/xfree86/common/xf86Init.c +++ b/xserver/hw/xfree86/common/xf86Init.c @@ -977,7 +977,7 @@ OsVendorInit(void) xf86DropPriv(display); } #endif - + xf86UnblockSIGIO(0); beenHere = TRUE; } diff --git a/xserver/hw/xfree86/common/xf86Xinput.c b/xserver/hw/xfree86/common/xf86Xinput.c index 77b800000..bee407bf9 100644 --- a/xserver/hw/xfree86/common/xf86Xinput.c +++ b/xserver/hw/xfree86/common/xf86Xinput.c @@ -1059,26 +1059,24 @@ xf86PostMotionEventP(DeviceIntPtr device, xf86PostMotionEventM(device, is_absolute, &mask); } -void -xf86PostMotionEventM(DeviceIntPtr device, - int is_absolute, const ValuatorMask *mask) +static int +xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute, + const ValuatorMask *mask) { - int flags = 0; - - if (valuator_mask_num_valuators(mask) > 0) { - if (is_absolute) - flags = POINTER_ABSOLUTE; - else - flags = POINTER_RELATIVE | POINTER_ACCELERATE; - } + int stolen = 0; #if XFreeXDGA + ScreenPtr scr = NULL; + int idx, i; + /* The evdev driver may not always send all axes across. */ - if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) - if (miPointerGetScreen(device)) { - int index = miPointerGetScreen(device)->myNum; + if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) { + scr = miPointerGetScreen(device); + if (scr) { int dx = 0, dy = 0; + idx = scr->myNum; + if (valuator_mask_isset(mask, 0)) { dx = valuator_mask_get(mask, 0); if (is_absolute) @@ -1091,11 +1089,75 @@ xf86PostMotionEventM(DeviceIntPtr device, dy -= device->last.valuators[1]; } - if (DGAStealMotionEvent(device, index, dx, dy)) - return; + if (DGAStealMotionEvent(device, idx, dx, dy)) + stolen = 1; + } + } + + for (i = 2; i < valuator_mask_size(mask); i++) { + AxisInfoPtr ax; + double incr; + int val, button; + + if (i >= device->valuator->numAxes) + break; + + if (!valuator_mask_isset(mask, i)) + continue; + + ax = &device->valuator->axes[i]; + + if (ax->scroll.type == SCROLL_TYPE_NONE) + continue; + + if (!scr) { + scr = miPointerGetScreen(device); + if (!scr) + break; + idx = scr->myNum; + } + + incr = ax->scroll.increment; + val = valuator_mask_get(mask, i); + + if (ax->scroll.type == SCROLL_TYPE_VERTICAL) { + if (incr * val < 0) + button = 4; /* up */ + else + button = 5; /* down */ + } else { /* SCROLL_TYPE_HORIZONTAL */ + if (incr * val < 0) + button = 6; /* left */ + else + button = 7; /* right */ } + + if (DGAStealButtonEvent(device, idx, button, 1) && + DGAStealButtonEvent(device, idx, button, 0)) + stolen = 1; + } + #endif + return stolen; +} + +void +xf86PostMotionEventM(DeviceIntPtr device, + int is_absolute, const ValuatorMask *mask) +{ + int flags = 0; + + if (xf86CheckMotionEvent4DGA(device, is_absolute, mask)) + return; + + if (valuator_mask_num_valuators(mask) > 0) { + if (is_absolute) + flags = POINTER_ABSOLUTE; + else + flags = POINTER_RELATIVE | POINTER_ACCELERATE; + } + QueuePointerEvents(device, MotionNotify, 0, flags, mask); } diff --git a/xserver/hw/xfree86/modes/xf86EdidModes.c b/xserver/hw/xfree86/modes/xf86EdidModes.c index 8aa82d114..258ada5b4 100644 --- a/xserver/hw/xfree86/modes/xf86EdidModes.c +++ b/xserver/hw/xfree86/modes/xf86EdidModes.c @@ -723,7 +723,13 @@ static const struct { 1920, 1200, 75, 0}, { 1920, 1200, 85, 0}, { 1920, 1440, 60, 0}, { -1920, 1440, 75, 0},}; + 1920, 1440, 75, 0}, + /* fill up last byte */ + { + 0,0,0,0}, { + 0,0,0,0}, { + 0,0,0,0}, { + 0,0,0,0}, }; static DisplayModePtr DDCModesFromEstIII(unsigned char *est) @@ -732,10 +738,11 @@ DDCModesFromEstIII(unsigned char *est) int i, j, m; for (i = 0; i < 6; i++) { - for (j = 7; j > 0; j--) { + for (j = 7; j >= 0; j--) { if (est[i] & (1 << j)) { m = (i * 8) + (7 - j); - modes = xf86ModesAdd(modes, + if (EstIIIModes[m].w) + modes = xf86ModesAdd(modes, FindDMTMode(EstIIIModes[m].w, EstIIIModes[m].h, EstIIIModes[m].r, |