godotengine / godotengine/godot

Linux: Scene editor: Control: Releasing mouse primary button after Alt+drag for centered Control resize will not end resize operation

Open
#88,408 0 comments 0 reactions 0 assignees View on GitHub
enhancement platform:linuxbsd topic:editor topic:input topic:platforms
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in v4.2.1.stable.official [b09f793f5]

### System information

Godot v4.2.1.stable - Ubuntu 22.04.3 LTS 22.04 - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 860M (nvidia; 535.154.05) - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)

### Issue description

Alt+drag is convenient to resize a Control centered around the initial center

However, on some linux desktops I cannot hold Alt *before* pressing the mouse primary button, as it would move the window.

As a result, I must hold Alt *after* pressing mouse button, which happens to work and will update Control rect to be centered even though I did it late, which is great.

However, after release the mouse button, I get stuck in the resize operation state. Even after releasing Alt, I'm still stuck, and it will cause me to lose my good centered rescale by rescaling in a non-centered matter.

The only way to confirm the resize while it's still centered is to click once more after mouse button release (preferably holding Alt in case you accidentally move the mouse by a few pixels). And you may move the mouse a little while trying that.

https://github.com/godotengine/godot/assets/1067772/cb0eddd0-e18f-4938-b4ed-7b5f53e69291

It may or may not be related to the Linux desktop that's also responsible for window move on Alt+mouse drag.

The solution I found was to press Alt before the click, but to avoid moving window I also combined it with Meta/Super key, following this thread: https://askubuntu.com/questions/521423/how-can-i-disable-altclick-window-dragging

The workaround process is so:
- hold Meta+Alt
- with mouse primary button, drag the Control to center-resize
- release mouse primary button
- release Meta+Alt (in fact, you can even release Meta as soon as you starting dragging)

### Steps to reproduce

1. Create a Control
2. Hold Alt then Drag -> on some desktops, window will move
3. Drag then hold Alt while still dragging -> centered resize starts
4. Release mouse primary button
5. Move around: stuck in centered resize
6. Release Alt
7. Move around: stuck in normal resize
8. Click -> resize finally ends

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Reproduce the issue in the Godot scene editor on Linux with the listed Alt+drag sequence, then trace the Control resize input handling and its mouse-button release state. Done means releasing the primary button ends both centered and normal resize modes without requiring a second click.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
desktop, devtools, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.