godot icon indicating copy to clipboard operation
godot copied to clipboard

Right clicking in the editor to open properties of a certain element instantly selects what's under cursor.

Open radiantgurl opened this issue 1 year ago • 13 comments

Tested versions

Not reproducible in v4.3.dev3.official [36e943b6b] Reproducible in v4.3.dev4.official [df78c0636] Reproducible in v4.3.dev5.official [c9c17d6ca] Reproducible in v4.3.dev6.official [64520fe67] Reproducible in v4.3.beta1.official [a4f2ea91a]

System information

Godot v4.3.beta1 - Arch Linux #1 SMP PREEMPT_DYNAMIC Fri, 31 May 2024 15:14:45 +0000 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 (nvidia; 550.78) - Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz (8 Threads)

Issue description

When you right click, it instantly selects something even though you didn't want it to select anything. To fix this, all you really need is to check if the mouse moved substantially from when the right click button was clicked to when the right click button is released.

Steps to reproduce

https://github.com/godotengine/godot/assets/69520693/1ea39699-4aeb-4591-baa6-3c093dc7cc14

Minimal reproduction project (MRP)

N/A

radiantgurl avatar Jun 17 '24 13:06 radiantgurl

I can't reproduce the issue on 4.3.beta1 on Fedora 40 with KDE Plasma on Wayland (using X11 / Xwayland display driver).

I see you're also using KDE, are you on Wayland or X11 as session type, and are you using Godot's Wayland or X11 display driver?

Edit: I also tested on KDE Plasma X11 session, and still can't reproduce the bug.

akien-mga avatar Jun 17 '24 13:06 akien-mga

Using Plasma X11 here, depends on how long you have it held, since it takes a while for it to pop up, and once it pops up, if you still have the button held it will just select anything under the cursor.

radiantgurl avatar Jun 17 '24 16:06 radiantgurl

This could also be fixed by slightly offsetting the popup to the right

radiantgurl avatar Jun 17 '24 16:06 radiantgurl

I'm getting a similar behavior on MacOS, only in my case it's happening even on left button click: #92948

inhalt120g avatar Jun 17 '24 17:06 inhalt120g

Godot 4.3-dev3: image Godot 4.3-beta1: image This still selects the button even though it's not in the box, which seems to be the primary issue.

radiantgurl avatar Jun 17 '24 18:06 radiantgurl

I think this bug occurs somewhere around here https://github.com/godotengine/godot/blame/df78c0636d79c9545a283e0e2a926d623998cc27/scene/gui/popup_menu.cpp#L620

radiantgurl avatar Jun 17 '24 18:06 radiantgurl

Regressed to 7884d632812996ef26184412846c533276cb4cc0

radiantgurl avatar Jun 17 '24 22:06 radiantgurl

How exactly #87462 caused the issue? Menus appearing right under cursor were already a thing, you can easily encounter them at the edges of the screen. The problem is that when you right-click something and it opens a menu, the menu should not be activated even if there is something under the cursor; there should be a timeout to prevent that.

Related #86952. Interestingly, the feature seems broken again on Windows .-.

KoBeWi avatar Jun 18 '24 11:06 KoBeWi

Unsure how to be honest, but i went through every modification of the PopupMenu till i reached that, and that's when it started failing. Reverting it seemed to fix the issue.

radiantgurl avatar Jun 18 '24 11:06 radiantgurl

CC @bruvzg

akien-mga avatar Jun 19 '24 08:06 akien-mga

Happens in 4.3 beta 2 as well.

Quincy9000 avatar Jun 20 '24 16:06 Quincy9000

@Quincy9000 What distro, DE, and session type (X11/Wayland) are you using?

Still can't reproduce it myself on Fedora 40 with KDE Plasma 6.1.1, on either Wayland or X11 sessions.

akien-mga avatar Jun 28 '24 10:06 akien-mga

@Quincy9000 What distro, DE, and session type (X11/Wayland) are you using?

Still can't reproduce it myself on Fedora 40 with KDE Plasma 6.1.1, on either Wayland or X11 sessions.

Windows 10, sorry. The issue seemed to go away after I alt tabbed into other apps and back.

Quincy9000 avatar Jun 28 '24 16:06 Quincy9000

Using Plasma X11 here, depends on how long you have it held, since it takes a while for it to pop up, and once it pops up, if you still have the button held it will just select anything under the cursor.

I can reproduce this on Ubuntu Wayland, 4.3 Beta 3. Very short right clicks don't seem to trigger it, sightly longer ones do. Especially noticeable when using two fingers on a touch-pad to right click.

KerekesDavid avatar Jul 25 '24 13:07 KerekesDavid

So I'm still trying to find what's the common denominator between users who can reproduce this issue, as neither @bruvzg nor I can reproduce it on our Linux setups.

I see a couple reports of running into similar issues on macOS and Windows but I'm not sure they're actually the same issue. May be though, as it seems both X11 and Wayland users can reproduce it, which are two separate DisplayServer implementations, so it could also be reproducible in Windows and macOS.

That being said, we had a relatively low amount of reports for this issue so it seems to only affect a small subset of users.

I wonder if it's a HiDPI related issue. For affected users, could you give details on your screen resolution, system scaling factor, and the scaling factor set in the Godot settings?

akien-mga avatar Jul 31 '24 12:07 akien-mga

I'm facing the same problem. Specs incoming:

  • Thinkpad T14S, 14"
  • KDE Plasma 6.1.3, Wayland, Arch Linux
  • Display Resolution 1920x1080, system scaled to 125% via Plasma settings
  • Godot editor uses Wayland backend, scaled to 125% (auto)

The problem never happens when I right-click using the physical button above the trackpad. When simulating right click with two-finger tapping, the problem happens pretty reliably when the context menu reaches the bounds of the parent scroll container. It happens almost never when the container is large enough to fit the entire context menu:

https://github.com/user-attachments/assets/bc06bac7-e615-49fb-9f8b-a33d533a34e0

and-rad avatar Jul 31 '24 18:07 and-rad

Same I have the problem 100% of the time on KDE wayland with a touchpad (Apple magic trackpad), when right clicking with a two fingers tap.

geowarin avatar Aug 06 '24 22:08 geowarin

For those who can reproduce this issue, could you test #95232 and confirm it fixes it? (Howto)

akien-mga avatar Aug 07 '24 08:08 akien-mga

On a fresh master build (v4.3.rc.custom_build [33fe10c06]), I confirm that the issue is fixed for me! Thanks!

geowarin avatar Aug 07 '24 16:08 geowarin