From 3b5d36a70669ab3990031a4e6646d0180692e6ce Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Wed, 20 Dec 2023 01:28:17 +0100 Subject: [PATCH 1/2] set the WM_CLASS res_class = res_name and not GNUstep, so that it is the App name from NSProcessInfo, that way certaain windowmanagers (e.g. Xfce) can group windows per application, and not lump all GS apps together --- Source/x11/XGServerWindow.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index 1add4321..c98a7071 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -1,3 +1,4 @@ + /* XGServerWindows - methods for window/screen handling Copyright (C) 1999-2020 Free Software Foundation, Inc. @@ -1939,10 +1940,10 @@ - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style &window->xwn_attrs); /* - * Mark this as a GNUstep app with the current application name. + * Mark the window as the application with name & class so the WM can group it */ classhint.res_name = generic.rootName; - classhint.res_class = "GNUstep"; + classhint.res_class = generic.rootName; XSetClassHint(dpy, window->ident, &classhint); window->map_state = IsUnmapped; From 64b76b85c7faa56d16f206934ded25821fedcea4 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 23 Dec 2025 01:22:27 +0100 Subject: [PATCH 2/2] Use Process Name as Windows Group Identifier, less verbose and more user-friendly than full bundle identifier alternative. --- Source/x11/XGServerWindow.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index c98a7071..686d1421 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -1,4 +1,3 @@ - /* XGServerWindows - methods for window/screen handling Copyright (C) 1999-2020 Free Software Foundation, Inc. @@ -1942,8 +1941,9 @@ - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style /* * Mark the window as the application with name & class so the WM can group it */ + const char *procName = [[[NSProcessInfo processInfo] processName] UTF8String]; classhint.res_name = generic.rootName; - classhint.res_class = generic.rootName; + classhint.res_class = (char *)procName; XSetClassHint(dpy, window->ident, &classhint); window->map_state = IsUnmapped;