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

fix(nui/core): keep cursor clipping when no cursor is present #3083

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

Conversation

tens0rfl0w
Copy link
Contributor

Goal of this PR

This PR addresses an issue where the mouse cursor is not clipped to the game window when a NUI is focused without the cursor being present (i.e., only the keyboard is focused). This behavior causes the cursor to move outside the game frame in non-fullscreen mode or when using a multi-monitor setup, leading to loss of focus while moving the game camera.

How is this PR achieving the goal

The proposed change introduces a check for the presence of a cursor (g_hasCursor). Game frame clipping is now disabled only when a cursor is actively present, ensuring camera movement still works as intended.

This PR applies to the following area(s)

FiveM

Successfully tested on

Game builds: Not applicable

Platforms: Windows (Client)

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

Reported by myself here: https://forum.cfx.re/t/5172373

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Jan 19, 2025
@Nobelium-cfx Nobelium-cfx added the ready-to-merge This PR is enqueued for merging label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged ready-to-merge This PR is enqueued for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants