Commit 13b7fa4e authored by Jasper St. Pierre's avatar Jasper St. Pierre
Browse files

ui: Bring back the is_input_event helper

This makes the logic clearer and easier to reason about.
parent 909a4608
...@@ -75,13 +75,20 @@ meta_ui_get_screen_number (void) ...@@ -75,13 +75,20 @@ meta_ui_get_screen_number (void)
#include "display-private.h" #include "display-private.h"
static gboolean static gboolean
is_interesting_input_event (XEvent *event) is_input_event (XEvent *event)
{ {
MetaDisplay *display = meta_get_display (); 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; XIEvent *input_event;
if (event->type != GenericEvent || if (!is_input_event (event))
event->xcookie.extension != display->xinput_opcode)
return FALSE; return FALSE;
input_event = (XIEvent *) event->xcookie.data; input_event = (XIEvent *) event->xcookie.data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment