feat: add free-cursor option for unconstrained cursor during drag-scroll - #2
feat: add free-cursor option for unconstrained cursor during drag-scroll#2AMerkuri wants to merge 1 commit into
Conversation
|
Thank you for the PR! It seems that version v1.7 has shipped a Toggle Mode that may already function the way you need it. Please take a look and report back! (v1.11 is the latest version, use this to test) |
|
|
gnhen
left a comment
There was a problem hiding this comment.
Thanks for the PR!
The main problem is that FREE_CURSOR is only half wired up. Every bool tunable has to go through four files and this only touches two, so the config breaks as soon as anyone opens the settings GUI.
Wiring
- Rebase onto
main. This is against v1.11 but v1.12 just landed and it edits the same lines you did (BOOL_KEYS, the CLI arg block, thecli()wiring, thelog.debugline,midscroll.conf). You'll hit conflicts in all of them. - Add it to
midscroll-apply.py. This is the important one. It's not in theBOOLS/KEYSallowlist, so applying from the GUI fails withunknown key 'FREE_CURSOR', and it's not in theTEMPLATE, so every "Apply" rewrites/etc/midscroll.confand resets the value to false. Add it toBOOLS,DEFAULTS, theTEMPLATE, and the.format()call, same asTOGGLE_MODEright above it. - Add it to the settings GUI (
midscroll-settings.py): one entry in theBOOLSlist and one inDEFAULTS. Everything past the point is generic so it'll show up on its own. I want every tunable adjustable in the GUI, not config-only. -
README.md: add it to the sample config and the CLI flags line. - Give the
midscroll.confline a short comment block like the others instead of the inline comment, and keep it matching theTEMPLATEinmidscroll-apply.py.
Behavior
The cursor gets anchored on purpose. Wheel events go to the window under the pointer, so pinning it is what keeps the scroll on the window you started in. With this on, once the cursor leaves that window the scroll jumps to whatever's under it (another window, a panel, the desktop). That's the exact thing the anchor was there to stop, and it can fight the new desktop/panel pause in v1.12. I'm fine shipping it as opt-in but confirm that's the behavior you want, and put a note about it in the config comment and README so people aren't caught off guard.
Also double check the log.debug change is replacing the old line, not adding a second one. The diff wasn't clear.
Testing
Before I merge, confirm you've tested with FREE_CURSOR = true:
- hold-drag still scrolls and the speed curve is unchanged
- a plain middle click still pastes
-
--no-free-cursoroverrides atrueconfig - toggling it in the GUI writes to the config and the value survives another Apply
Once it's rebased and wired through apply, the GUI, and the README I'll look again.
Thanks!
Add FREE_CURSOR config option, CLI flag (--free-cursor/--no-free-cursor), settings GUI toggle, and midscroll-apply support. When enabled, mouse motion is forwarded to the desktop during a hold-drag scroll instead of being swallowed to anchor the cursor. The drag offset is still accumulated for the speed calculation and clamped to MAX_DRAG_PX, so speed behavior is unchanged — only the cursor is no longer locked. Note: with FREE_CURSOR on, once the cursor leaves the window you started in, the scroll jumps to whatever is under it (another window, a panel, the desktop). That is the exact thing the anchor was there to prevent, so it ships opt-in (off by default) with a note in the config comment and README. Wired through all five files: - midscroll.py: global, BOOL_KEYS, event-loop guard, CLI arg, cli() wiring, log.debug line - midscroll-apply.py: BOOLS, DEFAULTS, TEMPLATE, .format() call - midscroll-settings.py: BOOLS list, DEFAULTS dict - midscroll.conf: comment block matching the apply TEMPLATE - README.md: sample config, CLI flags line, behavior note Default remains false (anchored cursor).
|
Thanks for the detailed review — all fair points. I've rebased onto Wiring
BehaviorConfirmed — that's exactly the behavior I want. The anchor is there for a good reason, and On the TestingTested with
Ready for another look. |
Add FREE_CURSOR config option and --free-cursor/--no-free-cursor CLI flag. When enabled, mouse motion is forwarded to the desktop during a drag-scroll instead of being swallowed to anchor the cursor. The drag offset is still accumulated for the speed calculation and clamped to MAX_DRAG_PX, so speed behavior is unchanged — only the cursor is no longer locked.
Default remains false (anchored cursor).