fix: window position/size persistence under Wayland (v1.3.2)
This commit is contained in:
1 parent
1002156cd4
commit
73c1ff51d6
3 files changed
+14
-1
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user