Godot Version
4.3.dev
Question
I’m developing an application and want to have a custom title bar/window in the same way apps like discord, steam and vs code have, when trying to achieve this in Godot (from creating custom module classes on C++) it doesn’t work as I expected, when maximizing with:
void BramaNavBar::_on_maximize_pressed() {
DisplayServer *ds = DisplayServer::get_singleton();
if (ds->window_get_mode() == DisplayServer::WINDOW_MODE_FULLSCREEN) {
ds->window_set_mode(DisplayServer::WINDOW_MODE_WINDOWED);
// Optional: Restore previous window size/position
ds->window_set_position(previous_size);
ds->window_set_size(previous_position);
} else {
// Store current windowed size/position before maximizing
save_window_state();
ds->window_set_mode(DisplayServer::WINDOW_MODE_WINDOWED);
ds->window_set_mode(DisplayServer::WINDOW_MODE_MAXIMIZED);
}
}
it goes to full screen, and when minimizing after that it throws an error on the TabBar class because of the Rect2 size. From a reddit answer it seems it’s supposed to work this way on borderless but that doesn’t make sense to me since other apps work normally when using a custom bar, so I’m considering changing the DisplayServerWindows class initially in order to make this work, then expand to the other classes. My current plan is to study how the other applications do it (currently thinking about windows terminal, chromium or electron) then try to translate their logic into Godot’s system. Does anyone have tips or suggestions on the most effective way to develop this for multiple platforms? I’m on windows 10 and would like to avoid having to use a virtual machine in order to develop the other classes since it might be too slow, does anyone know how the core engine contributors usually do this? Are each platform developed by different people or are there people that develop classes from multiple platforms on their own?? Also any tips on resources that could potentially help on achieving this would be appreciated!