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

Fix slurp -o "selection cancelled" with touch inputs #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stacyharper
Copy link

fixes: #140

@emersion
Copy link
Owner

Hm it seems we call this function on pointer release and on touch down… Shouldn't we call it on touch up instead?

@stacyharper
Copy link
Author

I tried to move this to touch_handle_up and it doesn't works as intended.

@stacyharper stacyharper force-pushed the selection-touch branch 2 times, most recently from c0a1e82 to 16c188f Compare February 21, 2024 08:40
@stacyharper
Copy link
Author

stacyharper commented Feb 21, 2024

We could move the call to seat_update_selection to touch_handle_up, and conditioned it to be run if there is still no selection at this point. It allow to select rects on simple touches, while still allowing manual box selections.

But the problem is the case of slurp -o -r. To handle that, we also have to add this function to touch_handle_down, before handle_selection_start. Because in this situation, handle_selection_start will finish the loop. Then, the seat_update_selection call from touch_handle_up becomes redundant, so we can remove it.

@emersion
Copy link
Owner

Sorry, but I still don't understand what's peculiar about touch input that makes it different from pointer input here.

@stacyharper
Copy link
Author

I don't get it. We update the selectioned box on touch down because this is the only moment we can, and have to do so.

@emersion
Copy link
Owner

The pointer codepath does not call seat_update_selection() when a button is pressed. Why does touch down need to call it?

@stacyharper
Copy link
Author

Because we know where the pointer is before the user press any button. We don't know where the user finger is before it actually touch the screen.

@stacyharper
Copy link
Author

Gentle bump. Could this be reviewed? I continue to think the fix is good, even if it looks wrong with a first glance.

manner82 pushed a commit to manner82/sxmo-utils that referenced this pull request Jul 3, 2024
We've already had a number of patches attempting to resolve this issue,
and an upstream PR to slurp pending for quite a while. I think we need a
solution in the meantime that would work even on the broken version of
slurp (in case distros are behind once a fix is released).

This version also copes with the fat-trembling-finger problem and will
simply take a screenshot of the whole screen if the selection is too
tiny to be reasonable (which may be an issue even in the fixed slurp).

Ref: https://lists.sr.ht/~mil/sxmo-devel/patches/49367
Ref: https://lists.sr.ht/~mil/sxmo-devel/patches/49719
Ref: https://lists.sr.ht/~mil/sxmo-devel/patches/44258
Ref: emersion/slurp#140
Ref: emersion/slurp#141
--
Changes in v2:
- select only one output (adapted from magdesign's patch earlier)
- better error feedback

Signed-off-by: Willow Barraco <[email protected]>
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.

slurp -o with touchscreen cause "selection cancelled" instead of giving the full output geometry
2 participants