How do I completely remove the splash screen window, including the 1-second rectangle?

Godot Version

4.4.1

Question

Hello all,
I have disabled all the configurations related to the splash screen, but I still see a gray rectangle when the game starts. How can I eliminate this 1–2 second splash screen?
I’m trying to do this with C++.

code:

void GameInitWindow::_ready() {
    DisplayServer* ds = DisplayServer::get_singleton();


    ds->window_set_flag(DisplayServer::WINDOW_FLAG_TRANSPARENT, true);
   // get_viewport()->set_transparent_background(true);

    int screen_index = ds->get_primary_screen();  // Or use screen_get_current()
    Vector2 screen_size = ds->screen_get_size(screen_index);

    int width = static_cast<int>(screen_size.x);  // Full screen width
    int height = 240;

    ds->window_set_size(Vector2(width, height));
    ds->window_set_position(Vector2(0, screen_size.y - height));
    ds->window_set_flag(DisplayServer::WINDOW_FLAG_BORDERLESS, true);
    ds->window_set_flag(DisplayServer::WINDOW_FLAG_ALWAYS_ON_TOP, true);
  
    get_viewport()->set_transparent_background(true);
    
     

    //CanvasItem::update();  // Explicit to avoid ambiguity
    
}

 

In addition to what you have modified in project settings you need to enable the following under Display/Window: Borderless, Transparent, and Per Pixel Transparency/Allowed (You may need to enable Advanced settings to see them)