summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2010-03-21Merge commit 'fa5103a02bd509e4a102afdad2ab26cb22210367'Keith Packard1-0/+3
2010-03-21dix: if owner-events is true for passive grabs, add the window mask (#25400)Peter Hutterer1-0/+36
A client requesting a GrabModeSync button grab, owner-events true, with only the ButtonRelease mask set would never receive the press event even if the grab window had the ButtonPress mask set. The protocol requires that if owner-events is true, then the delivery mask is the combination of the grab mask + the window event mask. X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Jim Ramsay <i.am@jimramsay.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-16Cygwin/X: Tidy up some cosmetic issues in log stringsJon TURNEY1-1/+1
Tidy up some cosmetic issues in log strings: - Add missing '\n' - Fix some strings starting with '\n' - Remove '\f' from some log strings These all just look daft in a log with timestamps. Also clarify log message about screen origin coordinates Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-03-16Add a ConfigNotify hook.Francisco Jerez1-0/+3
Executed from the ConfigureWindow request, right before sending ConfigureNotify to the clients. This commit breaks the ScreenRec ABI. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-03-12Record: Avoid duplicates from replaying frozen eventsDaniel Stone1-27/+1
Reintroduce a check which used to be there in the old ProcessKeyboardEvent/ProcessPointerEvent codepath, which avoids us recording events subject to a grab twice: once when it's first processed in EnqueueEvent, and then again when it's thawed and being replayed. This required a tiny amount of code motion to expose syncEvents. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-11Revert "dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)"Peter Hutterer1-1/+62
Several users have pointed out that this commit introduces regressions, most notably perhaps fluxbox which essentially stops working after a few clicks. This reverts commit cf72b5437d2d620521279077a29c5df6d0fbb576. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-10dix: Clip only into axis ranges if we're in absolute mode. (#26543)Peter Hutterer1-2/+3
An absolute device in relative mode may provide valuators outside of the axis range. Clipping back into the range prevents screen crossings in a multi-screen (Xinerama) setup as the required screen edge for crossing is never met: miPointerSetPosition crosses the screen conditional to the X coordinate being equal to the screen width or _less than_ 0. While the former can be met when clipping into the coordinate range and scaling, the latter cannot, resulting in a mouse pointer that gets stuck on the rightmost screen. This patch only applies axis clipping for valuators in mode Absolute. If relative, we allow the values to get above/below the axis ranges. Doesn't matter, miPointerSetPosition will reset the values to the allowed range even if no screen was crossed. This leads to interesting values provided to clients, the valuator range of the device resets once a screen is crossed and essentially reflects the position of the cursor on the screen - scaled into the valuator range. The values themselves are valid given the range though. In theory, the XI1 specs require that a relative device has a min/max range of 0/0. This doesn't really go well with devices that actually can switch mode between relative and absolute since they would have to reset their axis range when switching. If multiple XI clients are in use, we have no method of notifying them about the changes, so other clients may continue to use the wrong axis ranges (note: XI1 wasn't really designed to have multiple clients use a device). Expecting all relative devices to have this min/max of 0 is unrealistic at this point. So pick what is possibly the lesser of all evils, pass the beer and despair. X.Org Bug 26543 <http://bugs.freedesktop.org/show_bug.cgi?id=26543> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-03-03dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)Peter Hutterer1-62/+1
A client requesting a GrabModeSync button grab, owner-events true, with only the ButtonRelease mask set would never receive the press event even if the grab window had the ButtonPress mask set. The protocol requires that if owner-events is true, then the delivery mask is the combination of the grab mask + the window event mask. DeliverGrabbedEvents does this already for us, checking first the delivery based on owner_events and then based on the grab mask. AFAICT, the device cannot enter the states FREEZE_BOTH_NEXT_EVENT or FREEZE_NEXT_EVENT that would be handled by DGE in any possible path here. Bonus point - CheckPassiveGrabsOnWindows suddenly becomes a lot lesss complicated. X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-24Merge remote branch 'whot/for-keith'Keith Packard2-13/+0
2010-02-23dix: try to ring the bell even if the current device doesn't have one. (#24503)Peter Hutterer1-8/+0
Evdev devices do not have the bell proc set, but XTEST devices do. By exiting early, the bell only rings if the last keyboard used was the XTEST keyboard and hence the bell proc is still set on the master but not if an evdev keyboard was used last. The better approach here is to try to ring the bell on all devices attached to this master device in case one or more actually do produce an audible sound. That's also XKB's behaviour if XkbUseCoreKbd is specified as device identifier. X.Org Bug 24503 <http://bugs.freedesktop.org/show_bug.cgi?id=24503> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-02-23dix: remove now-erroneous comment about frozen slave devices.Peter Hutterer1-5/+0
A direct grab on a slave device through XI2 detaches it, regardless of whether the grab is sync or async. So this comment doesn't apply to XI2 anyway. For XI1, aside from your life being miserable already, it doesn't matter as XI1 does not have a concept of attachment. You can freeze a device and if you don't freeze _all_ other devices at the same time, the master device can still happily send events to the client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Adam Jackson <ajax@redhat.com>
2010-02-22Don't print a failure message when XACE denies an input event delivery.Eamon Walsh1-25/+25
A denial is normal and the behavior should be to drop the event. Having the log message creates excessive log spam. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22Revert "Remove some debug messages that trigger on XACE event delivery failure."Eamon Walsh1-3/+9
The log messages still need to be there for non-XACE failures. This reverts commit 4be354c4c2da5168b302601b91bd80cfaca7e193. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22Re-enable RECORD extension.Chris Dekter1-8/+7
RECORD was disabled during the switch to internal events. This patch modifies the record callback to work with internal events instead of xEvents. The InternalEvents are converted to core/Xi events as needed. Since record is a loadable extension, the EventTo* calls must be externed. Signed-off-by: Chris Dekter <cdekter@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-15dix: move config_init into the DDX.Peter Hutterer1-2/+1
The only DDX currently using hotplugging is the xfree86 one and it looks like it'll stay that way for a bit. Move the initialization to the DDX, since Xephyr, Xnest, and friends don't need HAL or udev notifications. Add CloseInput (counterpart to InitInput) to be able to clean up the config initialization from the DDX as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-02-12dix: restore lastDeviceEventTime update in dixSaveScreensJulien Cristau1-2/+7
This was removed in 6b5978dcf1f7ac3ecc2f22df06f7000f360e2066 (Do not reset lastDeviceEventTime when we do dixSaveScreens), but caused a regression for XResetScreenSaver. Add the lastDeviceEventTime update back, but restrict it to that case. X.Org bug#25855 <http://bugs.freedesktop.org/25855> Reported-by: Lubos Lunak <l.lunak@suse.cz> Tested-by: Lubos Lunak <l.lunak@suse.cz> Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-05main: move config_init() after InitInput()Julien Cristau1-1/+1
With the udev backend, config_init() calls NewInputDeviceRequest(), which enables devices. They can then start sending events, even though the event queue is only initialized later in InitInput(). Oops. Debian bug#564256 <http://bugs.debian.org/564256> Reported-by: Sedat Dilek <sedat.dilek@googlemail.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-02Allow driver to call DeleteInputDeviceRequest during UnInitOldřich Jedlička1-11/+33
When the input driver (like xf86-input-wacom) removes it's devices during a call to UnInit, the CloseDownDevices() cannot handle it. The "next" variable can become a pointer to freed memory. The patch introduces order-independent device freeing mechanism by remembering the already freed device ids. The devices can reorder any time during freeing. No device will be double-freed - if the removing failed for any reason; some implementations of DeleteInputDeviceRequest don't free the devices already. Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-01Fix typo in updateSlaveDeviceCoordsOldřich Jedlička1-1/+1
The index [0] for the second valuator looks bogus; fix it. Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-01-27dix/configure: remove null root cursor optionTiago Vignatti1-17/+0
The default behavior of the server is to start with an invisible root cursor. Be such cursor invisible or inexistent (null), in the end it doesn't matter - for the user. The content on screen will be the same. Besides, there's no difference, in terms of performance, whether such cursor is invisible or simply null. The paths that both take inside the server are roughly the same. Therefore create a null root cursor becomes irrelevant. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27dix: EventToCore needs to copy the root window too.Peter Hutterer1-0/+1
This value isn't actually set for normal events but it saves us some work for the record extension support. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27Revert "dix: EventToCore needs to copy the root window too."Keith Packard1-1/+0
This reverts commit 0f2d297dedeff8bd227df4c498cc668b0e902344. Peter provided an updated patch which fixes the tests.
2010-01-25dix: move cursor realize code to its own functionTiago Vignatti1-118/+85
The semantic remains, only code was moved: reuse chunk of code to realize cursor on both AllocARGBCursor and AllocGlyphCursor. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-25dix: EventToCore needs to copy the root window too.Peter Hutterer1-0/+1
This value isn't actually set for normal events but it saves us some work for the record extension support. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-05dix: don't update the slave coordinates from the VCK.Peter Hutterer1-2/+5
A keyboard event from a device with both valuators and keys will be posted through the VCK. In this case, do not update the slave device coordinates from the VCK - they're always 0/0. Leave them as-is, for the next pointer event will continue where it left. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-04CloseDevice: call XkbRemoveResourceClient before freeing key class structAlan Coopersmith1-3/+3
XkbRemoveResourceClient() returns immediately if dev->key is NULL. CloseDevice calls XkbRemoveResourceClient until it removes all resources. If we free dev->key and NULL it before XkbRemoveResourceClient, then infinite loop ensues, and the server appears to hang on exit or crash. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-01dix: add smooth limited pointer acceleration profileSimon Thum1-1/+27
This profile is inspired by the accel code removed from the wacom driver. It ascends from zero to acceleration, maxing out at threshold. This means you can control the slope using threshold, which wasn't possible in wacom. For sanity's sake, threshold should grow with acceleration. Works best with adaptive deceleration, since otherwise it only generates acceleration above 1, causing seldom pixel skips. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith1-2/+6
Convert all calls of CreateNewResourceType to pass name argument Breaks DIX ABI. ABI versions bumped: Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-16Merge remote branch 'alanc/master'Keith Packard5-122/+88
2009-12-16Update Sun license notices to current X.Org standard formAlan Coopersmith5-122/+88
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-15dtrace: Add Xserver-dtrace.h to CLEANFILESJeremy Huddleston1-1/+1
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-12-11Merge remote branch 'jeremyhu/master'Keith Packard1-0/+2
2009-12-11Move config_init() after CreateWellKnownSockets() and InitCoreDevices()Julien Cristau1-1/+1
config_init() can now add devices directly instead of scheduling a timer. 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>
2009-12-08Miscellaneous compilation warning fixesJeremy Huddleston1-0/+2
main.c:134: warning: no previous prototype for 'dix_main' rootlessScreen.c: In function 'RootlessMarkOverlappedWindows': rootlessScreen.c:434: warning: function declaration isn't a prototype backtrace.c:51: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int' backtrace.c:54: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int' set.c: In function 'RecordSetMemoryRequirements': set.c:413: warning: old-style function definition set.c: In function 'RecordCreateSet': set.c:425: warning: old-style function definition stub.c: In function ‘main’: stub.c:236: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-12-03dix: remove core devices when shutting down. (#25028)Peter Hutterer1-0/+3
NewInputDeviceRequest (and RemoveDevice) have checks in place to not allow removal of the VCP/VCK. When shutting down, they need to be cleaned up nonetheless to free the memory associated. X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-03dix: remove some obsolete comment.Peter Hutterer1-1/+0
The "counterpart to biggest hack" included checking for the motion history function - which is unified in 1.7. Hence the check (which is already removed) would evaluate to true anyway, and this comment isn't needed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-03dix: fix memory leak, free event list on shutdown. (#25028)Peter Hutterer1-6/+3
X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-11-25dix: clean up accel old scheme data when switching schemes.Peter Hutterer2-12/+54
InitValuatorClassDeviceStruct always initializes with the default profile. The default profile allocs data and adds a few properties which become obsolete if the profile is changed lateron by the driver. The property handlers are stored in the device's devPrivates and cleaned up. Ideally, the property handler ID's could be stored somewhere more obvious, but that seems to require breaking the ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Simon Thum <simon.thum@gmx.de>
2009-11-11.gitignore: use common defaults with custom section #24239Gaetan Nadon1-0/+3
Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults. Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-10dix: increase default number of buttons to 10.Peter Hutterer1-1/+1
Currently the XTEST device is limited to the same number of buttons the core device has. This breaks if a user has a mouse with more than 3 buttons connected and is using a core client to fake button 8+ presses. Rather than expecting all clients to fix themselves, just increase the default number of buttons to 10, which is somewhat a compromise. Ideally, the XTEST devices should adjust themselves to the highest number of buttons available on the slave devices (like the master pointers already do), but that's a taks for another day. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-04Merge remote branch 'jeremyhu/master'Keith Packard1-5/+3
2009-11-04dix: Fixes a memory leak when a cursor resource is released.Rami Ylimaki1-1/+2
Just open and close a client that creates cursors in order to reproduce. In the problem case bits->refcnt is -1 and therefore bits->devPrivates is never released. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-03dix: Properly detect if the other device is frozenJeremy Huddleston1-5/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-10-23dix: Fix up colormap fixup.Adam Jackson1-0/+3
FindClientResourcesByType() will walk all colormaps on all screens; we only want to fix up the current screen. Otherwise, screens > 0 will have the visual pointers for their colormaps pointing off into space. Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-22Resolve an inconsistency between libX11 and Xserver over GetModifierMappingJon TURNEY1-5/+3
libX11 ModMap.c believes that GetModifierMapping can never return an error Xserver devices.c believes that GetModifierMapping can return an error if the ModMap couldn't be generated According to the protocol document I have, libX11 is right, so adjust the server to send back an empty modmap if one couldn't be made... http://bugs.freedesktop.org/show_bug.cgi?id=24621 Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-15Remove CopyISOLatin1LoweredYaakov Selkowitz1-10/+0
This function was moved verbatim into libXfont-1.4, and it is not used by the server or any drivers. Exporting it in both places leads to multiple definition linking errors on Cygwin, where we need to use a static libXfont due to poor weak-symbol handling. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-14Remove some debug messages that trigger on XACE event delivery failure.Eamon Walsh1-9/+3
It is normal for XACE to deny an event delivery, so these log messages shouldn't trigger when that happens. Just drop them for now. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14xace: Fake return values on denials in input polling requests.Eamon Walsh2-2/+14
Instead of returning BadAccess when "read" permission is denied on a device, falsify the device state (buttons down, keys pressed). This is nicer to applications, but may still have undesired side effects. The long-term solution is not to use these requests in event-driven code! Requests affected: QueryPointer, QueryKeymap, XiQueryDevice. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-13dix: extend IsPointerDevice check to valuator-only devices.Peter Hutterer1-1/+3
A device with valuators but no keys is definitely a pointer device and needs to be attached to the VCP. Otherwise, the class copying happens on the VCK and the VCP isn't updated with the events that are to be sent through it. This addresses the trigger for #24441, not the actual issue. Jury is still out on valuator+key devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-08Fix make warning: overriding commands for target `dix.O'Alan Coopersmith1-1/+2
Not only does automake generate unnecessary rules for dix.O on platforms for which SPECIAL_DTRACE_OBJECTS is false, it generates duplicate sets when "if SPECIAL_DTRACE_OBJECTS" is nested inside "if XSERVER_DTRACE" Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>