rem: if (wwin->transient_for==None && WMGetFirstInBag(wapp_list, wapp)<0
add: if (wwin->transient_for==None && WMGetFirstInBag(wapp_list, wapp)==WBNotFound
context: wSessionSaveState(WScreen *scr){    WWindow *wwin = scr->focused_window;    proplist_t win_info, wks;    proplist_t list=NULL;    WMBag *wapp_list=NULL;    make_keys();    if (!scr->session_state) {        scr->session_state = PLMakeDictionaryFromEntries(NULL, NULL, NULL);        if (!scr->session_state)            return;    }    list = PLMakeArrayFromElements(NULL);    wapp_list = WMCreateBag(16);    while (wwin) {        WApplication *wapp=wApplicationOf(wwin->main_window);        if (wwin->transient_for==None && WMGetFirstInBag(wapp_list, wapp)<0	    && !WFLAGP(wwin, dont_save_session)) {            /* A entry for this application was not yet saved. Save one. */            if ((win_info = makeWindowState(wwin, wapp))!=NULL) {                list = PLAppendArrayElement(list, win_info);                PLRelease(win_info);                /* If we were succesful in saving the info for this window                 * add the application the window belongs to, to the                 * application list, so no multiple entries for the same                 * application are saved.                 */		WMPutInBag(wapp_list, wapp);            }        }        wwin = wwin->prev;    }    PLRemoveDictionaryEntry(scr->session_state, sApplications);    PLInsertDictionaryEntry(scr->session_state, sApplications, list);    PLRelease(list);    wks = PLMakeString(scr->workspaces[scr->current_workspace]->name);    PLInsertDictionaryEntry(scr->session_state, sWorkspace, wks);    PLRelease(wks);    WMFreeBag(wapp_list);}