summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-10-22dix: only deliver for the current grab typePeter Hutterer1-11/+2
Use the grabtype to determine which type of event to send - all other events are pointless and may result in erroneous events being delivered. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 7cf1b595c8c8f9776a39559d2878cf90af3f2859)
2013-10-22dix: don't attempt to deliver an event for a different grabtypePeter Hutterer1-0/+3
For an active grab, grab->eventMask can be either the core or the XI1 mask. With the overlap of event filters, calling DeliverOneGrabbedEvent(XI1) for a ProximityOut event will trigger if the client has selected for enter events - the filter is the same for both. Thus, we end up delivering a proximity event to a client not expecting one. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 78944d62ffc7fec6f75b6f514ab7a139ba9bc77b)
2013-10-22include: change grabtypes to start at 1Peter Hutterer1-3/+3
Avoid erroneous detection of an unset grabtype as CORE Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 6159811a1aaf848016dbfa7bde68df097027870c)
2013-10-22dix: only allow button and key events to freeze a sync'd pointerPeter Hutterer1-1/+5
If a client calls XAllowEvents(SyncPointer) it expects events as normal until the next button press or release event - that freezes the device. An e.g. proximity event must thus not freeze the pointer. As per the spec, only button and key events may do so, so narrow it to these cases. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit be6ea80b79b3d6eb97106ea142e01acbdf059995)
2013-10-22DIX/Xi: Pass correct client to CheckDeviceGrabAndHintWindow()Egbert Eich1-7/+16
If we have a client which has registered for a DeviceButton grab be sure to pass this to CheckDeviceGrabAndHintWindow(). Since the order of clients is arbitrary there is no guarantee that the last client in the list is the one that belongs to this class. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 05ea6307fa4f0bee3d3bf536396059f3906791a0)
2013-10-22Xi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554)Peter Hutterer1-1/+1
XIAllowEvents changed length in XI 2.2 (for the touchid). A bug in libXi causes libXi to always use the new request length if the server supports 2.2, regardless of the client's XIQueryVersion request. The server takes the client's XIQueryVersion request into account though, resulting in a BadLength error if a 2.[0,1] client calls XIAllowEvents on a XI 2.2+ server. Can't fix this in libXi, so work around this in the server. X.Org Bug 68554 <http://bugs.freedesktop.org/show_bug.cgi?id=68554> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 94d4e29aedc69431fa9b299ca1b67947173d7a24)
2013-10-22dix: check for grab type before checking XI2 maskPeter Hutterer1-1/+1
if the grab type isn't XI2, grab->xi2mask is random. That random data may have the enter/leave mask set, leading to events sent to the client that the client can't handler. Source of these errors: _xgeWireToEvent: Unknown extension 131, this should never happen. Simplest reproducer: Start Xephyr, press button inside window, move out. As the pointer leaves the Xephyr window, the errors appear. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 82939e02392cbb880313fe92957091ff89ce2f2b)
2013-10-22test: fix the gcc diagnostics pragmaPeter Hutterer1-1/+2
pop without push restores the commandline options. The proper way is to push, then ignore, then pop. And while we're at it, change the pop argument to a comment - pop ignores the argument, but be proper about it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit d803f296c616ccf55711cf0af9e7d3eae2edda16)
2013-10-21Merge commit 'a1985e892f5b5f0959235a631d8bcf676b78bfbc' into server-1.14-branchMatt Dew5-2/+11
2013-10-21Allow disabling XFree86-DGA, DRI, VidModeExtension extensionsAlan Coopersmith1-1/+1
Code to recognize these in extension enable/disable options was wrapped in #ifdef XorgLoader, but that's not defined when building miinitext.c since the great module merge of 1.13. Change to an #ifdef that is defined. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Robert Hooker <robert.hooker@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-21Avoid use-after-free in dix/dixfonts.c: doImageText() [CVE-2013-4396]Alan Coopersmith1-0/+5
Save a pointer to the passed in closure structure before copying it and overwriting the *c pointer to point to our copy instead of the original. If we hit an error, once we free(c), reset c to point to the original structure before jumping to the cleanup code that references *c. Since one of the errors being checked for is whether the server was able to malloc(c->nChars * itemSize), the client can potentially pass a number of characters chosen to cause the malloc to fail and the error path to be taken, resulting in the read from freed memory. Since the memory is accessed almost immediately afterwards, and the X server is mostly single threaded, the odds of the free memory having invalid contents are low with most malloc implementations when not using memory debugging features, but some allocators will definitely overwrite the memory there, leading to a likely crash. Reported-by: Pedro Ribeiro <pedrib@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-10-02Merge branch 'cygwin-patches-for-1.14' into cygwin-release-1.14xserver-cygwin-1.14.3-2Jon TURNEY13-144/+303
2013-10-02Add controls for monitoring PRIMARY selectionJon TURNEY10-3/+70
xwinclip: Add -noprimary option Xwin: Add -primary and -noprimary options and tray-menu control
2013-10-02Retrieve TARGETS to avoid unnecessary failing conversion attemptsJon TURNEY4-86/+194
See http://cygwin.com/ml/cygwin-xfree/2013-07/msg00016.html It looks like the change in a9aca218f557c723e637287272819a7c17174e1e had some unforseen consequences. If the X11 selection contents are not convertable to COMPOUND_TEXT, UTF8_STRING or STRING format (for example, if it is an image), after those conversion attempts have failed, we sit in winProcessXEventsTimeout() until the timeout expires. It also seems that maybe gnuplot doesn't respond correctly to this sequence of conversion requests and doesn't reply to some of them, which also causes us to sit in winProcessXEventsTimeout() until the timeout expires. The Windows application which has requested the clipboard contents via GetClipboardContents() is blocked until we return from WM_RENDERFORMAT, so sitting waiting for this timeout to expire should be avoided. Also: if there is no owned selection, there is nothing to paste, so don't bother trying to convert it.
2013-09-24In SelectionNotify, don't pointlessly retrieve just the size of the propertyJon TURNEY1-18/+2
Don't pointlessly retrieve just the size of the property, if we are then going to assume we can retrieve the whole property in one request anyhow...
2013-09-24In SelectionNotify, delete the property containing returned data after we ↵Jon TURNEY1-2/+2
have retrieved it
2013-09-24Improve clipboard debug outputJon TURNEY1-8/+13
2013-09-24Remove duplicate declaration of winClipboardWindowDestroy()Jon TURNEY1-3/+0
internal.h:69:1: warning: redundant redeclaration of 'winClipboardWindowDestroy' [-Wredundant-decls] winclipboard.h:34:6: note: previous declaration of 'winClipboardWindowDestroy' was here
2013-09-24Revert "Move property retrieval to PropertyNotify, so we can be sure it has ↵Jon TURNEY1-18/+15
been set" This reverts commit 7c6f940cd8b8722397ddc232f0a85c5855802abc. Conflicts: hw/xwin/winclipboard/xevents.c
2013-09-24Revert "Fix SelectionNotify -> PropertyNotify in relocated code"Jon TURNEY1-14/+15
This reverts commit d2355e8571c1dfdfba32a7abd223249678b4d8f5.
2013-09-24Merge branch 'clipboard-64bit-fix' into cygwin-patches-for-1.14Jon TURNEY26-703/+859
2013-09-16Merge branch 'cygwin-patches-for-1.14' into cygwin-release-1.14xserver-cygwin-1.14.3-1Jon TURNEY12-344/+384
2013-09-16Merge tag 'xorg-server-1.14.3' into cygwin-release-1.14Jon TURNEY32-256/+430
xorg-server-1.14.3 Conflicts: dix/main.c
2013-09-15dix: add missing include for DeleteWindowFromAnySelectionsJulien Cristau1-0/+1
Fixes build error with XACE disabled: window.c:886:5: error: implicit declaration of function 'DeleteWindowFromAnySelections' [-Werror=implicit-function-declaration] DeleteWindowFromAnySelections(pWin); ^ Debian bug#701372 Reported-by: Matthias Klose <doko@debian.org> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit fe7463b8ce0de301c2f82b108c93963424f77219)
2013-09-15xfree86: improve check for posix saved idsJulien Cristau3-2/+6
Replace hardcoded SVR4 || linux || CSRG_BASED with an autoconf check and the _POSIX_SAVED_IDS macro. Suggested-by: Mark Kettenis <mark.kettenis@xs4all.nl> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit c218ba8423a73a7a643cb17789db8a1dd0901ca6)
2013-09-15test: include dix-config.h in hashtabletest.cJulien Cristau1-0/+4
Missing _XSERVER64 define caused inconsistent sizeof(XID) between the test and hashtable code, leading to test failures on 64bit big endian archs like s390x or ppc64. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 930c6ff15d437dfb0f897e8cb4253abba70819cc)
2013-09-12bump version from 1.14.2.902 to 1.14.3xorg-server-1.14.3Matt Dew1-3/+3
2013-09-11hw/xwin: Update WGL wrapper function generation scriptMarc Haesen3-304/+338
Update WGL wrapper function generation script to use Khronos group XML Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-11hw/xwin: Fix WM_ENDSESSION crash on x86_64Jon TURNEY2-0/+8
We need to include xwin-config.h into winmsgwindow.c, so that _XSERVER64 is defined, so that the layout of ScreenRec type is correct, so that it's privates can be accessed correctly, so that the WM_GIVEUP message can be sent to the screen window. Also add xwin-config.h to other source files which are missing it, to avoid this kind of problem in future... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-11hw/xwin: Allow gtk_window_maximize() to maximize window in multiwindow modeJon TURNEY1-1/+13
gtk_window_maximize() maximimizes a window by setting _NET_WM_STATE to contain both _NET_WM_STATE_MAXIMIZED_VERT and _NET_WM_STATE_MAXIMIZED_HORZ. Add checking for that state in multiwindow mode hint conversion and maximimize window when it is found. Don't try to implement the separately horizontal and vertical maximimized states for now. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-11hw/xwin: Correct winprefs.c function signatures for x64.Colin Harrison4-25/+13
Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and HandleCustomWM_COMMAND() function signatures which use unsigned long parameters, where just a specific HWND or HMENU handle type should have been used. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-11hw/xwin: Remove unnecessary and incorrect HWND castsMarc Haesen2-5/+3
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-11hw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64Marc Haesen1-7/+7
Use the correct size of a HWND on x86_64 in ChangeProperty() and XGetWindowProperty() calls for the _WINDOWSWM_NATIVE_HWND property. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-11hw/xwin: Display host architecture triplet in 'About...' dialogJon TURNEY2-2/+2
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-09kdrive: fix build error on gcc 4.8 for out-of-bounds array accessChris Clayton1-1/+1
I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot of gcc-4.8: input.c:225:43: error: array subscript is above array bounds [-Werror=array-bounds] This is because kdNumInputFds can become equal to KD_MAX_INPUT_FDS in KdRegisterFd(). This means that in KdUnregisterFd(), kdInputFds[j + 1] can be beyond the end of the array. Signed-off-by: Chris Clayton <chris2553@googlemail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-22bump rev number from 1.14.2.901 to 1.14.2.902xorg-server-1.14.2.902Matt Dew1-3/+3
2013-08-13test/xi2: fix protocol-xiqueryversion testMaarten Lankhorst1-30/+30
The old code was broken and allowed setting client version >= XIVersion, this was fixed in the previous patch, but updating the value for XIVersion broke the tests, so fix the tests too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit b6e5c4669e0db391966deb397e8c975ec7f0124d)
2013-08-13Xi: Clamp XIClient maximal version to XIVersionMaarten Lankhorst1-17/+14
Do not allow setting client version to an arbitrary value >= XIVersion. Fixes a test error with test/xi2/protocol-xiqueryversion.c, introduced by commit 4360514d1c "Xi: Allow clients to ask for 2.3 and then 2.2 without failing" Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 500e844a24962c9e70abb3d614f1973013b2de73)
2013-08-13Revert "test: fix XIQueryVersion check for new behaviour"Peter Hutterer1-9/+3
This reverts commit cdcb708678c4785cd7b026b90e316691176e5244.
2013-08-02Merge branch 'cygwin-patches-for-1.14' into cygwin-release-1.14xserver-cygwin-1.14.2-2Jon TURNEY4-88/+70
2013-08-02Fix ARGB cursor conversion on x86_64Jon TURNEY1-6/+5
Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which leads to ARGB cursors being horizontally streched by a factor of two on x86_64.
2013-08-02Undefine _XSERVER64 in multiwindow WMJon TURNEY3-82/+65
Undefine _XSERVER64 in multiwindow WM, so client code can build correctly on x86_64. Move winUpdateWindowPosition() to winmultwindowproc.c, as it needs to access the server Drawable structure correctly, which uses affected types. This supersedes "Bodge around issues with XSendEvent()" needed to get the WM_KILL message ClientMessage sent correctly (We still play a dangerous game with bringing the WindowPtr type into scope so we can use it in window shaping code to access the server's shape data. This would be better rewritten as client code using ShapeNotify and XShapeGetRectangles())
2013-07-30test: fix XIQueryVersion check for new behaviourPeter Hutterer1-3/+9
As of 4360514d1cc8e3132f93f56172d291074e8c770f, XIQueryVersion supports requesting versions 2.2+ in random order, only 2.0 and 2.1 are restricted. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit a5abf790183798ad8aa2c29c056df3647777cfbd)
2013-07-30Xi: Allow clients to ask for 2.3 and then 2.2 without failingKeith Packard1-6/+30
This allows different sub-systems within the same application to request different Xi versions without either getting old behaviour everywhere or simply failing with a BadValue. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 4360514d1cc8e3132f93f56172d291074e8c770f)
2013-07-30dix: set the valuator mask to ensure XI 1.x events have dataPeter Hutterer1-1/+1
XI 1.x only allows for first + num valuators, so if a device sends data for valuators 0 and 2+ only (i.e. valuator 1 is missing) we still need to get the data for that from somewhere. XI 1.x uses the hack of an unset valuator mask to get the right coordinates, i.e. we set the value but don't set the mask for it so XI2 events have the right mask. For an absolute device in relative mode, this broke in b28a1af55cf, the value was now always 0. This wasn't visible on the cursor, only in an XI 1.x client. The GIMP e.g. sees jumps to x/0 every few events. Drop the condition introduced in b28a1af55cf, data in valuators is always absolute, regardless of the mode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 3d8756631070c440cefa31b35fea3d407f187810)
2013-07-30dix: check the xi2mask, not the grab type for touch listenersPeter Hutterer2-3/+2
grab->type is only non-zero for passive grabs. We're checking an active grab here, so we need to check if the touch mask is set on the grab. Test case: grab the device, then start two simultaneous touches. The grabbing client won't see the second touchpoints because grab->type is 0 and the second touch is not an emulating pointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 4fb686d6a6777950f0e0d55b848cd2af4cbad372)
2013-07-25Merge branch 'server-1.14-touch-fixes' of ↵xorg-server-1.14.2.901Matt Dew21-190/+316
git://people.freedesktop.org/~whot/xserver into server-1.14-branch
2013-07-25Bah, bad rev number. Fixed: changed 1.14.3-rc1 to 1.14.2.901Matt Dew1-1/+1
2013-07-25bump rev from 1.14.2 to 1.14.3-rc1Matt Dew1-3/+3
2013-07-17Xi: return !Success from DeliverTouchEmulatedEvent if we didn't deliverPeter Hutterer1-2/+2
All callers currently ignore the new value, so this patch has no effect. Inverse call graph: DeliverTouchEmulatedEvent DeliverEmulatedMotionEvent Ignores value DeliverTouchBeginEvent DeliverTouchEvent DeliverTouchEvents Ignores value DeliverTouchEndEvent DeliverTouchEvent DeliverTouchEvents Ignores value Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 9978b57b8d94f061d72a67b99a02b0ba16a11429)