summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2009-06-29dix: ensure Activate/DeactivateGrab has a valid value.Peter Hutterer1-0/+2
Xephyr doesn't manually set Activate/DeactivateGrab for new devices, resulting in a NULL-pointer dereference later when a grab is activated. Avoid the segfault by ensuring that the pointer is always valid. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 6f9e22049862ee9ac7f604411d005d8bb1b2dd1c) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-29Fix a couple off-by-one array boundary checks.Jeremy Huddleston1-1/+1
Error: Write outside array bounds at Xext/geext.c:406 in function 'GEWindowSetMask' [Symbolic analysis] In array dereference of cli->nextSib[extension] with index 'extension' Array size is 128 elements (of 4 bytes each), index <= 128 Error: Buffer overflow at dix/events.c:592 in function 'SetMaskForEvent' [Symbolic analysis] In array dereference of filters[deviceid] with index 'deviceid' Array size is 20 elements (of 512 bytes each), index >= 0 and index <= 20 Error: Read buffer overflow at hw/xfree86/loader/loader.c:226 in function 'LoaderOpen' [Symbolic analysis] In array dereference of refCount[new_handle] with index 'new_handle' Array size is 256 elements (of 4 bytes each), index >= 1 and index <= 256 These bugs were found using the Parfait source code analysis tool. For more information see http://research.sun.com/projects/parfait Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit b680bda34da130ce408783f04214771471e41e8d) (cherry picked from commit 04c9e80f083659e63cffec8969fb3a0cfc551a97) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-19xace: Fix a bad device access hook call.Eamon Walsh1-3/+3
Add a proper access mode, and reverse the logic of the return value. Zero ("Success") is returned on success from the hook calls. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> (cherry picked from commit 3cea176d5abcb0f14eefbdcbe17fed0847524dd4)
2009-05-08dix: fix calculation of number of fake KeyRelease eventsPierre Ossman1-5/+9
Signed-off-by: Pierre Ossman <pierre@ossman.eu> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-08dix: ignore non-pointer events in XineramaCheckMotion (#20557)Peter Hutterer1-0/+17
Note that deviceKeyButtonPointer and keyButtonPointer have the same wire layout, so we only need to check for event types. X.Org Bug 20557 <http://bugs.freedesktop.org/show_bug.cgi?id=20557> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-08Add RandR 1.3 requests to protocol.txtJulien Cristau1-0/+7
(cherry picked from commit 4f86ee61a4abf7a29e565d095aa08abd0ca9dc66) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-08Add XI 1.5 event and requests to protocol.txtJulien Cristau1-0/+5
(cherry picked from commit 063833f3a6d9f8f657e3de309c8d6d5c3d606513) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-17Default to use standard bitmap fonts, with builtins as fallbackPaulo Cesar Pereira de Andrade1-3/+0
The builtin-fonts configure option was removed, as it at best should have been a runtime option. Instead, now it always register all "font path element" backends, and adds built-ins fonts at the end of the default font path. This should be a more reasonable solution, to "correct" the most common Xorg FAQ (could not open default font 'fixed'), and also don't break by default applications that use only the standard/historical X Font rendering. (cherry picked from commit 49b93df8a3002db7196aa3fc1fd8dca1c12a55d6) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30Don't release grabs unless all buttons are upThomas Jaeger1-1/+1
Previously, only buttons <= 5 would count here, but the core protocol allows for 255 buttons. http://lists.freedesktop.org/archives/xorg/2009-January/042092.html Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 717a961528ec69a6e630d536e15568670e0b398a) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30Don't alter device button maps in DoSetPointerMappingThomas Jaeger1-23/+9
Currently, if a device map differs from the core pointer map, then the request may return MappingBusy, even though all the affected core buttons are in the up state. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 3d549438c29004d78032ecc50ab45ca0e3f49623)
2009-01-30Xi: fix use of button->down - bitflags instead of int arrays.Peter Hutterer1-1/+1
The device's button down state array was changed to use DOWN_LENGTH and thus bitflags for each button in cfcb3da7. Update the DBSN events to copy this bit-wise state. Update xkb and Xi to check for the bit flag instead of the array value. Reported by ajax. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> (cherry picked from commit a85f0d6b98237d8a196de624207acf1983a1859a)
2009-01-30dix: fix WarpPointer calls for devices with custom valuator ranges (#19297)Peter Hutterer2-8/+25
If the MD's lastSlave was a devices with custom axes ranges, then a WarpPointer would position the cursor at the wrong location. A WarpPointer request provides screen coordinates and these coordinates were scaled to the device range before warping. This patch consists of two parts: 1) in the WarpPointer handling, get the lastSlave and post the event through this device. 2) assume that WarpPointer coordinates are always in screen coordinates and scale them to device coordinates in GPE before continuing. Note that this breaks device-coordinate based XWarpDevicePointer calls (for which the spec isn't nailed down yet anyway) until a better solution is found. X.Org Bug 19297 <http://bugs.freedesktop.org/show_bug.cgi?id=19297> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit d36adf52a2b2711d22b11105f7bd907d4493fb9b)
2009-01-30dix: EnqueueEvent and PlayReleasedEvent need to handle DeviceMotionNotifiesPeter Hutterer1-4/+4
No MotionNotify events in the processing anymore, so let's have them treat DMN instead. Reported by Thomas Jaeger. (cherry picked from commit 488d45295105daf10ccd17ca93ae6a6f4d0104f1)
2009-01-30XQuartz: mieq: Wait for the server to finish initializing before letting ↵Jeremy Huddleston1-0/+14
other threads mieqEnqueue Avoid possible race condition whereby one thread might call mieqEnqueue before InitAndStartDevices finishes (cherry picked from commit 94e417ac87a98cd5c6bf2d7c495d702748398931)
2009-01-12dix: drop x/y back into last.valuators before updating the history (#19285)Peter Hutterer1-3/+3
positionSprite needs to scale to screen coordinates and in the process of doing so alters dev->last.valuators[0:1]. Drop the real coordinates back after finishing and before updating the motion history. This way, we don't push the screen coordinates into the motion history. X.Org Bug 19285 <http://bugs.freedesktop.org/show_bug.cgi?id=19285> (cherry picked from commit 56efbc0986e782da45addb05ece9f456d41d7a90)
2009-01-11dix: Fix handling of do_not_propagate_mask window attribute.Peter Hutterer1-11/+8
This was broken in 32aa252e988be8cbfd4f7e373fb7b7736ef1f5f2. Signed-off-by: Kim Woelders <kim@woelders.dk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 30d2cfcd3851870178d62e5067211aa36f87fbd2) Conflicts: dix/events.c Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-11Let the DDX decide on the XkbRulesDefaults.Peter Hutterer1-1/+0
Rather than assuming rules in the CoreKeyboardProc, init the default rules in InitCoreDevices, then re-use them later. In the xfree86 DDX, set the rules to "base" or "evdev", depending on whether we'll load kbd or evdev. If we create a new MD, use pc105,us as default and re-use the rules file used previously. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-11dix: move focus handling into enterleave.c.Keith Packard4-274/+837
This commit moves the focus handling from events.c into enterleave.c and implements a model similar to the core enter/leave model. For a full description of the model, see: http://lists.freedesktop.org/archives/xorg/2008-December/041740.html This commit also gets rid of the focusinout array in the WindowRec, ditching it in favour of a local array that keeps the current focus window for each device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit eb2d7b3d700952ba88c77deacf687b251300e660) Conflicts: dix/events.c include/input.h Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-09dix: add a few auxiliary functions for the updated focus model.Peter Hutterer1-0/+54
SetFocusIn and SetFocusOut, including the static array to keep all focus windows. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 673eb23aac578dcdc04e2a99d1fa5c2987eb58b8)
2009-01-09dix: reduce FirstPointerChild complexityPeter Hutterer2-55/+10
Instead of keeping a flag on each window for the devices that are in this window, keep a local array that holds the current pointer window for each device. Benefit: searching for the first descendant of a pointer is a simple run through the array. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 38b28dcadd0990cb43f50db4300eebb8f044db96)
2009-01-09dix: remove now unused "exclude" parameter from FirstPointerChildPeter Hutterer1-15/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 72ad4a85cc0ffe60a90011d65ef718d5852beae4)
2009-01-09dix: re-implement enter/leave model.Keith Packard1-269/+351
The old model was implemented based on a misunderstanding of NotifyVirtual and NotifyNonlinearVirtual events. It became complicated and was broken in some places [1]. This patch wipes this model completely. A much simplified implementation is provided instead. Rather than a top-down approach ("we have a tree of windows, which ones need to get which event") this one uses a step-by-step approach. For each window W between A and B determine the pointer window P as perceived by this window and determine the event type based on this information. This is in-line with the model described by Owen Taylor [2]. [1] http://lists.freedesktop.org/archives/xorg/2008-December/041559.html [2] http://lists.freedesktop.org/archives/xorg/2008-August/037606.html (cherry picked from commit 0aa4460c3b4f9bb17d5412d76fa8c4c501132429) Conflicts: dix/enterleave.c
2009-01-09xfree86: If an input device failed to activate, return immediately.Peter Hutterer1-0/+2
Devices are only activated once - right after they've been added to the server. If a device failes activation, it's dead. There's no reason to continue. Return the error code from ActivateDevice() without setting up sprite information or even sending a event to the client. Then - in the DDX - just remove the device again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 27011254c4de4e573a0851bf46892fb488db6522)
2009-01-09dix: move MAX_VALUATOR_EVENTS into include/input.hPeter Hutterer1-4/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 0b4fef6337d88ae8ef05b8b73941350a9007565c)
2008-12-09dix: fix calculation of valuator events.Peter Hutterer1-3/+3
Follow-up to 4971315296cb. countValuatorEvents was copied from GKVE where it was obviously broken but nobody noticed. GPE had the correct version, but that one got lost during de-duplication. Restoring the correct calculation - if we have 6 valuators, we want 1 valuator event, not 2. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> (cherry picked from commit ee1a6c28418a6dad6c89f79a994f27bfbaa77368) Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-01dix: don't detach SDs during grabs.Peter Hutterer1-67/+0
2008-12-01dix: Don't deliver XI events from MDs.Peter Hutterer1-42/+20
Restore the XI 1.x event model: VCP/VCK deliver core events only, SDs device events only. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01input: don't switch MDs' classes around between SDs.Peter Hutterer2-64/+0
Server 1.6 uses the X Input 1.x input model, where the core devices (VCP and VCK) do not generate XI events. They don't have to swap device classes but instead stay at the default number of classes at all times. This means we can get rid of the DeviceClassesChangedEvents as well.
2008-12-01dix: No DeviceEnterLeave events in server 1.6Peter Hutterer2-109/+0
2008-11-26dix: Enable core devices in InitCoreDevices already.Peter Hutterer2-19/+7
Updated patch, see http://lists.freedesktop.org/archives/xorg/2008-November/040540.html Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-26Revert "dix: Enable core devices in InitCoreDevices already."Peter Hutterer2-9/+23
I merged the wrong patch. See correct patch at: http://lists.freedesktop.org/archives/xorg/2008-November/040540.html Not activating the device before attempting to enable it would leave the sprite unset, crashing the server when enabling the real devices. This reverts commit e078901a4eca02bd3e7a80d9462dafbca939a187. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25Do not send VisibilityNotify events when MapUnmapEvents are disabledMichael Vogt1-0/+2
This prevents a protocol visible side-effect (XVisibilityEvent) on XCompositeRedirectWindow() followed by a XCompositeUnredirectWindow(). The problem shows up in gnome-screensaver with compiz and "unredirect fullscreen windows" enable. A VisibilityNotify event is generated (first with obscured and than with unobscured) when the window swithces from redirected to unredirected. https://bugs.freedesktop.org/show_bug.cgi?id=18133 http://launchpad.net/bugs/278112
2008-11-25dix: updated enter/leave core event model.Peter Hutterer3-2/+274
As proposed by Owen Taylor [1], the enter-leave event model needs to adjust the events sent to each window depending on the presence of pointers in a window, or in a subwindow. The new model can be summarised as: - if the pointer moves into or out of a window that has a pointer in a child window, the events are modified to appear as if the pointer was moved out of or into this child window. - if the pointer moves into or out of a window that has a pointer in a parent window, the events are modified to appear as if the pointer was moved out of or into this parent window. Note that this model requires CoreEnterLeaveEvent and DeviceEnterLeaveEvent to be split and treated separately. [1] http://lists.freedesktop.org/archives/xorg/2008-August/037606.html Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25dix: add FirstPointerChild, FirstPointerAncestor auxiliary functions.Peter Hutterer1-0/+100
FirstPointerChild: Return the first child that has a pointer within its boundaries. FirstPointerAncestor: return the first ancestor with a child within its boundaries. These are required for the updated enter/leave model. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25dix: Add EnterWindow, LeaveWindow, HasPointer auxiliary functions.Peter Hutterer1-0/+50
These replace the ENTER_LEAVE_SEMAPHORE_* macros. Unused currently. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25dix: split enter/leave event handling into core and device handling.Peter Hutterer3-123/+125
Device events always need to be delivered, core events only in some cases. Let's keep them completely separate so we can adjust core event delivery. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25dix: remove unused EnterLeaveSemaphoresIsset.Peter Hutterer1-15/+0
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25dix: move Enter-Leave related functions into new enterleave.cPeter Hutterer4-113/+196
Preparation for the new core enter/leave model. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-24dix: Enable core devices in InitCoreDevices already.Peter Hutterer2-23/+9
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-24dix: fix false comment.Peter Hutterer1-2/+0
VCP and VCK are always present, this comment is a leftover from earlier MPX days. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-21dix: memset DeviceVelocityPtr to zero.Peter Hutterer1-9/+2
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-21dix: fix typos in comments, one formatting fix.Simon Thum2-3/+4
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-14[dix] Remove a duplicate statement.Fernando Carrijo1-2/+0
Signed-off-by: James Cloos <cloos@jhcloos.com>
2008-11-13dix: don't store enter/leave and focus semaphores in a devPrivate.Peter Hutterer2-10/+4
We need them for each window, every time a window is allocated. Storing them in a devPrivate is the wrong thing to do. This also removes the unused ENTER_LEAVE_SEMAPHORE_ISSET macro. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2008-11-13dix: remove duplicate line in EnterLeaveEvent.Peter Hutterer1-2/+0
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-11dix: formatting fix.Peter Hutterer1-1/+2
2008-11-11dix: remove superfluous variable devgrabPeter Hutterer1-4/+3
grab == devgrab anyway, this is a leftover from the time when we had two different grabs per device (core and XI grab). Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-10input: Remove useless conditional.Fernando Carrijo1-5/+1
2008-11-08Remove some null statements.James Cloos1-1/+1
Remove several doubled statement-terminal semicolons. Reported by Fernando Carrijo.
2008-11-04Purge device-based WindowAccess code.Peter Hutterer4-388/+61
Really, this was a bad idea. It's not security, the UI features that would have been cool (e.g. clicking through windows) aren't implemented anyway, and there's nothing you can't achieve just by using plain XI anyway. Requires inputproto 1.9.99.6.