fix: window position/size persistence under Wayland (v1.3.2)
Build & Release / build-linux (push) Has been cancelled
Build & Release / build-windows (push) Has been cancelled
Build & Release / create-release (push) Has been cancelled

This commit is contained in:
Alhan committed 2026-10-11 17:51:47 +03:00
1 parent 1002156cd4
commit 73c1ff51d6
3 files changed
+14 -1

No files matched your search

+8
View File
@@ -150,6 +150,14 @@ static void my_application_class_init(MyApplicationClass* klass) {
static void my_application_init(MyApplication* self) {}
MyApplication* my_application_new() {
// GTK3 ignores gtk_window_move under Wayland (window opens centered).
// Force X11 backend when an X server is available (XWayland) so window
// position/size persistence works.
if (g_getenv("WAYLAND_DISPLAY") != nullptr &&
g_getenv("DISPLAY") != nullptr) {
g_setenv("GDK_BACKEND", "x11", FALSE);
}
// Set the program name to the application ID, which helps various systems
// like GTK and desktop environments map this running application to its
// corresponding .desktop file. This ensures better integration by allowing