summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-11-20Reset only what the protocol requires, instead of full regeneration.no-regenJamey Sharp12-179/+298
It's difficult to get regeneration correct in all the drivers, extensions, and everywhere else it's currently required--and there's no significant advantage to doing full regeneration. So instead, make DIX reset exactly the things required by the protocol specification, and set serverGeneration to a constant 1. Eliminating all the ugly code that's conditional on serverGeneration is left as a later exercise. This patch should simply improve reliability when the server resets. Signed-off-by: Jamey Sharp <jamey@minilop.net>
2011-11-20Factor out duplicated WindowOptPtr initialization.Jamey Sharp1-39/+35
By using the same code for both MakeWindowOptional and CreateRootWindow, we ensure that new WindowOptPtrs are always fully initialized. Previously, CreateRootWindow did not initialize optional->cursor. It relied on InitRootWindow to overwrite it later, which seems like a wild pointer dereference just waiting to happen. Signed-off-by: Jamey Sharp <jamey@minilop.net>
2011-11-20InitRootWindow: Use ChangeWindowAttributes instead of duplicating it.Jamey Sharp1-35/+9
The protocol requires ChangeWindowAttributes to be able to set the root window's background and cursor to their defaults. So let's just use that when InitRootWindow needs to set up the defaults in the first place. This guarantees that using ChangeWindowAttributes to reset the root window really does restore the startup state, which wasn't quite true before: - If both party_like_its_1989 and bgNoneRoot were set, then the root background was initially the root weave, but ChangeWindowAttributes would reset it to background None. - InitRootWindow checked whether the screen supported background None, while ChangeWindowAttributes unconditionally trusted bgNoneRoot. Signed-off-by: Jamey Sharp <jamey@minilop.net>
2011-11-06Fix vesa's VBE PanelID interpretationDerek Buitenhuis1-1/+4
xserver's VESA driver's VBE (Vesa BIOS Extensions) code includes a PanelID probe, which can get a monitor's native resolution. From this, using CVT formulas, it derives horizontal sync rate and a vertical refresh rate ranges. It however, only derives the upper bounds of the ranges, and the lower bounds cannot de derived. By default, they are set to hardcoded constants which represent the lowest supported resolution: 640x480. The constants in vbe.c however, were not actually derived from forulas, but carried over from other code from the bad old days, and are not relevant to flat panel displays. This caused, for example, EEEPC701's panel, with a native resolution of 800x480, to end up with a upper bound of the horizontal sync rate that was lower than the hardcoded lower bound, which of course broke things. These numbers have been rederived using both my own CVT tool based on xf86CVTMode(), and using the provided 'cvt' tool that comes with xserver. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-03randr: Make the RRConstrainCursorHarder logic the same as miPointerSetPositionRui Matos1-19/+10
The constraining logic in RRConstrainCursorHarder allows the cursor to reach crtc positions of x = width and y = height while the constraining code in miPointerSetPosition only allows it to reach x = width - 1 and y = height - 1 for the analogous screen case. This patch makes the former's logic equivalent to the latter's which allows applications to benefit from Fitts's law. E.g. a maximized application adjacent to a crtc border wouldn't get pointer events if the user moved the pointer all the way until it's contained. Signed-off-by: Rui Matos <tiagomatos@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-02Merge remote-tracking branch 'jturney/master'Keith Packard13-160/+54
2011-11-02mi: remove deprecated miPointerAbsoluteCursor from design docGaetan Nadon1-8/+1
Function was removed from the code by commit f5409aa026 Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-02Merge remote-tracking branch 'whot/two-screen-coordinates'Keith Packard14-67/+270
2011-11-02Merge remote-tracking branch 'koba/reviewed'Keith Packard8-102/+23
2011-11-02hw/xwin: Fix a typo in ddraw.hColin Harrison1-1/+1
Fix a (fortunately benign) typo in ddraw.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-11-02hw/xwin: Revert "Fix bug #5735, Serious flaw in CygwinX clipboard"Yaakov Selkowitz1-46/+2
This commit wreaks havoc with other programs which manage the clipboard, such as MS Office Clipboard or Win32 VNC viewers: http://sourceware.org/bugzilla/show_bug.cgi?id=9910 This reverts commit 70ddd0f39d5118db72a1a4e473cbfb502f1ed9ec. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02hw/xwin: Stop pretending we work on NT4Jon TURNEY3-57/+11
We already link directly to some functions not available in NT4, so stop pretending we will work on NT4 and link directly to EnumDisplayMonitors() and SHGetFolderPath() Also remove mentions of NT4 & Win95 from error messages Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02Xming: Always remove temporary file used when invoking xkbcomp on Win32Colin Harrison2-2/+9
When built for native Win32, pipe() & fork() aren't available, so we use a tempoary file and system() to invoke xkbcomp Ensure the temporary file is always removed. It was only being removed on most errors, not on success :S Also fix a couple of warnings which occur when built with WIN32 defined Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-11-02hw/xwin: Link directly to TrackMouseEvent()Jon TURNEY6-49/+6
TrackMouseEvent has existed in user32 since at least NT4, so don't bother with jumping through all the ancient compatibility hoops of finding if _TrackMouseEvent() exists in comctl32 so it can check if TrackMouseEvent() exists in user32 to see if it needs to emulate it... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02Cygwin/X: Make default DPI match native DPIJon TURNEY3-5/+25
Make the default DPI match the current Windows DPI setting. If that setting can't be retrieved, change the fallback DPI value from 75 dpi to 96 dpi. Mark the application as dpiAware in the manifest, which prevents dpi virtualization for high (>96) dpi values on Vista and later. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-10-31dix: Reinstate GetImage window size checkAaron Plattner1-0/+8
Commit 587c3a2d1961834558193e8e14e8e381a077a253 fixed DoGetImage to check windows against their backing drawables, rather than against the screen dimensions, to prevent reading outside the bounds of redirected windows' backing pixmaps (see bug #22804). Unfortunately, while making that change I also removed the check that the rectangle is contained within the bounds of the source window, which is a violation of the specification: If the drawable is a window, the window must be viewable, and it must be the case that, if there were no inferiors or overlapping windows, the specified rectangle of the window would be fully visible on the screen *and wholly contained within the outside edges of the window* (or a Match error results). Note that the borders of the window can be included and read with this request. (emphasis mine) Reinstate the window dimension check, to return BadMatch if the GetImage request falls outside the bounds of the window. Fixes X Test Suite test XGetImage-15: 400|0 15 1 11:05:41|IC Start 200|0 15 11:05:41|TP Start 520|0 15 00005146 1 1|VSW5TESTSUITE PURPOSE 15 520|0 15 00005146 1 2|Assertion XGetImage-15.(A) 520|0 15 00005146 1 3|When the drawable is a window and the window is viewable 520|0 15 00005146 1 4|and it is not the case that given there were no inferiors or 520|0 15 00005146 1 5|overlapping windows the specified rectangle of the window 520|0 15 00005146 1 6|would be fully visible on the screen and wholly contained 520|0 15 00005146 1 7|within the outside edges of the window, then a BadMatch 520|0 15 00005146 1 8|error occurs. 520|0 15 00005146 1 9|METH: Create window which is not fully visible on the screen. 520|0 15 00005146 1 10|METH: Call XMapWindow to make sure the window is viewable. 520|0 15 00005146 1 11|METH: Call XGetImage with rectangle extending beyond edge of screen. 520|0 15 00005146 1 12|METH: Verify XGetImage return value is null. 520|0 15 00005146 1 13|METH: Verify that BadMatch error occurred. 520|0 15 00005146 1 14|METH: Create window which is fully visible on the screen. 520|0 15 00005146 1 15|METH: Call XMapWindow to make sure the window is viewable. 520|0 15 00005146 1 16|METH: Call XGetImage with rectangle extending beyond edge of window. 520|0 15 00005146 1 17|METH: Verify XGetImage return value is null. 520|0 15 00005146 1 18|METH: Verify that BadMatch error occurred. 520|0 15 00005146 1 19|REPORT: Got Success, Expecting BadMatch 520|0 15 00005146 1 20|REPORT: Null image not returned. 220|0 15 1 11:05:41|FAIL Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-30Merge remote-tracking branch 'whot/for-keith'Keith Packard7-19/+60
2011-10-31dix: block signals when closing all devicesPeter Hutterer1-0/+4
When closing down all devices, we manually unset master for all attached devices, but the device's sprite info still points to the master's sprite info. This leaves us a window where the master is freed already but the device isn't yet. A signal during that window causes dereference of the already freed spriteInfo in mieqEnqueue's EnqueueScreen macro. Simply block signals when removing all devices. It's not like we're really worrying about high-responsive input at this stage. https://bugzilla.redhat.com/show_bug.cgi?id=737031 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-10-31xfree86: fix potential buffer overflowServaas Vandenberghe2-4/+39
The patch below fixes a potential buffer overflow in xf86addComment(). This occurs if curlen > 0 && eol_seen == 0 && iscomment == 0 , as follows from the code: char *xf86addComment(char *cur, char *add) <...> len = strlen(add); endnewline = add[len - 1] == '\n'; len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen; if ((str = realloc(cur, len + curlen)) == NULL) return cur; cur = str; if (eol_seen || (curlen && !hasnewline)) cur[curlen++] = '\n'; if (!iscomment) cur[curlen++] = '#'; strcpy(cur + curlen, add); if (!endnewline) strcat(cur, "\n"); Signed-off-by: Servaas Vandenberghe <vdb@picaros.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> [whot: added buffer overflow test case] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-31xfree86: reduce calls to input_option_get_key/valuePeter Hutterer1-9/+12
No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-29xfree86: add nouveau as the first automatic driver for NVIDIA hardwareAnssi Hannula1-1/+9
Add nouveau as the first driver on linux for NVIDIA hardware when driver autoconfiguration is done, as it is more capable than nv. nv is also kept in the list as it is more widely supported and because some old cards are not supported by nouveau. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-29bsd: alpha_video: Remove unused variablesAlexandr Shadchin1-3/+0
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29bsd: alpha_video: Simplify #includeAlexandr Shadchin1-6/+4
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29bsd: alpha_video: Function sethae() need only for FreeBSDAlexandr Shadchin1-37/+14
Return value sethae() is becoming void because no caller used it. Also old msb_set static checked by each caller is replaced by the p.hae static checked in sethae() when it's called. Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29Move check definition MAP_FAILED in xf86_OSlib.hAlexandr Shadchin8-30/+4
Also remove odd definition MAP_FAILED. Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29Remove odd definition DEV_MEMAlexandr Shadchin4-7/+1
DEV_MEM defined in xf86_OSlib.h Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29Remove BSDi supportAlexandr Shadchin1-17/+2
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29Remove unused VT_SYSREQ_DEFAULTAlexandr Shadchin1-4/+0
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-28Fix position _X_EXPORTAlexandr Shadchin1-2/+2
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-28bsd: Remove odd message about -sharevtsAlexandr Shadchin1-1/+0
This is missing in commit 'xfree86: move -novtswitch & -sharevts argument handling up to common layer' Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-27test: fix two more failing FP3232 testsDave Airlie3-6/+5
And put a comment in to explain why we're testing for a frac between .3 and .6. We can't directly compare the frac since the floating/fixed point conversion loses precision. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-26XWin: windowswm: Correct byte swapping in event notificationsJeremy Huddleston1-1/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-10-26XQuartz: appledri: Correct byte swapping in event notificationsJeremy Huddleston1-1/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-26XQuartz: applewm: Correct byte swapping in event notificationsJeremy Huddleston1-1/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24Merge remote-tracking branch 'whot/for-keith'Keith Packard24-169/+265
2011-10-25kdrive: check for null memory, fix OOBPeter Hutterer1-1/+7
If key/value allocation failed, don't bother adding another InputOption. And make sure the memory allocated is large enough for the trailing \0 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-25Use new FP1616/FP3232 conversion functionsPeter Hutterer2-14/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-25test: fix test with new double -> fp3232 conversion functionsPeter Hutterer1-4/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-10-25Xi: send DeviceChangedEvents when the scroll valuators change valuePeter Hutterer1-1/+12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25dix: accept a NULL master for CreateClassesChangedEventPeter Hutterer1-1/+1
If a floating device changes, the master is NULL but we must still create a DCE for it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25Xi: ensure the deviceid for DeviceChangedEvents is always the right onePeter Hutterer1-0/+1
If we're sending the event for a given device, make sure the deviceid is that of the device. This allows callers to use the same DCE for slave and master without having to fiddle the DCE's internal fields. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25dix: pass the flags into the CreateClassesChangedEventPeter Hutterer2-5/+5
No effective functional changes, prep work for future patches. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25dix: drop unused argument from XISendDeviceChangedEventPeter Hutterer3-6/+5
Instead of device and master (and just using master), drop the master argument and let the callers pass in the device the event is to be sent for. No effective functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25dix: add ScrollInfo to DeviceChangedEventsPeter Hutterer4-0/+75
3304bbff9b4ed63f1a47410a5320a136420ba2c6 added smooth scrolling support for pointer events and for XIQueryDevice but didn't add the matching parts to XIDeviceChangedEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25xkb: Support noLock and noUnlock flags for LockModsAndreas Wettstein1-2/+5
These flags are required by the XKB spec section 6.3. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-25xfree86 doc: replace driver "keyboard" with "kbd"Peter Hutterer1-2/+2
We've deprecated keyboard a long time ago Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-25xfree86: use NewInputDeviceRequest for xorg.conf devices tooPeter Hutterer2-28/+9
Only use one init path for input devices - through NIDR. This requires that inp_driver and inp_identifier from the XF86ConfInputRec are copied over into the options for NIDR to see them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25dix: move #if statement to stop compiler warningPeter Hutterer1-2/+2
ptrveloc.c: In function 'QueryTrackers': ptrveloc.c:598:34: warning: variable 'used_offset' set but not used [-Wunused-but-set-variable] used_offset is used, but only in the debugging code. Move the #if statement to ignore that warning. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25xfree86: Fix a comment, the old function doesn't exist anymorePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25xfree86: use xf86AddNewOption instead of xf86addNewOptionPeter Hutterer1-4/+4
The former strdups for us. If the strdup fails we miss out on the CorePointer option (default on anyway) and we're likely to fall over soon anyway, so let's pretend this is the same behaviour. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>