Support multiple event types in X11EventFilter
ClosedPublic

Authored by graesslin on Nov 15 2016, 7:26 AM.

Details

Summary

So far the X11EventFilter only supported one event type. But most
usecases for an X11EventFilter require to support multiple event types.
E.g. a filter listens for both key press and key release.

This change extends the internal X11EventFilter to support multiple
types and Workspace::workspaceEvent makes use of that.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 8147.Nov 15 2016, 7:26 AM
graesslin retitled this revision from to Support multiple event types in X11EventFilter.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptNov 15 2016, 7:26 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
graesslin updated this revision to Diff 8148.Nov 15 2016, 7:50 AM
  • rebased on master
  • fix a bug in new code (didn't register on Workspace)
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptNov 15 2016, 7:50 AM
mart accepted this revision.Nov 15 2016, 10:42 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Nov 15 2016, 10:42 AM
broulik added inline comments.
x11eventfilter.cpp
58

m_eventTypes could be empty here, maybe add a Q_ASSERT in the QVector<int> constructor?

graesslin added inline comments.Nov 16 2016, 6:21 AM
x11eventfilter.cpp
58

no, it cannot be empty. just two lines above there is a check for m_eventTypes having exactly one element.

This revision was automatically updated to reflect the committed changes.