2024-03-19 07:52:57 +00:00
|
|
|
class_name Desktop
|
|
|
|
extends Control
|
|
|
|
|
|
|
|
@export var the_game: Control # TheGame
|
|
|
|
var current_window: Control = the_game # current window
|
|
|
|
|
2024-03-20 19:54:17 +00:00
|
|
|
func _ready() -> void:
|
|
|
|
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, true)
|
|
|
|
|
2024-03-19 07:52:57 +00:00
|
|
|
func _process(_delta):
|
|
|
|
#get_window().grab_focus()
|
|
|
|
pass
|
|
|
|
|
|
|
|
func _input(event: InputEvent):
|
|
|
|
if event.is_action_pressed("HotKey_ToggleFullscreen"):
|
|
|
|
# we can't maximize because godot considers borderless maximized to be fullscreen
|
|
|
|
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN:
|
|
|
|
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
|
|
|
|
else:
|
|
|
|
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|