godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.01k stars 21.17k forks source link

Mouse detection of entering and exiting viewport is inconsistent in Godot 4.2 and different from 4.1 #85860

Open JanisMancevics opened 11 months ago

JanisMancevics commented 11 months ago

Tested versions

System information

Fedora Linux 38 - Godot Engine v4.2.stable.official.46dc27791 - Vulkan (Forward+) - AMD Radeon RX 6950 XT (RADV NAVI21)

Issue description

Please check the attached reproduction project and link to the video.

In the cross referenced issue: https://github.com/godotengine/godot/issues/83442 you can compare the behavior with Godot 4.1.

In Godot 4.2:

Steps to reproduce

Check video for more details: https://youtu.be/JSXpDo2pJrc

Minimal reproduction project (MRP)

ControlNodeWindowFocusBugReport-42.zip

akien-mga commented 11 months ago

CC @Sauermann @RandomShaper @kitbdev

Sauermann commented 10 months ago

I have tested the MRP on Debian Linux X11 Xfce and I can't replicate the problem with v4.2.stable.official [46dc27791]. For me, the "Viewport OUT" is printed only once when moving the mouse out of the window. I have tested both cases: focused and unfocused game-window. Can you please provide more details: Are you using X11 or Wayland? Which windowmanager are you using?

JanisMancevics commented 9 months ago

Processors: 48 x AMD Ryzen Threadripper 3960X 24-Core Processor Memory: 62.7 GiB of RAM Graphics Processor: AMD Radeon RX 6950 XT Manufacturer: Micro-Star International Co., Ltd. Product Name: MS-7C59 System Version: 1.0

Fedora Linux 39 KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.113.0 Qt Version: 5.15.11 Kernel Version: 6.6.12-200.fc39.x86_64 (64-bit)

Kwin window manager (the default KDE Plasma window manager)

Graphics Platform: X11

Godot 4.2.1 stable

Window in focus

  1. Mouse moves in OS window area

    1. The first time mouse moves in, only \"Control IN\" is printed

    2. After that moving mouse in and out prints correctly \"Control IN\" \"Viewport IN\"

  2. Mouse moves out OS window area

    1. The first time mouse moves out, both \"Control OUT\" \"Viewport OUT\" are printed

    2. After that moving mouse in and out prints correctly \"Control OUT\" \"Viewport OUT\"

Window not in focus

  1. Mouse moves in OS window area

    1. The first time nothing is printed

    2. After that nothing is printed

  2. Mouse moves out OS window area

    1. The first time only \"Viewport OUT\" is printed

    2. After that \"Viewport OUT\" is printed each time mouse move out.

Godot 4.2 stable

Behaves the same way as 4.2.1 stable

Graphics Platform: Wayland

Godot 4.2.1 stable

Window in focus

  1. Mouse moves in OS window area

    1. The first time mouse moves in, \"Viewport OUT\" \"Viewport IN\" \"Control IN\" is printed in this order, but sometimes only \"Control IN\" is printed.

    2. After that \"Viewport IN\" \"Control IN\" is printed

  2. Mouse moves out OS window area

    1. The first time mouse moves out, \"Control OUT\" \"Viewport OUT\" is printed. But sometimes \"Control OUT\" \"Viewport OUT\" \"Viewport OUT\" is printed.

    2. After that usually \"Control OUT\" \"Viewport OUT\" \"Viewport OUT\" is printed, but sometimes correctly \"Control OUT\" \"Viewport OUT\" is printed.

Window not in focus

  1. Mouse moves in OS window area

    1. The first time nothing is printed

    2. After that mostly nothing is printed, but sometimes \"Viewport OUT\" is printed.

  2. Mouse moves out OS window area

    1. The first time \"Viewport OUT\" \"Viewport OUT\" is printed.

    2. After that \"Viewport OUT\" \"Viewport OUT\" is printed.

Godot 4.2 stable

Perhaps I just didn\'t have large enough research sample size to see that it behaves like 4.2.1 stable, but there seem to be a few differences.

Window in focus

  1. Mouse moves in OS window area

    1. The first time mouse moves in, the same as 4.2.1 stable (just encountered the only \"Control IN\" more frequently)

    2. After that the same as 4.2.1

  2. Mouse moves out OS window area

    1. The first time mouse moves out, the same as 4.2.1

    2. After that usually \"Control OUT\" \"Viewport OUT\" \"Viewport OUT\" is printed, never saw the correct \"Control OUT\" \"Viewport OUT\" is printed.

Window not in focus

  1. Mouse moves in OS window area

    1. The first time nothing is printed

    2. After that nothing is printed

  2. Mouse moves out OS window area

    1. The first time single \"Viewport OUT\" is printed.

    2. After that single \"Viewport OUT\" is printed.


I also installed an old and mature X11 window manager \"IceWM\", and the Godot application behaved the same as with Kwin on X11.