Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggling Fullscreen Doesn't Work When Always on Top is Enabled #48312

Closed
cybereality opened this issue Apr 29, 2021 · 5 comments
Closed

Toggling Fullscreen Doesn't Work When Always on Top is Enabled #48312

cybereality opened this issue Apr 29, 2021 · 5 comments

Comments

@cybereality
Copy link
Contributor

Godot version:

Godot 3.3

OS/device including version:

Ubuntu Linux 64-bit, Nvidia 2080 Ti, Driver 460, GLES2/3

Issue description:

Toggling fullscreen mode with OS.window_fullscreen = !OS.window_fullscreen initially causes a windowed app to go fullscreen. However, calling it again will result in strange behavior. Either fullscreen mode is exited, but the window remains maximized, or it seems to do nothing and requires calling the toggle function 2 or 3 more times before the windowed mode is restored. This only happens when "Always on Top" is enabled, and seems to be specific to Linux, as it works in Windows.

Expected behavior is that every time you call OS.window_fullscreen = !OS.window_fullscreen that the window switches between fullscreen and windowed mode. This works when disabling "Always on Top".

Steps to reproduce:
Test the sample project and press "F" to toggle fullscreen. Or make a new project and bind an input map to:
OS.window_fullscreen = !OS.window_fullscreen and also be sure to enable "Always on Top".

Minimal reproduction project:

Fullscreen.zip

@akien-mga
Copy link
Member

Tested on Mageia 9 64-bit with KDE Plasma 5.21.4, I can confirm part of the issue, namely that toggling between fullscreen and non-fullscreen with "Always on Top" keeps the windowed mode maximized.

I can't reproduce that part though:

or it seems to do nothing and requires calling the toggle function 2 or 3 more times before the windowed mode is restored

For me pressing "F" in the example project always properly toggles between fullscreen and (maximized) windowed mode. It does however feel a bit slow to respond compared to how it works without "Always on Top".

CC @godotengine/linux-bsd

@Wolfe2x7
Copy link

Wolfe2x7 commented Jun 5, 2021

I can confirm this is issue affects Linux Mint 20.1 (Cinnamon). I had not tracked it down to Always on Top being enabled; good to know.

@Wolfe2x7
Copy link

For what it's worth, I have successfully worked around this by calling OS.set_window_always_on_top(false) before switching to fullscreen and setting it to true after switching back to a window. The switch seems to work perfectly, and I'm happy not combining always on top with fullscreen anyway, in case of errors.

@cybereality
Copy link
Contributor Author

I've discovered something. If you disable Resizable in the Window Project settings, then this problem goes away. I can now toggle Fullscreen on and off, while keeping Always on Top, and everything works. Since I rarely need to resize a window, and most shipped games don't allow window resizing, I would consider this an acceptable work-around for the time being.

@akien-mga
Copy link
Member

Fixed by #62543.

@akien-mga akien-mga added this to the 3.5 milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants