mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[client] x11: filter out duplicate button press events
This commit is contained in:
parent
c667322f25
commit
0c8ce9daba
@ -343,6 +343,16 @@ static bool x11EventFilter(SDL_Event * event)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
XIRawEvent *raw = cookie->data;
|
XIRawEvent *raw = cookie->data;
|
||||||
|
|
||||||
|
/* filter out duplicate events */
|
||||||
|
static Time prev_time = 0;
|
||||||
|
static unsigned int prev_detail = 0;
|
||||||
|
if (raw->time == prev_time && raw->detail == prev_detail)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
prev_time = raw->time;
|
||||||
|
prev_detail = raw->detail;
|
||||||
|
|
||||||
app_handleButtonPress(
|
app_handleButtonPress(
|
||||||
raw->detail > 5 ? raw->detail - 2 : raw->detail);
|
raw->detail > 5 ? raw->detail - 2 : raw->detail);
|
||||||
return true;
|
return true;
|
||||||
@ -354,6 +364,16 @@ static bool x11EventFilter(SDL_Event * event)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
XIRawEvent *raw = cookie->data;
|
XIRawEvent *raw = cookie->data;
|
||||||
|
|
||||||
|
/* filter out duplicate events */
|
||||||
|
static Time prev_time = 0;
|
||||||
|
static unsigned int prev_detail = 0;
|
||||||
|
if (raw->time == prev_time && raw->detail == prev_detail)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
prev_time = raw->time;
|
||||||
|
prev_detail = raw->detail;
|
||||||
|
|
||||||
app_handleButtonRelease(
|
app_handleButtonRelease(
|
||||||
raw->detail > 5 ? raw->detail - 2 : raw->detail);
|
raw->detail > 5 ? raw->detail - 2 : raw->detail);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user