From dd6358412e1e78f0d1072488373247f84e90d6d6 Mon Sep 17 00:00:00 2001 From: Max Gaukler Date: Tue, 27 May 2025 10:24:16 +0200 Subject: [PATCH] Workaround for welcome dialog partly out of screen on Wayland On Wayland, the lower buttons of the Welcome screen are outside of the screen boundaries if the screen is not very high. This is very confusing to new users. The technical reason is that Gtk4 does not re-center a modal dialog when it changes size. As a workaround, make the splash screen approximately as high as the welcome dialog. A long-term solution would require a redesign of the dialog to always have constant size or an upstream fix in Gtk4. https://gitlab.com/inkscape/inkscape/-/issues/5692 --- src/ui/dialog/startup.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ui/dialog/startup.cpp b/src/ui/dialog/startup.cpp index bc4cabcdee..20c2a67aa3 100644 --- a/src/ui/dialog/startup.cpp +++ b/src/ui/dialog/startup.cpp @@ -16,6 +16,9 @@ #include #include #include +#ifdef GDK_WINDOWING_WAYLAND +#include +#endif #include #include #include @@ -164,7 +167,18 @@ StartScreen::StartScreen() void StartScreen::show_now() { - set_default_size(700, 0); + int default_height = 0; // 0 = automatic size +#ifdef GDK_WINDOWING_WAYLAND + if (GDK_IS_WAYLAND_DISPLAY(this->get_display()->gobj())) { + // Workaround: On Wayland, the splash screen is initially centered but then does not re-center when it increases + // height to become the welcome dialog. As a result, the welcome dialog is so off-center that the lower buttons + // are cut off. To work around, we request a larger initial height even if this makes the splash screen look ugly + // due to lots of empty space at the bottom. + // https://gitlab.com/inkscape/inkscape/-/issues/5692 + default_height = 600; + } +#endif + set_default_size(700, default_height); set_resizable(false); // Show the main banner when already welcomed for the first time -- GitLab