From a1a7ba76899ee077c1dd4ba4d35cf14a6f887982 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 11 Jan 2002 05:08:44 +0000 Subject: [PATCH] Fixed problem with not saving all windows in a session when the shared application icon is enabled (only one instance/shared application was saved) --- ChangeLog | 2 ++ src/session.c | 9 +++++---- src/window.c | 2 ++ src/window.h | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 501af8ff..946406d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ Changes since version 0.80.0: - Fixed Legal Panel not to display rectangles in place of new lines. - Fixed problem with losing focus when changing to an empty workspace and back. - Fixed another focus related problem when changing workspaces. +- Fixed problem with saving session when shared appicon is enabled (not + all instances were saved in the session, only one per shared appicon) Changes since version 0.70.0: diff --git a/src/session.c b/src/session.c index 72c969e0..724594dd 100644 --- a/src/session.c +++ b/src/session.c @@ -220,8 +220,8 @@ makeWindowState(WWindow *wwin, WApplication *wapp) WMPropList *shaded, *miniaturized, *hidden, *geometry; WMPropList *dock, *shortcut; - if (wwin->main_window!=None && wwin->main_window!=wwin->client_win) - win = wwin->main_window; + if (wwin->orig_main_window!=None && wwin->orig_main_window!=wwin->client_win) + win = wwin->orig_main_window; else win = wwin->client_win; @@ -332,10 +332,11 @@ wSessionSaveState(WScreen *scr) while (wwin) { WApplication *wapp=wApplicationOf(wwin->main_window); + Window appId = wwin->orig_main_window; if ((wwin->transient_for==None || wwin->transient_for==wwin->screen_ptr->root_win) - && WMGetFirstInArray(wapp_list, wapp)==WANotFound + && WMGetFirstInArray(wapp_list, (void*)appId)==WANotFound && !WFLAGP(wwin, dont_save_session)) { /* A entry for this application was not yet saved. Save one. */ if ((win_info = makeWindowState(wwin, wapp))!=NULL) { @@ -346,7 +347,7 @@ wSessionSaveState(WScreen *scr) * application list, so no multiple entries for the same * application are saved. */ - WMAddToArray(wapp_list, wapp); + WMAddToArray(wapp_list, (void*)appId); } } wwin = wwin->prev; diff --git a/src/window.c b/src/window.c index 45274eff..73c806d4 100644 --- a/src/window.c +++ b/src/window.c @@ -807,6 +807,8 @@ wManageWindow(WScreen *scr, Window window) wwin->main_window = wwin->client_win; } + wwin->orig_main_window = wwin->main_window; + if (wwin->flags.is_gnustep) { WSETUFLAG(wwin, shared_appicon, 0); } diff --git a/src/window.h b/src/window.h index 2bd89631..5d8f6d05 100644 --- a/src/window.h +++ b/src/window.h @@ -229,6 +229,9 @@ typedef struct WWindow { Window main_window; /* main window for the application */ + Window orig_main_window; /* original main window of application. + used for the shared appicon thing */ + int cmap_window_no; Window *cmap_windows;