mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-24 09:44:28 +00:00
Add EvdevPostButtonEvent API to immediately post a button event (#23269)
The wheel emulation code needs this API. When the timer expires, the event must be posted immediately, not enqueued onto the internal event queue. Otherwise, the emulated middle button press is enqueued only and no event is sent until the next physical event (and its EV_SYN) arrives. Since the timer is triggered outside of the SIGIO and SIGIO is blocked during this period anyway, we could also just enqueue the event and flush by simulating an EV_SYN. It's easier this way though. X.Org Bug 23269 <http://bugs.freedesktop.org/show_bug.cgi?id=23269> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com>
This commit is contained in:
@@ -198,7 +198,7 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
|
||||
|
||||
pEvdev->emulateMB.pending = FALSE;
|
||||
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
|
||||
EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
EvdevPostButtonEvent(pInfo, abs(id), (id >= 0));
|
||||
pEvdev->emulateMB.state =
|
||||
stateTab[pEvdev->emulateMB.state][4][2];
|
||||
} else {
|
||||
|
||||
10
src/evdev.c
10
src/evdev.c
@@ -316,6 +316,16 @@ EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value)
|
||||
pEvdev->num_queue++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post button event right here, right now.
|
||||
* Interface for MB emulation since these need to post immediately.
|
||||
*/
|
||||
void
|
||||
EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value)
|
||||
{
|
||||
xf86PostButtonEvent(pInfo->dev, 0, button, value, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count)
|
||||
{
|
||||
|
||||
@@ -183,6 +183,7 @@ typedef struct {
|
||||
/* Event posting functions */
|
||||
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
|
||||
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
|
||||
void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value);
|
||||
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
|
||||
void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
|
||||
int v[MAX_VALUATORS]);
|
||||
|
||||
Reference in New Issue
Block a user