From a670148aef843ae117731410c7120a56ee405bc3 Mon Sep 17 00:00:00 2001 From: locriacyber <74560659+locriacyber@users.noreply.github.com> Date: Tue, 8 Mar 2022 03:09:24 +0000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Demi Marie Obenour --- gui-daemon/xside.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gui-daemon/xside.c b/gui-daemon/xside.c index e523348e..5d35039c 100644 --- a/gui-daemon/xside.c +++ b/gui-daemon/xside.c @@ -2384,17 +2384,16 @@ static void process_xevent(Ghandles * g) XIEvent* xi_event = cookie->data; // from test_xi2.c in xinput cli utility XIDeviceEvent * xi_device = (XIDeviceEvent *)xi_event; - XILeaveEvent * xi_leave = (XILeaveEvent *)xi_event; switch (xi_event->evtype) { // ideally raw input events are better, but I'm relying on X server's built-in event filtering and routing feature here case XI_KeyPress: case XI_KeyRelease: - if (xi_device && xi_device->flags & XIKeyRepeat) break; // don't send key repeat events + if (xi_device && (xi_device->flags & XIKeyRepeat)) break; // don't send key repeat events process_xievent_keypress(g, xi_device); break; case XI_FocusIn: case XI_FocusOut: - process_xievent_focus(g, xi_leave); + process_xievent_focus(g, (XILeaveEvent *)xi_event); break; } XFreeEventData(g->display, cookie);