0 votes

Hello, I have an issue where taskbar gets active on the windows export when users click on the windows taskbar area while in fullscreen.

func Resolution():
    ProjectSettings.set_setting("display/window/size/width", res_width)
    ProjectSettings.set_setting("display/window/size/height", res_height)

    OS.set_window_size(Vector2(res_width, res_height))

if (fullscreen == true):
elif (fullscreen == false):

Display/Resizable = On
Display/Borderless = Off
Display/Fullscreren = Off

This works pretty much how I want it to want on the Linux export. However, when I export to Windows the area of the windows taskbar gets active when clicking on it, effectively throwing the user out of the game.

I have tried with the code below but it looks like it doesn't change anything:

var screenSize = Vector2(0,0)
screenSize.x = get_viewport().get_visible_rect().size.x # Get Width
screenSize.y = get_viewport().get_visible_rect().size.y # Get Height

ProjectSettings.set_setting("display/window/size/width", screenSize.x)
ProjectSettings.set_setting("display/window/size/height", screenSize.y)

OS.set_window_size(Vector2(screenSize.x, screenSize.y))

And help appreciated. Thank you.

Godot version 3.3.3
in Engine by (50 points)

1 Answer

0 votes
  1. Instead of fullscreen == true, just use "if fullscreen:"
  2. No need to make the second statement an elif. If fullscreen is true, the else means it's false, no need to check.
  3. In both situations, you first set the screen to the opposite of what you want, then to the desired situation. Any reason for that?
  4. You could also do away with the if/else and simply use OS.window_fullscreen = fullscreen

Do try making the window borderless when making it fullscreen and see if the problem persists:

OS.windowfullscreen = fullscreen
borderless = fullscreen

In this situation, fullscreen as true also gets rid of the border/taskbar. If false, it shows it again

by (292 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.