From ce7b1fc62b1140252428cdce4678d1e1ce6d97aa Mon Sep 17 00:00:00 2001 From: Jae-Sung Lee Date: Mon, 28 Jul 2025 21:30:43 +0900 Subject: [PATCH] fix linux build error in onWayland caused by declaration after label (#4446) * fix linux build error in onWayland caused by declaration after label * update changelog --------- Co-authored-by: Lea Anthony --- v2/internal/frontend/desktop/linux/window.c | 16 +++++++++------- website/src/pages/changelog.mdx | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/v2/internal/frontend/desktop/linux/window.c b/v2/internal/frontend/desktop/linux/window.c index 2a71ba2ec..ca61bdf28 100644 --- a/v2/internal/frontend/desktop/linux/window.c +++ b/v2/internal/frontend/desktop/linux/window.c @@ -76,15 +76,17 @@ static gboolean onWayland() switch (wmIsWayland) { case -1: - char *gdkBackend = getenv("XDG_SESSION_TYPE"); - if(gdkBackend != NULL && strcmp(gdkBackend, "wayland") == 0) { - wmIsWayland = 1; - return TRUE; + char *gdkBackend = getenv("XDG_SESSION_TYPE"); + if(gdkBackend != NULL && strcmp(gdkBackend, "wayland") == 0) + { + wmIsWayland = 1; + return TRUE; + } + + wmIsWayland = 0; + return FALSE; } - - wmIsWayland = 0; - return FALSE; case 1: return TRUE; default: diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index eab7e8bc6..1eff73f5a 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `ContentProtection` option to allow hiding the application window from screen sharing software [#4241](https://github.com/wailsapp/wails/pull/4241) by [@Taiterbase](https://github.com/Taiterbase) - Added `build:tags` to project specification for automatically adding compilation tags by @symball in [PR](https://github.com/wailsapp/wails/pull/4439) +### Fixed +- Fixed C compilation error in onWayland on Linux due to declaration after label [#4446](https://github.com/wailsapp/wails/pull/4446) by [@jaesung9507](https://github.com/jaesung9507) + ## v2.10.2 - 2025-07-06 ### Fixed