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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1661>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-21 11:17:15 +02:00 committed by Marge Bot
parent 3597323d48
commit 0d3ae98661

View File

@ -108,12 +108,9 @@ xnestQueueKeyEvent(int type, unsigned int keycode)
QueueKeyboardEvents(xnestKeyboardDevice, type, keycode); QueueKeyboardEvents(xnestKeyboardDevice, type, keycode);
} }
void static void
xnestCollectEvents(void) xnest_handle_event(XEvent X)
{ {
XEvent X;
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
switch (X.type) { switch (X.type) {
case KeyPress: case KeyPress:
{ {
@ -241,4 +238,13 @@ xnestCollectEvents(void)
break; break;
} }
} }
void
xnestCollectEvents(void)
{
XEvent X;
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
xnest_handle_event(X);
}
} }