Reduce code duplication for processing input events
ClosedPublic

Authored by graesslin on Dec 24 2016, 10:13 AM.

Details

Summary

For every input event we have similar code. We go through all
InputFilters, invoke a method with some arguments and check whether
the filter returns true.

Instead of duplicating that logic everywhere, there is now one method
in InputRedirection which takes a std::function to call on the input
filters. The std::function is supposed to be generated with a std::bind
on the InputFilter::method with all the required arguments.

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 9350.Dec 24 2016, 10:13 AM
graesslin retitled this revision from to Reduce code duplication for processing input events.
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 TranscriptDec 24 2016, 10:13 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
sebas accepted this revision.Dec 27 2016, 4:37 PM
sebas added a reviewer: sebas.
This revision is now accepted and ready to land.Dec 27 2016, 4:37 PM
This revision was automatically updated to reflect the committed changes.