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

Add XFixes support and CusorBarrier command. #1098

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

somiaj
Copy link
Collaborator

@somiaj somiaj commented Oct 31, 2024

CursorBarrier is a command to create a PointerBarrier using the XFixes extension. This barrier can be used to confine mouse movement to any rectangle on the desktop. This first adds XFixes as an optional dependency, and if XFixes is included, the CursorBarrier option can be used to create PointerBarriers.

CursorBarrier can be use to both create and destroy barriers. Currently MAX_BARRIERS is set at 16, so only up to 16 barriers can be created at a single time. The use of CursorBarrier is documented in the manual page.

The main intent of this is to allow a toggle to confine the mouse to a specific monitor (often the current monitor) using CursorBarrier screen c and CursorBarrier destroy, as mentioned requested in #603. This can also be used to confine the mouse to any specified rectangle or screen on the desktop, define multiple barriers, and use CursorMove or WarpToWindow to move between them.

I almost added a window option to specify a barrier to a specific window, but opted not to at this time. The following will confine the mouse to a selected window already (the only thing a window option would provide is computing coordinates relative to the windows position and size).

Pick CursorBarrier coords $[w.x]p $[w.y]p $[math.+.$[w.x],$[w.width]]p $[math.+.$[w.y],$[w.height]]p

@somiaj somiaj force-pushed the js/pointer-barrier branch 2 times, most recently from a68d7ce to dd6baaf Compare October 31, 2024 14:13
CursorBarrier is a command to create a PointerBarrier using
the XFixes extension. This barrier can be used to confine mouse
movement to any rectangle on the desktop. This first adds XFixes
as an optional dependency, and if XFixes is included, the
CursorBarrier option can be used to create PointerBarriers.

CursorBarrier can be use to both create and destroy barriers.
Current `MAX_BARRIERS` is set at 16, so only up to 16 barriers
can be created at a single time. The use of CursorBarrier is
documented in the manual page.

A default key binding ctrl+shift+D is setup to destroy all
barriers to give users a way to escape any jails their cursor
is stuck in.
@ThomasAdam ThomasAdam added the type:new-feature Brand new feature not yet present in fvwm3 label Oct 31, 2024
@ThomasAdam ThomasAdam added this to the 1.1.1 milestone Oct 31, 2024
@ThomasAdam ThomasAdam merged commit 1f02250 into main Oct 31, 2024
12 checks passed
@ThomasAdam ThomasAdam deleted the js/pointer-barrier branch October 31, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:new-feature Brand new feature not yet present in fvwm3
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants