From 0ab497ca8869bcc968d3e48ff5e3ea4c15c3c766 Mon Sep 17 00:00:00 2001 From: IoI_xD Date: Mon, 13 Apr 2026 11:28:54 -0700 Subject: [PATCH] oops prioritize wayland --- src/backend/wayland.c | 7 +------ src/backend/x11.c | 3 --- src/core.c | 8 ++++---- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/backend/wayland.c b/src/backend/wayland.c index 801c03f..148ca44 100644 --- a/src/backend/wayland.c +++ b/src/backend/wayland.c @@ -2575,7 +2575,6 @@ static int MwLLWaylandCallInitImpl(void) { /* * Order of precedence: * - MILSKO_BACKEND - * - XDG_SESSION_TYPE * - manually checking environment variables */ #ifdef __linux__ @@ -2583,11 +2582,7 @@ static int MwLLWaylandCallInitImpl(void) { if(getenv("MILSKO_BACKEND")) { loadWayland |= (strcmp(getenv("MILSKO_BACKEND"), "wayland") == 0); - } - if(getenv("XDG_SESSION_TYPE")) { - loadWayland |= (strcmp(getenv("XDG_SESSION_TYPE"), "wayland") == 0); - } - if(getenv("WAYLAND_DISPLAY")) { + } else if(getenv("WAYLAND_DISPLAY")) { loadWayland |= (getenv("WAYLAND_DISPLAY") != NULL); } diff --git a/src/backend/x11.c b/src/backend/x11.c index 755da71..4068186 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -1281,9 +1281,6 @@ static int MwLLX11CallInitImpl(void) { loadX11 |= (strcmp(getenv("MILSKO_BACKEND"), "x11") == 0); } - if(getenv("XDG_SESSION_TYPE")) { - loadX11 |= (strcmp(getenv("XDG_SESSION_TYPE"), "x11") == 0); - } if(getenv("DISPLAY")) { loadX11 |= (getenv("DISPLAY") != NULL); } diff --git a/src/core.c b/src/core.c index b4b6743..cdd0723 100644 --- a/src/core.c +++ b/src/core.c @@ -856,16 +856,16 @@ MwWidget MwGetParent(MwWidget handle) { typedef int (*call_t)(void); int MwLibraryInit(void) { call_t calls[] = { -/* x11 has higher priority then cocoa until it works */ +#ifdef USE_WAYLAND + MwLLWaylandCallInit, +#endif +/* x11 has higher priority then cocoa until it works */ #ifdef USE_X11 MwLLX11CallInit, #endif #ifdef USE_COCOA MwLLCocoaCallInit, #endif -#ifdef USE_WAYLAND - MwLLWaylandCallInit, -#endif #ifdef USE_GDI MwLLGDICallInit, #endif