Discussion:
D15502: Float position values in drag input filter
Roman Gilg
2018-09-14 10:58:08 UTC
Permalink
romangg created this revision.
romangg added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
romangg requested review of this revision.

REVISION SUMMARY
We lost information when using QMouseEvent::globalPos, since
it is integer. Use instead InputRedirection::globalPointer,
which is updated before the filters are processed and is
float.

TEST PLAN
Manually.

REPOSITORY
R108 KWin

BRANCH
dragPointFPos

REVISION DETAIL
https://phabricator.kde.org/D15502

AFFECTED FILES
input.cpp

To: romangg, #kwin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Roman Gilg
2018-09-14 10:59:07 UTC
Permalink
romangg added a comment.


Also removes an unnecessary second call to `SeatInterface::setPointerPos`.

REPOSITORY
R108 KWin

REVISION DETAIL
https://phabricator.kde.org/D15502

To: romangg, #kwin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Roman Gilg
2018-09-15 00:43:20 UTC
Permalink
romangg added a dependent revision: D15519: Privatize variables in InputDeviceHandler.

REPOSITORY
R108 KWin

REVISION DETAIL
https://phabricator.kde.org/D15502

To: romangg, #kwin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Anthony Fieroni
2018-09-17 12:49:17 UTC
Permalink
anthonyfieroni added a comment.


I saw one potential problem, you can clarify if it's relevant. If event is someone that resend with different position that current one, as i can see input()->globalPointer() will result in current position which can be different from event position, do you think?

REPOSITORY
R108 KWin

REVISION DETAIL
https://phabricator.kde.org/D15502

To: romangg, #kwin
Cc: anthonyfieroni, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Roman Gilg
2018-09-18 13:12:34 UTC
Permalink
romangg added a comment.
Post by Anthony Fieroni
I saw one potential problem, you can clarify if it's relevant. If event is someone that resend with different position that current one, as i can see input()->globalPointer() will result in current position which can be different from event position, do you think?
Thanks for taking a look at it.

The filters are run through always directly after each event. In this case the relevant code is in pointer_input.cpp: `PointerInputRedirection::processMotion`, where `m_pos` is set by a call to `PointerInputRedirection::updatePosition`. Since this happens directly before every filter run on mouse move, the position is the same.

REPOSITORY
R108 KWin

REVISION DETAIL
https://phabricator.kde.org/D15502

To: romangg, #kwin
Cc: anthonyfieroni, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Anthony Fieroni
2018-09-18 13:47:45 UTC
Permalink
anthonyfieroni added a comment.


Yeah, i see they are in sync but if someone sends adjustment events who contain not a *real* mouse position like these https://phabricator.kde.org/source/plasma-workspace/browse/master/shell/panelview.cpp$839 Is this can be a problem>

REPOSITORY
R108 KWin

REVISION DETAIL
https://phabricator.kde.org/D15502

To: romangg, #kwin
Cc: anthonyfieroni, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Roman Gilg
2018-09-18 14:24:49 UTC
Permalink
romangg added a comment.
Post by Anthony Fieroni
Yeah, i see they are in sync but if someone sends adjustment events who contain not a *real* mouse position like these https://phabricator.kde.org/source/plasma-workspace/browse/master/shell/panelview.cpp$839 Is this can be a problem>
Where should these events originate from? The filters are run through directly afterthey comes from the PointerInputRedirection, which bases the position value on a hardware position. KWin is the compositor, so it does not receive hardware events from its clients.

REPOSITORY
R108 KWin

REVISION DETAIL
https://phabricator.kde.org/D15502

To: romangg, #kwin
Cc: anthonyfieroni, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
David Edmundson
2018-10-30 15:26:25 UTC
Permalink
davidedmundson accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
R108 KWin

BRANCH
dragPointFPos

REVISION DETAIL
https://phabricator.kde.org/D15502

To: romangg, #kwin, davidedmundson
Cc: anthonyfieroni, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Roman Gilg
2018-12-02 20:11:23 UTC
Permalink
This revision was automatically updated to reflect the committed changes.
Closed by commit R108:b5a91cdfe08c: Float position values in drag input filter (authored by romangg).

REPOSITORY
R108 KWin

CHANGES SINCE LAST UPDATE
https://phabricator.kde.org/D15502?vs=41631&id=46746

REVISION DETAIL
https://phabricator.kde.org/D15502

AFFECTED FILES
input.cpp

To: romangg, #kwin, davidedmundson
Cc: anthonyfieroni, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Loading...