Fix event type checking
ClosedPublic

Authored by amantia on Dec 7 2018, 8:13 PM.

Details

Summary

The ev->xkbType looks to be a value that is defined in xkb.xml (usually
in /usr/share/xcb), and that indicates which bit refers to a certain event.
The XCB_XKB_EVENT_TYPE_* enum is a bitmask value though, they cannot be
compared directly. E.g BellNotify even mean bit 8 is set, that means the value
is 2^8 = 256.
This fixes bell, visual bell and accessibility event handling.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
amantia created this revision.Dec 7 2018, 8:13 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 7 2018, 8:13 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
amantia requested review of this revision.Dec 7 2018, 8:13 PM

Seems to be an XCB bug.

We should have wrappers for both:

XkbNewKeyboardNotify, XkbMapNotify, etc.

and

XkbNewKeyboardNotifyMask, XkbMapNotifyMask, etc.

the latter being used for event selection masks.

That's what XKB.h from X11 has, and XCB normally copies that.

But you're right, XCB only has an enum with names from the first one and with the values from the second :/


My rules for workarounds is we should have an upstream bug report submitted and a comment in the code.

There's a bug report already here: https://bugs.freedesktop.org/show_bug.cgi?id=51295

amantia updated this revision to Diff 47100.Dec 8 2018, 12:59 PM

Added comment for workaround

davidedmundson accepted this revision.Dec 8 2018, 12:59 PM
This revision is now accepted and ready to land.Dec 8 2018, 12:59 PM
amantia closed this revision.Dec 11 2018, 6:17 PM

Messed up a little and this got landed together with another patch https://cgit.kde.org/plasma-desktop.git/commit/?id=40b9e34ced6b421c8585f304d91a2da37f40c4d6