diff --git a/src/plasma/private/effectwatcher.cpp b/src/plasma/private/effectwatcher.cpp --- a/src/plasma/private/effectwatcher.cpp +++ b/src/plasma/private/effectwatcher.cpp @@ -62,7 +62,11 @@ bool EffectWatcher::nativeEventFilter(const QByteArray &eventType, void *message, long *result) { Q_UNUSED(result); - if (eventType != "xcb_generic_event_t") { + // A faster comparison than eventType != "xcb_generic_event_t" + // given that eventType can only have the following values: + // "xcb_generic_event_t", "windows_generic_MSG" and "mac_generic_NSEvent" + // According to http://doc.qt.io/qt-5/qabstractnativeeventfilter.html + if (eventType[0] != 'x') { return false; } xcb_generic_event_t *event = reinterpret_cast(message);