summaryrefslogtreecommitdiff
path: root/dix/events.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-24dix: check for core passive grabs on inferiors when replaying events.Peter Hutterer1-3/+9
2007-10-23xace: try to pretend events were sent when a denial occurs.Eamon Walsh1-8/+10
Probably need to redo the error return paths in these functions at some point.
2007-10-18dix: Add client parameter to AddPassiveGrabsToList().Eamon Walsh1-2/+2
2007-10-17Merge branch 'master' into XACE-SELINUXEamon Walsh1-0/+55
Conflicts: os/access.c
2007-10-16dix: CheckPassiveGrabOnWindow: only get paired device for non-keyboards.Peter Hutterer1-1/+6
2007-10-16dix: don't treat VCK/VCP separately in DevHasCursor, IsPointer/KeyboardDevice.Peter Hutterer1-3/+3
2007-10-16Fix up detritus from removing GetPairedPointer/Keyboard.Peter Hutterer1-10/+8
2007-10-16dix: adjust PickPointer and PickKeyboard to get the first master device.Peter Hutterer1-22/+7
Simplifies it a lot, since we always have at least one master device available at all times, so less mucking around.
2007-10-16dix: don't allow slave devices as ClientPointerPeter Hutterer1-0/+10
2007-10-03dix: ignore passive grab if the client already has a grab on the device.Peter Hutterer1-0/+29
In some cases a button press may activate a passive core grab. If the client owning the passive grab already has a core grab on another device, don't actually activate it. Otherwise the client gets two simultaneous passive core grabs, and may never ungrab the device again (only if the other grab uses GrabModeSync). Reproducable: fire up gnome-session, open up gnome-terminal. Click with the ClientPointer onto the window decoration, then click with another pointer onto an application icon in the panel. Drag the icon out, release the button and voila - you just lost your second mouse.
2007-10-03dix: send NotifyGrab/NotifyUngrab focus events regardless of semaphore state.Peter Hutterer1-2/+4
This is just papering over a problem. The whole focus system needs to be revised.
2007-10-03dix: change Enter/Leave semaphore handling to accommodate for NotifyGrab.Peter Hutterer1-3/+23
This is a half-assed attempt at getting rid of some enter-leave problems. When a grab is activated, the events didn't get sent before, leading to interesting results. This commit papers over it but doesn't actually fix it properly. The whole enter/leave (focusin/out) structure needs to be ripped out and changed for multiple devices.
2007-10-02Fix #12650: "windows not receiving mouse events in multiple screens context"Dodji Seketeli1-0/+55
* dix/events.c, include/dix.h: (UpdateSpriteForScreen): added this to update the mouse sprite context when we switch from a pScreen to another. * mi/mipointer.c: (miPointerWarpCursor): as we are switching to a new pScreen, don't forget to update the mouse sprite context.
2007-09-28Remove generation of core events, long live XI!Peter Hutterer1-6/+68
Let the drivers only generate XI events and put those into the event queue. When processing events, generate core events as needed. This fixes a number of problems with XKB and the DIX in general. The previous approach was to put core events and XI events as separate events into the event queue. When being processed, the server had no knowledge of them coming from the same device state change. Anything that would then change the state of the device accordingly was in danger of changing it twice, leading to some funny (i.e. not funny at all) results. Emulating core events while processing XI events fixes this, there is only one path that actually changes the device state now. Although we have to be careful when replaying events from synced devices, otherwise we may lose events. Note: XI has precedence over core for passive grabs, but core events are delivered to the client first. This removes the wrapping added in 340911d7243a7f1095d79b5b2dcfa81b145c2474
2007-09-28dix: GetPairedKeyboard() always returns a valid keyboard (VCK if necessary).Peter Hutterer1-10/+1
We need it unconditionally in a few places, and the rest checked for NULL and then set it to VCK anyway. So, fixing up all callers to appreciate the defined return value.
2007-09-28dix: take paired keyboard instead of VCK (CoreProcessPointerEvents)Peter Hutterer1-1/+1
2007-09-26dix: unify ErrorFs. prepend all with [dix].Peter Hutterer1-9/+9
2007-09-26dix: add comments to PlayReleasedEvents()Peter Hutterer1-0/+10
Also stick another warning in, more changes needed for XGE if panoramix is active.
2007-09-26dix: add comments to ComputeFreezes() and syncEvents struct.Peter Hutterer1-0/+21
2007-09-24dix: fix compiler warnings about unused variables.Peter Hutterer1-7/+6
2007-09-24dix: don't try to access "time" field for GenericEvents in PlayReleasedEvent.Peter Hutterer1-1/+12
GenericEvents can't be parsed to keyButtonPointer, and there's no guarantee that it has a time field anyway. PlayReleasedEvent needs to store the millis when we know it (core events, XI event) and just re-use them for GenericEvents. Yes, this is a hack. But it looks like the time has zero significance anyway.
2007-09-24dix: fix comment for DeliverDeviceEvents.Peter Hutterer1-3/+10
DDE is not always called, grabbed or focused devices go through Deliver{Grabbed|Focus}Event first. Thanks to Eamon Walsh for spotting it.
2007-09-24dix: Make EnqueueEvent aware of GenericEvents.Peter Hutterer1-7/+27
GenericEvents can be > sizeof(xEvents), so we need to make sure we're allocating and copying enough memory for the event.
2007-09-24dix: don't compress motion events from different devices (EventEnqueue)Peter Hutterer1-1/+2
2007-09-19xace: add missing argument to hook call.Eamon Walsh1-1/+1
2007-09-06dix: add XI event support to FixKeyState.Peter Hutterer1-12/+9
FixKeyState needs to be able to handle XI events, otherwise we get "impossible keyboard events" on server zaps and other special key combos.
2007-09-06dix: don't change the device struct while processing core events.Peter Hutterer1-55/+17
The device state needs to be changed while processing the XI event. Core events are always processed after XI, so by then the device is already set up properly. However, we now rely on DeviceButtonMotionMask to be equal to ButtonMotionMask. It already is, but stick a big fat warning in so nobody attempts to change it. This commit disables XKB for the VCK, thus essentially for all devices. Temporarily anyway.
2007-08-29xace: drop map-window checking hook, add new hooks for controlling theEamon Walsh1-7/+28
delivery of events to windows and clients. This is tentative. It's likely that an additional last-resort hook will be necessary for code that calls TryClientEvents or WriteEventsToClient directly. It's also possible that new xace machinery will be necessary to classify events and pull useful resource ID's out of them. The failure case also needs some thinking through. Should event delivery "succeed" or should it report undeliverable? Finally, XKB appears to call WriteToClient to pass events. Sigh.
2007-08-28xace: add hooks + new access codes: core protocol input requestsEamon Walsh1-44/+80
2007-08-23dix: Only check device events for possible ACLs.Peter Hutterer1-2/+4
We shouldn't be able to restrict events like Expose, etc. with device based ACLs. So we just ignore all non-input events when checking for permissions.
2007-08-20dix: ProcChangeActivePointerGrab: make sure variable is initialised.Peter Hutterer1-2/+6
Thanks to Ben Close for spotting it.
2007-08-15xace: add hooks + new access codes: core protocol cursor requestsEamon Walsh1-9/+9
2007-08-15dix: ProcUngrabKeyboard: make sure grab is initialized.Peter Hutterer1-0/+2
This should fix the random segfaults with ProcUngrabKeyboard. Thanks to David Nolden for spotting it.
2007-08-12Merge branch 'master' into mpxPeter Hutterer1-1/+0
Conflicts: Xi/exevents.c dix/devices.c dix/getevents.c include/dix.h mi/mieq.c
2007-08-08Fix typo from last commit. Oh well.Peter Hutterer1-1/+1
2007-08-08dix: Allow flexible devices for passive core grabs.Peter Hutterer1-10/+183
A passive core grab doesn't specify the device, and is thus created with the ClientPointer as device. When this grab is activated later, don't actually activate the grab on the grab device, but rather change the device to the one that caused the grab to activate. Same procedure for keyboards. Makes core apps _A LOT_ more useable and reduces the need to set the ClientPointer. Only applies to core grabs!
2007-08-07dix: get the paired keyboard for a passive grab (ProcGrabButton).Peter Hutterer1-2/+7
Taking the VCK is only correct if no physical device is connected, and even then it's not really a good idea.
2007-08-02Merge branch 'master' into XACE-SELINUXEamon Walsh1-11/+21
Conflicts: dix/devices.c dix/property.c include/dix.h
2007-07-10DeliverEventsToWindow: ensure that genericMask has a defined value.Peter Hutterer1-3/+2
2007-07-10Change CheckMotion to ignore non-pointer events but acknowledge XI events.Peter Hutterer1-22/+50
Call CheckMotion from ProcessOtherEvents() to make sure absolute XI events update the sprite before an event is sent.
2007-07-10DeliverGrabbedEvent: stop segfault when gemask == NULL.Peter Hutterer1-1/+1
2007-07-10Call CheckMotion for all core events.Peter Hutterer1-2/+7
We need to do this to update the sprites x/y coordinate before we assemble a button event. Absolute devices may send a buttonEvent with valuators attached. If we don't update the sprite before assembling the event, the valuators are lost and the button press is delivered to the previous position of the device. Doesn't have any effect on relative devices.
2007-07-06Use the same struct for generic event masks throughout the code.Peter Hutterer1-24/+22
Renaming those structs too. Previously grabs were using a different struct than windows, which was reasonably stupid.
2007-07-01Add 'evfill' field to GEExtensions.Peter Hutterer1-0/+7
We need this to allow extensions to fill in extra data for an event before it is sent to the client. This is probably to be used like FillUpEventsFromWindow().
2007-06-27More janitor work. Remove 'defined but not used' warnings from kdrive and ↵Tiago Vignatti1-1/+0
some minor cosmetic.
2007-06-27Reset grab->next to NULL when we're creating a grab.Peter Hutterer1-0/+7
This is definitely necessary in CheckDeviceGrabAndHintWindow (thanks to Paulo Zanoni for spotting it). We're resetting it everywhere else too, just to be save.
2007-06-27Init genericMasks to 0, make sure list is NULL terminated.Peter Hutterer1-0/+1
2007-06-25Only decrement buttonsDown when the button count is greater than 0.Peter Hutterer1-10/+21
Device drivers flush their buttons on device init and cause a button down event to be generated. If we unconditionally decrease the buttons, we won't be able to ever get a passive device grab. Format documentation for CheckDeviceGrabs to make it readable. (cherry picked from commit 3e894974cdd6a75683d4601f71622d1da7ec4395) Conflicts: Xi/exevents.c
2007-06-19Merge branch 'master' into mpxPeter Hutterer1-0/+7
Conflicts: dix/devices.c hw/xfree86/common/xf86Xinput.c hw/xfree86/loader/xf86sym.c mi/mieq.c
2007-06-19Add implicitGrab field to GrabInfoRec.Peter Hutterer1-7/+85
Is set when passive grab is implicit as result of a ButtonPress event. If this is the case, we need to store the XI mask as well as the core mask to ensure delivery of XI events during the grab's lifetime. Remove all core grabs on other devices when client issues a GrabPointer or GrabKeyboard request. Let's assume that the client really only wants one device to interact, so this seems like a reasonable solution.