kwin/src/xwayland
David Edmundson fbb71f9c0b XWayland: Don't dispatch xwayland events in QAbstractEventDispatcher sleeps
QAbstractEventDispatcher blocks and waits constantly on every external event
processed; every timer or update from an X or wayland client, mouse
move or DRM event.

Right now every time this happens we go and check Xwayland for new
events, this is a system call (poll) that based on strace will
unsurprisingly immediately return with EAGAIN as there's nothing to read
from X. If there is something to read our socket notifier will fire. On block we do still need to read any events read in the meantime that weren't dispatched.

This cuts down our system calls significantly, which hopefully should have a
noticeable impact on performance especially when the kernel is under
load.

---

Found whilst analysing strace (by accident whilst looking for something else!)

In a simple case of xwayland nested running glxgears we go from 28 calls per frame to 21. With many many clients and more input events it'll be an even higher percentage.
2023-02-08 10:34:20 +00:00
..
lib qAsConst -> std::as_const 2022-11-01 16:52:01 +02:00
clipboard.cpp build: Add -Wno-unused-parameter compiler option 2022-10-31 15:50:37 +00:00
clipboard.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
CMakeLists.txt Add explicit POSITION_INDEPENDENT_CODE 2022-10-20 09:37:00 +00:00
databridge.cpp databridge: move global to Xwayland 2022-08-08 09:16:22 +00:00
databridge.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
datasource.cpp wayland: Prevent matching dnd actions after drop 2022-10-27 11:03:06 +00:00
datasource.h wayland: Prevent matching dnd actions after drop 2022-10-27 11:03:06 +00:00
dnd.cpp qAsConst -> std::as_const 2022-11-01 16:52:01 +02:00
dnd.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
drag.cpp
drag.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
drag_wl.cpp qMin -> std::min 2022-11-13 14:32:16 +00:00
drag_wl.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
drag_x.cpp qAsConst -> std::as_const 2022-11-01 16:52:01 +02:00
drag_x.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
primary.cpp build: Add -Wno-unused-parameter compiler option 2022-10-31 15:50:37 +00:00
primary.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
selection.cpp qAsConst -> std::as_const 2022-11-01 16:52:01 +02:00
selection.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
selection_source.cpp qAsConst -> std::as_const 2022-11-01 16:52:01 +02:00
selection_source.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
transfer.cpp build: Add -Wno-unused-parameter compiler option 2022-10-31 15:50:37 +00:00
transfer.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
xwayland.cpp XWayland: Don't dispatch xwayland events in QAbstractEventDispatcher sleeps 2023-02-08 10:34:20 +00:00
xwayland.h XWayland: Don't dispatch xwayland events in QAbstractEventDispatcher sleeps 2023-02-08 10:34:20 +00:00
xwayland_interface.h port all headers to pragma once 2022-12-16 20:58:17 +00:00
xwaylandlauncher.cpp Launch xwayland on demand 2023-02-06 16:24:01 +00:00
xwaylandlauncher.h Launch xwayland on demand 2023-02-06 16:24:01 +00:00
xwldrophandler.cpp xwayland: Set parent on XwlDropHandler 2023-01-20 09:41:01 +00:00
xwldrophandler.h port all headers to pragma once 2022-12-16 20:58:17 +00:00