(submit/xnest-cleanup-event-handler) Xnest: split off event handler

Tidy it up a bit and split the actual request handler from the request
reading loop, making upcoming reworks easier to review (smaller diffs).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-21 11:17:15 +02:00
parent e2fc6519b7
commit dc8734ac44

View File

@ -108,13 +108,10 @@ xnestQueueKeyEvent(int type, unsigned int keycode)
QueueKeyboardEvents(xnestKeyboardDevice, type, keycode);
}
void
xnestCollectEvents(void)
static void
xnest_handle_event(XEvent X)
{
XEvent X;
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
switch (X.type) {
switch (X.type) {
case KeyPress:
{
xnestUpdateModifierState(X.xkey.state);
@ -239,6 +236,15 @@ xnestCollectEvents(void)
default:
ErrorF("xnest warning: unhandled event: %d\n", X.type);
break;
}
}
}
void
xnestCollectEvents(void)
{
XEvent X;
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
xnest_handle_event(X);
}
}