godotengine / godotengine/godot

Can't use window manager shortcuts to resize/fullscreen/minimize a floating game window anymore depending on focus

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

Description

- *Related to https://github.com/godotengine/godot/issues/100883.*

### Tested versions

- Reproducible in: 4.4.dev 24d74510e

### System information

Godot v4.4.dev (24d74510e) - Fedora Linux 41 (KDE Plasma) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 565.77) - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)

### Issue description

Since window embedding was implemented, it's not possible to use use window manager shortcuts to resize/fullscreen/minimize a floating game window anymore depending on which window is focused (the floating game window or the window embedded within). This is because these shortcuts are received by the embedded game window placed on top of the floating game window, not the floating game window itself.

On KDE X11, the following actions are affected when the embedded window has focus:

- Alt + F9 (custom shortcut to minimize window)
- Alt + F11 (custom shortcut to toggle fullscreen)

The shortcut to maximize the window works though (Alt + F10 custom shortcut).

To resolve this, we should allow resizing the embedded game window and have the floating game window automatically adapt itself. This means there would be a two-way approach to window resizing: you can either resize the floating game window and have the embedded window adapt itself (taking its chrome[^1]'s size into account), or the other way around.

Here, I toggle fullscreen by pressing Alt + F11 after initially running the project (the floating game window has focus). The embedded window then automatically gains focus because my mouse cursor is over it[^2], and I can't press the same shortcut to leave fullscreen until I click outside the embedded window.

https://github.com/user-attachments/assets/7a564916-f03d-43af-9a9c-e8b860a460b7

Implementing two-way window mangement would also resolve issues where the embedded window can get out of sync because you forcibly moved it, e.g. by making its window border visible with a custom shortcut, moving it with Super + Left mouse button or pressing Super + Up arrow which moves it to the upper half of the screen:

https://github.com/user-attachments/assets/4eeece17-d533-4dca-aa31-ba6893678b03

[^1]: "chrome" refers to the decorations/UI around the embedded window.
[^2]: This is behavior implemented by Godot, I'm not using a "focus follows mouse" configuration.

### Steps to reproduce

- Run a project with a floating game window.
- Try to use window manager manipulation shortcuts on the game window itself (i.e. the viewport, not the chrome around it).

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the focus-dependent shortcut behavior with a floating game window and embedded window on Fedora KDE X11, then trace the window-embedding resize and focus handling. Done means the embedded window can be resized by the window manager, the floating window adapts in both directions, and the listed minimize/fullscreen shortcuts work regardless of focus.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
desktop, game-dev, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.