session: debug prints in wl_prop_get_wm_class to diagnose xterm save failure

This commit is contained in:
Ollie 2026-05-28 22:34:36 +02:00
parent 0a03ff03d7
commit a117a9e437
2 changed files with 6 additions and 1 deletions

View File

@ -7065,13 +7065,18 @@ wl_prop_get_wm_class(WNativeWindow win,
/* Phase 41: use XDG app_id / Phase 17: use XWayland WM_CLASS. */
struct wl_toplevel_view *v = wl_find_view_by_id(win);
if (v && v->xw_surface) {
wwarning("wl_prop_get_wm_class: XWayland class=%s instance=%s",
v->xw_surface->class ? v->xw_surface->class : "(null)",
v->xw_surface->instance ? v->xw_surface->instance : "(null)");
*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 1;
}
wwarning("wl_prop_get_wm_class: NOT FOUND (v=%p) win=0x%lx", (void*)v, (unsigned long)win);
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";
wwarning("wl_prop_get_wm_class: using app_id=%s", app_id);
*wm_class = strdup(app_id);
*wm_instance = strdup(app_id);
return 1;

View File

@ -220,7 +220,7 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
snprintf(buffer, sizeof(buffer), ".");
name = WMCreatePLString(buffer);
cmd = WMCreatePLString(command);
cmd = command ? WMCreatePLString(command) : WMCreatePLString("");
workspace = WMCreatePLString(scr->workspaces[WIN_WORKSPACE(wwin)]->name);
shaded = wwin->flags.shaded ? sYes : sNo;