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

Mouse cursor is visible with captured mouse mode after window loses and regains focus. #23494

Closed
fabslab opened this issue Nov 4, 2018 · 2 comments

Comments

@fabslab
Copy link

fabslab commented Nov 4, 2018

Godot version:
v3.0.6

OS/device including version:
Windows 10

Issue description:
Alt-tabbing with captured mouse mode results in mouse cursor becoming visible when it should remain hidden. Resetting the mouse mode once the window regains focus does not solve the issue either.

Steps to reproduce:
Create and run an autoload script with the following:

extends Node

func _ready():
	hide_mouse()

func _notification(event):
	if event == MainLoop.NOTIFICATION_WM_FOCUS_IN:
			hide_mouse()

func hide_mouse():
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

Alt-tab out of the game then back in and see that the mouse cursor is visible.

@ghost
Copy link

ghost commented Nov 6, 2018

Confirmed on Windows 10.

@guilhermefelipecgs might know what's up.

@fabslab A work-around you can use for the time being:

func hide_mouse():
	Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

@RandomShaper RandomShaper added this to the 3.1 milestone Nov 7, 2018
@RandomShaper RandomShaper self-assigned this Nov 7, 2018
@RandomShaper
Copy link
Member

I'm pretty sure I can fix this, so self-assigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants