Add hot_corners#181
Conversation
malbiruk
left a comment
There was a problem hiding this comment.
Thanks for this — nice feature, and the config/docs wiring is clean. One must-fix (inline on pointer.rs, it silently disables the whole feature) plus two smaller cleanups, all left inline.
Minor nit not worth a thread: the disable_when_fullscreen early-return doesn't clear hot_corners_armed, so a corner won't re-fire after fullscreen-exit until the cursor leaves and re-enters.
| let button = event.button_code(); | ||
| let button_state = event.state(); | ||
| if button_state == ButtonState::Pressed { | ||
| self.held_buttons.insert(button); |
There was a problem hiding this comment.
Must-fix: held_buttons has no reset path, unlike its sibling suppressed_keys (cleared on VT-switch in keyboard.rs and on PauseSession in udev.rs). Hold a mouse button across a VT switch / suspend and the release is lost → held_buttons stays non-empty → with the default disable_while_dragging = true, every hot corner is dead for the rest of the session. Please clear it at those same two sites.
(Moving this insert/remove above the outputs().is_none() early-return further up also closes the transient output-hotplug variant.)
| output: &smithay::output::Output, | ||
| screen_pos: Point<f64, smithay::utils::Logical>, | ||
| ) { | ||
| let Some(cfg) = self.config.output_config(&output.name()).cloned() else { |
There was a problem hiding this comment.
This .cloned() runs on every pointer-motion event for any output with an [[outputs]] block, and OutputConfig.name is a String — so it heap-allocates per event even when no corners are configured. Check bindings.is_empty() on the borrowed ref first, and clone only the fired Action.
| # # synthesizing a CVT modeline when the monitor doesn't advertise it (intended | ||
| # # for CRTs or forcing non-standard modes; may be rejected by some panels). | ||
| # # | ||
| # ## Hot-corners: bind any keyboard action to a screen corner. The action fires |
There was a problem hiding this comment.
## renders as an <h2> in the generated docs/config.md, splitting this sentence across the heading and the next paragraph. Use # # prose like the surrounding blocks, then regen: UPDATE_CONFIG_DOCS=1 cargo test docs_config_md_is_up_to_date.
5663fc2 to
dea3d12
Compare
Like from niri, but more functional
Setup only per output
Support any actions from keybindings, every corner is independent
hot-corners.mp4