From f968d8807025f3e777b85f16cff031cec65c1059 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 21 Dec 2001 00:48:41 +0000 Subject: [PATCH] - Fixed problem with shared appicon on clients having an appmenu that is created after the application has mapped its window(s). This means that if you use wterm without an appmenu it will be able to use shared appicons, but as soon as you start one with an appmenu they will get separated appicons. --- src/client.c | 50 +++++++++++++++++++++++++++++++++++++++++++++----- src/window.c | 2 +- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/client.c b/src/client.c index f287fb53..297ba018 100644 --- a/src/client.c +++ b/src/client.c @@ -607,11 +607,51 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event) /* TODO: remake appmenu update */ wAppMenuDestroy(wapp->menu); } - wapp->menu = wAppMenuGet(wwin->screen_ptr, wwin->main_window); - /* make the appmenu be mapped */ - wSetFocusTo(wwin->screen_ptr, NULL); - wSetFocusTo(wwin->screen_ptr, - wwin->screen_ptr->focused_window); + if (wwin->fake_group) { + extern WPreferences wPreferences; + WScreen *scr = wwin->screen_ptr; + WWindow *foo = scr->focused_window; + WFakeGroupLeader *fPtr = wwin->fake_group; + + wApplicationDestroy(wapp); + while (foo) { + if (foo->fake_group && foo->fake_group==fPtr) { + WSETUFLAG(foo, shared_appicon, 0); + foo->fake_group = NULL; + if (foo->group_id!=None) + foo->main_window = foo->group_id; + else if (foo->client_leader!=None) + foo->main_window = foo->client_leader; + else if (WFLAGP(foo, emulate_appicon)) + foo->main_window = foo->client_win; + else + foo->main_window = None; + if (foo->main_window) { + wapp = wApplicationCreate(scr, foo->main_window); + } + } + foo = foo->prev; + } + + if (fPtr->leader!=None) + XDestroyWindow(dpy, fPtr->leader); + fPtr->retainCount = 0; + fPtr->leader = None; + fPtr->origLeader = None; + + wapp = wApplicationOf(wwin->main_window); + if (wapp) { + wapp->menu = wAppMenuGet(scr, wwin->main_window); + } + if (wPreferences.auto_arrange_icons) { + wArrangeIcons(wwin->screen_ptr, True); + } + } else { + wapp->menu = wAppMenuGet(wwin->screen_ptr, wwin->main_window); + } + /* make the appmenu be mapped */ + wSetFocusTo(wwin->screen_ptr, NULL); + wSetFocusTo(wwin->screen_ptr, wwin->screen_ptr->focused_window); } } else if (event->atom==_XA_GNUSTEP_WM_ATTR) { GNUstepWMAttributes *attr; diff --git a/src/window.c b/src/window.c index 91f03310..c321e306 100644 --- a/src/window.c +++ b/src/window.c @@ -807,7 +807,7 @@ wManageWindow(WScreen *scr, Window window) WSETUFLAG(wwin, shared_appicon, 0); } - { + if (wwin->main_window) { extern Atom _XA_WINDOWMAKER_MENU; XTextProperty text_prop;