Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish between touch and non-touch pointer events #1608

Closed
wants to merge 3 commits into from

Conversation

hrdl-github
Copy link
Contributor

@hrdl-github hrdl-github commented May 10, 2023

Fixes koreader/koreader#10417.


This change is Reviewable

@Frenzie
Copy link
Member

Frenzie commented May 10, 2023

As written wouldn't the slot 0 is_finger state simply swap between true and false a bit?

@hrdl-github
Copy link
Contributor Author

That one only changes on a {touch,button}_{down,up} event. This fixes the pointer issue I've described, which is only a motion event, but interleaving mouse button presses and touch inputs will indeed mess things up.

@@ -423,7 +424,7 @@ function S.waitForEvent(sec, usec)
end
local x = is_finger and event.tfinger.x * S.w or event.button.x
local y = is_finger and event.tfinger.y * S.h or event.button.y
setPointerDownState(slot, true)
setPointerDownState(slot, true, is_finger)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, in the specific sway bug scenario this one will only trigger once. But in that case this would need a lot of comments to explain what it's doing since this won't solve the generic scenario that a naive reader would expect to be solved.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, more comments would be good; because that MOUSEMOTION event in the middle of the sandwich is hella weird ;o).

(I wouldn't mind a link to koreader/koreader#10417 (comment) in said comment, as this clearly showcases the issue).

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NiLuJe Workaround fine by you?

@NiLuJe
Copy link
Member

NiLuJe commented May 10, 2023

Yeah, that looks sensible to me ;).

@hrdl-github
Copy link
Contributor Author

This PR should become unnecessary once swaywm/sway#7583 gets accepted.

@Frenzie
Copy link
Member

Frenzie commented May 11, 2023

Alright, let's wait and see a bit.

@hrdl-github
Copy link
Contributor Author

swaywm/sway#7583 has been merged, rendering this PR unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

touch issues with sway nightly
3 participants