Skip to content

Commit fddabc2

Browse files
committed
fix: wayland/xwayland fixes (accounting for window decoration, minimized state)
1 parent 8176286 commit fddabc2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

imgui_skia/imgui_skia_driver_impl/imgui_skia_app_sdl3.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ void ImGuiSkia::Driver::App::setup(CliOptions &opts) {
387387
auto const dm = SDL_GetDesktopDisplayMode(SDL_GetPrimaryDisplay());
388388
if (dm != nullptr) {
389389
if (initialWindowWidth < 0) {
390-
initialWindowWidth = dm->w;
390+
initialWindowWidth = dm->w/4*3;
391391
}
392392
if (initialWindowHeight < 0) {
393-
initialWindowHeight = dm->h;
393+
initialWindowHeight = dm->h/4*3;
394394
}
395395
} else {
396396
fprintf(stderr, "Error: SDL_GetDesktopDisplayMode(): %s\n", SDL_GetError());
@@ -505,9 +505,11 @@ SkSurface * ImGuiSkia::Driver::App::preRender(bool &done, int &width, int &heigh
505505
break;
506506
}
507507
}
508-
while (SDL_GetWindowFlags(fWindow) & SDL_WINDOW_MINIMIZED) {
509-
SDL_Delay(10);
510-
}
508+
// known problem in wayland/xwayland: the minimzation state is not properly reported by wayland
509+
// see https://wiki.libsdl.org/SDL3/README-wayland
510+
//while (SDL_GetWindowFlags(fWindow) & SDL_WINDOW_MINIMIZEDO) {
511+
// SDL_Delay(10);
512+
//}
511513

512514
auto const surface = getSurfaceGL();
513515

0 commit comments

Comments
 (0)