godotengine / godot

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

Linux: When dragging files Godot can't track the mouse position #95792

Open Maulve opened 3 weeks ago

Maulve commented 3 weeks ago

Tested versions

System information

Godot v4.3.stable - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 15 Aug 2024 00:25:30 +0000 - Wayland - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 Laptop GPU - 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz (16 Threads)

Issue description

So this is a bug I found, as I don't think this is intended behavior.

When dragging files on Linux (not tested on other OSes) any mouse-related signals on the Control class aren't emitted when they should be. Note that Node2D.get_global_mouse_position() also doesn't update the position. Godot seems to be unable to track the mouse position when files are dragged. From my testing, this affects both Wayland and X11.

My expectation is that these mouse-related signals are still emitted even when dragging files. Why would I need this? To make essentially just an area where a file can be dropped, instead of the whole window. But since tracking the mouse doesn't work, that is much harder (still technically possible using a Window).

Steps to reproduce

  1. Create a project
  2. Connect the signals "mouse_entered" and/or "mouse_exited" of any Control Node to a function
  3. print() any feedback
  4. Drag files from the system file manager and check the output

Minimal reproduction project (MRP)

drop-bug.zip

TrueJole commented 3 weeks ago

I can't reproduce it, as the the window is unfocused when I begin a drag. Any unfocused window does not seem to track the mouse.

Godot v4.3.stable - Linux Mint 22 (Wilma) - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (amdgpu; 6.7.0) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

Maulve commented 3 weeks ago

I can't reproduce it, as the the window is unfocused when I begin a drag. Any unfocused window does not seem to track the mouse.

Seems like focusing works different in Cinnamon then? I tested this in KDE Plasma and also Hyprland. Both of these automatically focus a window when you're dragging a file over it.

TrueJole commented 3 weeks ago

Oh that makes sense, I use Cinnamon

voylin commented 3 weeks ago

I have been experiencing this for quite a long time, but running i3-wm.