Skip to content

Conversation

@Fireye04
Copy link
Contributor

@Fireye04 Fireye04 commented Dec 10, 2025

fixes #1473

This PR adds pressure to hot corners, requiring users to both mouse over the hot corner and also give a certain amount of pressure to cause it to trigger, reducing accidental activation.

Reviews, test feedback, and comments are, as always, more than welcome.

Current Design

In summary, PointerMotionEvent deltas are being read and added to a hot_corner_pressure variable, which is then used to measure total pressure against the hot corner.

There are a few values that you can tweak to get the pressure feeling right, listed here:

  • dividend: This is the big one, basically it divides the combined x and y deltas to get the absolute pressure. You can get more extreme values by decreasing this number, or less extreme ones by increasing it.
  • pressure_cap: This should change as a function of the dividend. I've found that I want the pressure cap to be reachable if you take a big swipe at the hot corner, but only really in that scenario. This allows you to trigger the hot corner with a large swipe, which is something that I find I do regularly, but was something the original design made significantly more difficult. (Sidenote, but this behavior can be removed if it's found to be generally undesirable)
  • target: This is the threshold that the total pressure needs to reach in order to trigger the hot corner. Eg: If your dividend goes down, this will trip faster.

I don't think I've got the balance all the way down at the moment, but it's close, as tested on my laptop's track pad. I'd like to get a more complete idea of how it interacts with different hardware though, so please feel free to test on whatever you happen to have and let me know how things feel and what settings you prefer.

Disclaimers

A couple of things to take care of before i'd consider this thing usable, as well as some things of note:

First off, this must be tested off the TTY. I'm currently running off nix develop and using the following command to obtain program logs cargo run -- --session 2>&1 | tee logs_tty.txt. (this is how you can tell if you're hitting your pressure cap)

Currently it's only implemented for the bottom left hot-corner (I wanted to tune the pressure settings before handling the boilerplate). Theoretically I could swap to an absolute value implementation, but that might be a bit odd for multiple monitor setups so I think I'm leaning towards a more rigid implementation here.

Further, the pointer is not currently being captured on entering a hot corner, which again might create problems for multi-monitor setups where the hot corner is placed between monitors. I'm not sure if this is a desirable behavior, but I reckon it's something good to include unless otherwise determined.

Finally, we're smack dab in the middle of my uni's finals season, so please forgive me if I end up taking a second to finish polishing this thing up.

TODO

  • add timeout clock
  • implement all four corners (whoaw!)
  • capture & release pointer
  • finalize default tuning
  • Implement config
  • Add docs

@Fireye04 Fireye04 force-pushed the feature/pressure-hot-corners branch from ebd134f to a5e21c2 Compare December 10, 2025 05:07
    only bottom left is working
@Fireye04 Fireye04 force-pushed the feature/pressure-hot-corners branch from a5e21c2 to 5e6e999 Compare December 25, 2025 20:58
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.

Hot corner with barriers

1 participant