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

pointer: map devices across all outputs by default #8352

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

JManch
Copy link
Contributor

@JManch JManch commented Nov 4, 2024

Describe your PR, what does it fix/add?

This fixes a problem with wlx-overlay-s where multi-monitor overlay pointer movement is broken. Somewhat related issues: #6023 #6889

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

I'm not sure if it's correct to map across the entire space by default.

Is it ready for merging, or does it need work?

Ready

@Agent00Ming
Copy link
Contributor

Mapping to all outputs by default only for pointer devices makes OpenTabletDriver's absolute mode (pointer device) and artist mode (tablet device) map differently despite otherwise identical internal mapping configurations.

@vaxerski
Copy link
Member

vaxerski commented Nov 5, 2024

isnt that just #7586

@Agent00Ming
Copy link
Contributor

Not exactly, this PR changes the default mapping for pointer devices only while #7586 only gives the option for tablet devices to map to all outputs.

@JManch
Copy link
Contributor Author

JManch commented Nov 5, 2024

#7586 doesn't fix the problem since boundOutput is empty. Would it make sense to change the default mapped area to all outputs instead of just the current monitor?

CBox mappedArea = currentMonitor->logicalBox();

@JManch
Copy link
Contributor Author

JManch commented Nov 5, 2024

I've changed it so that tablet, touch and pointer devices map across all outputs unless they are explicitly bound to an output. This changes how tablet regions are applied. When bound to an output, region_position is relative to the bound output, otherwise, it's an absolute position.

This fixes wlx-overlay-s whilst hopefully maintaining consistent behaviour between absolute mode and artist mode for tablets. I've done some brief testing with my tablet and it seems ok but I don't have a way to test touch devices.

@JManch JManch force-pushed the wlx-overlay-s-fix branch from df6d5fd to a7637c2 Compare November 5, 2024 03:11
@JManch JManch force-pushed the wlx-overlay-s-fix branch from a7637c2 to 72e883f Compare November 5, 2024 13:48
@github-actions github-actions bot added the config label Nov 5, 2024
@JManch JManch changed the title pointer: map across entire space if bound output is empty pointer: map devices across all outputs by default Nov 5, 2024
@JManch
Copy link
Contributor Author

JManch commented Nov 5, 2024

I've added an absolute_region_position option that, when true, treats the region_position as absolute. Otherwise it's treated as relative like before. It doesn't apply when the tablet is bound to an output.

@JManch JManch marked this pull request as draft November 5, 2024 15:49
@JManch
Copy link
Contributor Author

JManch commented Nov 5, 2024

Just tested wlx-overlay-s with one of my monitors in negative space and the overlay pointer problem is back so need to figure out what's going on there...

@JManch JManch force-pushed the wlx-overlay-s-fix branch from 72e883f to b073bf3 Compare November 5, 2024 18:33
@JManch
Copy link
Contributor Author

JManch commented Nov 5, 2024

Turns out it was an upstream issue galister/wlx-capture#3 so this is ready for review

@JManch JManch marked this pull request as ready for review November 5, 2024 18:35
@JManch JManch force-pushed the wlx-overlay-s-fix branch from b073bf3 to be87d0b Compare November 5, 2024 18:43
@JManch
Copy link
Contributor Author

JManch commented Nov 7, 2024

I've added the ability to set input:tablet:output to current for replicating the old behaviour.

I could make current the default to keep default behaviour the same as it is now but, as @Agent00Ming said, this would make the OTD absolute mode map differently to artist mode.

Copy link
Contributor

@Agent00Ming Agent00Ming left a comment

Choose a reason for hiding this comment

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

I think that's a reasonable compromise for now as pointer devices lack the configuration granularity that tablet devices have. Tablet tested.

vaxerski
vaxerski previously approved these changes Nov 8, 2024
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

wiki mr needed

@vaxerski
Copy link
Member

vaxerski commented Nov 9, 2024

oops conflict

@vaxerski
Copy link
Member

clang-format missing xdddddd

@JManch
Copy link
Contributor Author

JManch commented Nov 10, 2024

I don't think it's from my diff

@izmyname
Copy link
Contributor

I don't think it's from my diff

0.45 broke the stuff, prolly

@vaxerski vaxerski merged commit 07052a5 into hyprwm:main Nov 11, 2024
12 checks passed
@JManch JManch deleted the wlx-overlay-s-fix branch November 11, 2024 16:45
@fxzzi
Copy link
Contributor

fxzzi commented Nov 13, 2024

seems to work fine like this:
image

but not like this (tablet rotated 180deg):
image

@JManch
Copy link
Contributor Author

JManch commented Nov 13, 2024

Rotated tablet works for me. In what way does it not work?

@fxzzi
Copy link
Contributor

fxzzi commented Nov 13, 2024

how i have rotated it on that screenshot causes the mouse cursor to still be able to reach my monitor on the left, which should not be possible considering how I have mapped the tablet area to the display. Moving the area over to the bottom right of the tablet (top left physically, as it is rotated), seems to work fine:
image

EDIT: my apologies, I think this is intended behaviour by OTD with "Clamp input outside area" turned off. Turning it on and tablet is now working as intended again. Thanks!

@fxzzi
Copy link
Contributor

fxzzi commented Nov 14, 2024

further testing done with artist mode shows it is now working, however still being funky on osu!lazer. It seems to be stuck on the right side of the window. Looks to be a bug on hyprland considering the same config seems to work fine for me and others on sway.

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

Successfully merging this pull request may close these issues.

5 participants