Skip to content

[rcore_desktop] Upon entering fullscreen, uses original window size #3929

Open
@OilyFishMan

Description

@OilyFishMan

Issue description

Upon running the procedure ToggleFullscreen(), raylib reports "GetScreenWidth()" and "GetScreenHeight()" as values set before SetWindowSize(x, y). However, without ToggleFullscreen(), the original values are kept for one frame then immediately restored to correct full resolution.

Environment

Platform backend: DESKTOP (GLFW)
OS: Fedora 39 x86_64
Desktop: Gnome X11
OpenGL version: 4.6
GPU: Integrated

Issue Screenshot

Screencast from 2024-04-22 18-22-46.webm
Screencast from 2024-04-22 18-26-19.webm

Code Example

#include <stdio.h>
#include <raylib.h>

int main(void)
{
    InitWindow(1, 1, "Application");
    int display = GetCurrentMonitor();
    SetWindowSize(GetMonitorWidth(display), GetMonitorHeight(display));
    ToggleFullscreen();
    while (!WindowShouldClose()) {
        BeginDrawing();
        DrawRectangle(0, 0, GetMonitorWidth(display), GetMonitorHeight(display), RAYWHITE);
        printf("%d %d\n", GetScreenWidth(), GetScreenHeight());
        DrawRectangle(0, 0, GetScreenWidth() / 2, GetScreenHeight() / 2, RED);
        EndDrawing();
    }
    CloseWindow();
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions