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

pointer-constraints: keep constraint alive until actual destruction #6679

Closed
wants to merge 2 commits into from

Conversation

Trimutex
Copy link
Contributor

Describe your PR, what does it fix/add?

Current constraint deactivation kills the constraint even if it tries to reactivate due to lifetime check always being true. Removing this fixes refocusing of windows not actually restarting constraint, requiring a recreation of the constraints by the program.

  • Ex: Minecraft will not recreate constraint until menu is opened in game, so swapping to another window and back rapidly will kill the constraint without recreation, leaving pointer to roam free.

Possible fix for #5900 but can not recreate issue myself to test.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

No problems with usage as proper destruction gets called anyways later when actually necessary. Perhaps a better option is to change the default lifetime of the pointer constraint, but I'm not too knowledgeable the implications of that.

Is it ready for merging, or does it need work?

Ready for merging

@Trimutex
Copy link
Contributor Author

On closer inspection I'm dumb and this of course breaks any oneshot lifetime...

However, would using a default of persistent be possible to achieve the same effect of fixing the original issue (the example)? Documentation for it explains both, but not a default for this from what I can find.

@vaxerski
Copy link
Member

tag me when ready

@Trimutex
Copy link
Contributor Author

@vaxerski should already be ready? this still fixes the Minecraft example already. Sorry if I didn't make that clear

@vaxerski
Copy link
Member

why not just set the properties in the appropriate constructors like I've obviously forgotten to? xD

vaxerski added a commit that referenced this pull request Jun 28, 2024
@vaxerski
Copy link
Member

should be fixed.

@Trimutex
Copy link
Contributor Author

because I missed it too lol. this does fix it properly, thanks!

@Trimutex Trimutex closed this Jun 28, 2024
@Trimutex Trimutex deleted the keep-constraint branch July 11, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants