Call workspaceEvent and updateX11Time only once per event

Summary:
On Wayland processXcbEvents calls workspaceEvents and updateX11Time but this
is already done in the native event filter.

Test Plan:
Manual test shows Xwayland still works and constant calls to
XcbEventFilter::nativeEventFilter are processed.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14215
This commit is contained in:
Roman Gilg 2018-07-18 19:23:00 +02:00
parent 5575a5274c
commit afc80f8bd5

View file

@ -219,15 +219,8 @@ void ApplicationWayland::continueStartupWithX()
QSocketNotifier *notifier = new QSocketNotifier(xcb_get_file_descriptor(c), QSocketNotifier::Read, this); QSocketNotifier *notifier = new QSocketNotifier(xcb_get_file_descriptor(c), QSocketNotifier::Read, this);
auto processXcbEvents = [this, c] { auto processXcbEvents = [this, c] {
while (auto event = xcb_poll_for_event(c)) { while (auto event = xcb_poll_for_event(c)) {
updateX11Time(event);
long result = 0; long result = 0;
if (QThread::currentThread()->eventDispatcher()->filterNativeEvent(QByteArrayLiteral("xcb_generic_event_t"), event, &result)) { QThread::currentThread()->eventDispatcher()->filterNativeEvent(QByteArrayLiteral("xcb_generic_event_t"), event, &result);
free(event);
continue;
}
if (Workspace::self()) {
Workspace::self()->workspaceEvent(event);
}
free(event); free(event);
} }
xcb_flush(c); xcb_flush(c);