1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Allow WM_COMMAND-less app to autostart

For apps which are not setting the window WM_COMMAND property like those old
apps using Motif toolkit (I am thinking of NEdit for example)
it's bringing some issues in windowmaker which is relying on it for a few interactions.
Especially,
*an app without WM_COMMAND will not be saved during the workspace state
(so session restore is not working for them)
*when added to the dock, the settings parameters are empty and need to be filled
*cannot autostart from the dock (even if the settings are manually filled and saved)
*right click on the app titlebar, and choosing Launch has no effect

The patch below allows the workspace state to be saved for those apps without WM_COMMAND
that have been launched from the dock. We are just reusing what have been set in the
Application Path Settings of the dock app (and it does not require extra libs like libXRes).
This commit is contained in:
David Maciejak
2023-02-20 06:24:44 +08:00
committed by Carlos R. Mafra
parent fabd4252ab
commit 5ee19c2308

View File

@@ -183,8 +183,13 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
win = wwin->client_win;
command = GetCommandForWindow(win);
if (!command)
return NULL;
if (!command) {
if (wapp->app_icon && wapp->app_icon->command) {
command = wmalloc(strlen(wapp->app_icon->command));
strcpy(command, wapp->app_icon->command);
} else
return NULL;
}
if (PropGetWMClass(win, &class, &instance)) {
if (class && instance)