From 0a03ff03d75e12e8273d9f8ea4bffc01245ce8e3 Mon Sep 17 00:00:00 2001 From: Ollie Date: Thu, 28 May 2026 22:18:37 +0200 Subject: [PATCH] =?UTF-8?q?wl=5Fbackend:=20fix=20prop=5Fget=5Fwm=5Fclass?= =?UTF-8?q?=20return=20value=20(0=3Dfail,=201=3Dsuccess)=20=E2=80=94=20bro?= =?UTF-8?q?ke=20session=20save?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ROADMAP.md | 6 +++++- src/backend/wayland/wl_backend.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 1dd7eda..a64d536 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -34,8 +34,12 @@ positions are tracked in `WWindow` (backend-neutral). The only concern is matching restored sessions to native XDG clients via `app_id` instead of `WM_CLASS`. +- [x] Save/restore state for Wayland native clients: `PropGetWMClass` already + returns the XDG `app_id` on Wayland. Session save no longer bails when + `GetCommandForWindow` returns NULL (external Wayland clients have no ICCCM + command). Restore matches by `app_id` via instance+class without requiring + a command. - [ ] Test: save session, restart compositor, verify window positions restored -- [ ] Add `app_id` to session file alongside `WM_CLASS` for native XDG clients - [ ] Verify dock state persistence (icon layout in `~/GNUstep/Defaults/`) ### 1.2 Multi-Monitor diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index d3f4038..379abeb 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -7067,14 +7067,14 @@ wl_prop_get_wm_class(WNativeWindow win, if (v && v->xw_surface) { *wm_class = strdup(v->xw_surface->class ? v->xw_surface->class : "x11-client"); *wm_instance = strdup(v->xw_surface->instance ? v->xw_surface->instance : "x11-client"); - return 0; + return 1; } const char *app_id = (v && v->xdg_surface && v->xdg_surface->toplevel && v->xdg_surface->toplevel->app_id) ? v->xdg_surface->toplevel->app_id : "wayland-client"; *wm_class = strdup(app_id); *wm_instance = strdup(app_id); - return 0; + return 1; } static Bool