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

Implement pointer constraint. #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vanfanel
Copy link

Implements the previously missing pointer constraint functionality.
Most code came from Sway.

@joggee-fr
Copy link
Collaborator

Thanks for the PR @vanfanel. I am just taking a (very) quick look at it. Could you run clang-format to ensure modified files to be consistent with current format?

@vanfanel
Copy link
Author

vanfanel commented Jan 3, 2024

Thanks for the PR @vanfanel. I am just taking a (very) quick look at it. Could you run clang-format to ensure modified files to be consistent with current format?

Done. It was my first time using that tool, seems very useful indeed. The more you know!

@vanfanel
Copy link
Author

@joggee-fr any news on merging this, please?
I had forgotten but I would need It working.

@joggee-fr
Copy link
Collaborator

@vanfanel, I am not confident enough in my knowloedge for this part to give it a go. I hope @emersion could give it a look. Especially for the so-called "big hack" part.
At least, you should rebase to current HEAD based on wlroots 0.17 now. Is the hack still necessary with this version of wlroots? And maybe squash the two commits also.

@vanfanel vanfanel force-pushed the cursor_constraint branch 2 times, most recently from 9cffcd6 to 7bf842f Compare February 12, 2024 11:23
@vanfanel
Copy link
Author

vanfanel commented Feb 12, 2024

@joggee-fr I have done what you asked me: I rebased to latest Cage code, and squashed all commits into one.

And yes, the "big hack" part is needed with current wlroots 0.17, it comes directly from current Sway, you can see it here:

https://github.com/swaywm/sway/blob/88b2abf5f208422ffc503c2c1d2a0de95d9ec4c5/sway/input/cursor.c#L1372

seat.c Outdated Show resolved Hide resolved
seat.c Outdated Show resolved Hide resolved
@vanfanel
Copy link
Author

@joggee-fr I have fixed those comment-related issues you pointed me to, and squashed all commits again.

@vanfanel
Copy link
Author

@joggee-fr Is there anything else to get this merged, please?
It's a relatively simple PR, but very useful to me.

@joggee-fr
Copy link
Collaborator

@vanfanel,
@emersion will be a better reviewer than me to merge this PR or give you others comments. Hope he will have time to check it soon.

@Zorbatron
Copy link

This PR doesn't seem to work? I hope that I'm just doing something wrong.
After applying the patch and building, I tested it with Minecraft by adding the built cage binary as a wrapper command in Prism Launcher. I can see new confined_pointer and destroying constraint in the log as I alt-tab to and from cage, but my mouse pointer isn't actually being constrained since it moves off of the window when I look too far left or right.
I'm on Arch Linux with:

  • Default kernal ver 6.12.4-arch1-1
  • kwin ver 6.2.4-2
  • wayland protocols ver 1.38-1

@KurtThiemann
Copy link

It definitely worked with Minecraft before, we used it last summer to run Minecraft at Gamescom.
This is the now slightly outdated version we used: https://github.com/KurtThiemann/cage

@Zorbatron
Copy link

Using that fork doesn't work either. Same results as with this. Is it supposed to "just work" or do I have to use a keybind or something?

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.

4 participants