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

Check for layer surface under cursor when clicking #885

Merged
merged 1 commit into from
Dec 22, 2024
Merged

Conversation

calops
Copy link
Contributor

@calops calops commented Dec 21, 2024

Currently, windows don't get focus when clicking on them through a clickthrough layer. This PR fixes that by only considering layers under the cursor if we fall in an input area.

src/niri.rs Outdated
layers
.layer_under(layer, pos_within_output)
.and_then(|layer| {
let layer_pos_within_output = layers.layer_geometry(layer)?.loc.to_f64();
Copy link
Owner

Choose a reason for hiding this comment

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

This can remain an unwrap(). It is guaranteed by the fact that we found it in layer_under().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 updated

@YaLTeR YaLTeR enabled auto-merge (rebase) December 22, 2024 12:05
@YaLTeR YaLTeR merged commit b1c40a9 into YaLTeR:main Dec 22, 2024
10 checks passed
@YaLTeR
Copy link
Owner

YaLTeR commented Dec 22, 2024

Thanks

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.

2 participants