mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 12:32:05 +00:00
ui: Bring back the is_input_event helper
This makes the logic clearer and easier to reason about.
This commit is contained in:
parent
909a46087f
commit
13b7fa4eba
13
src/ui/ui.c
13
src/ui/ui.c
@ -75,13 +75,20 @@ meta_ui_get_screen_number (void)
|
||||
#include "display-private.h"
|
||||
|
||||
static gboolean
|
||||
is_interesting_input_event (XEvent *event)
|
||||
is_input_event (XEvent *event)
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
|
||||
return (event->type == GenericEvent &&
|
||||
event->xcookie.extension == display->xinput_opcode);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_interesting_input_event (XEvent *event)
|
||||
{
|
||||
XIEvent *input_event;
|
||||
|
||||
if (event->type != GenericEvent ||
|
||||
event->xcookie.extension != display->xinput_opcode)
|
||||
if (!is_input_event (event))
|
||||
return FALSE;
|
||||
|
||||
input_event = (XIEvent *) event->xcookie.data;
|
||||
|
Loading…
Reference in New Issue
Block a user