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

InputEventMouseMotion events are only received in _input(event) if game window loses and receives focus before #53894

Closed
BeayemX opened this issue Oct 16, 2021 · 5 comments · Fixed by #56548

Comments

@BeayemX
Copy link
Contributor

BeayemX commented Oct 16, 2021

Godot version

v4.0.dev.custom_build [c240275]

System information

Linux Mint - Vulkan API 1.2.131 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080

Issue description

InputEventMouseMotion events are not received when starting the game.
Other events like keyboard or mouse clicks do work.

The game window must lose and receive the focus again first, before InputEventMouseMotion events are received.

Steps to reproduce

  1. Put this script on a Node2D:
extends Node2D

func _input(event):
	print(event)
  1. Start the scene
  2. Move the mouse around and see that nothing is printed
  3. Click into the window, see these messages printed:
InputEventMouseButton: button_index=1, mods=none, pressed=true, position=((424, 313)), button_mask=1, double_click=false
InputEventMouseButton: button_index=1, mods=none, pressed=false, position=((424, 313)), button_mask=0, double_click=false
  1. Move mouse again, see that even though window is focused, no prints are created
  2. Select a different window
  3. Select the game windows again
  4. Move mouse and see that prints now appear as expected

(Instead of step 6. and 7. it also works to click on the title bar of the game window)

Related issues

Maybe related to #49978 ?

@Calinou
Copy link
Member

Calinou commented Oct 17, 2021

@BeayemX Can you reproduce this on 3.3.4 or 3.4 beta6?

@BeayemX
Copy link
Contributor Author

BeayemX commented Oct 17, 2021

The issue does not occur in Godot 3.

Tested with:

  • v3.2.1.stable
  • v3.3.4.stable.official [faf3f88]
  • v3.4.beta.custom_build [fddbbf4]

@Calinou
Copy link
Member

Calinou commented Oct 17, 2021

I can confirm this on commit c240275. This prevents editor freelook and panning from working until you unfocus the editor window and focus it again.

@Calinou Calinou added this to the 4.0 milestone Oct 17, 2021
@superlou
Copy link

superlou commented Dec 1, 2021

I confirmed with a build from 11/18/21. It's definitely about the game window losing focus and then gaining focus again.

@Jimmio92
Copy link

Jimmio92 commented Jan 30, 2022

I didn't see this bug when I originally searched before reporting this same problem; my apologies. Some others tested and it seems to work as is on KDE, while not working without moving the window/refocusing on XFCE. It definitely sounds like that focus problem is the real cause. I have since closed #57294 .

This is still present in alpha 1 release of 4.0 and master branch.

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.

4 participants