1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 15:12:32 +01:00

- improved behaviour for the shared appicon thing.

- added a 'Bool recursive' flag to WMMergePLDictionaries() in WINGs
This commit is contained in:
dan
2001-12-17 14:46:31 +00:00
parent 672c42cc48
commit 90c77b1a45
17 changed files with 81 additions and 32 deletions

View File

@@ -512,7 +512,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
else
wwin->flags.urgent = 0;
} else if (wwin->fake_group!=NULL) {
wwin->group_id = wwin->fake_group->window;
wwin->group_id = wwin->fake_group->leader;
} else {
wwin->group_id = None;
}

View File

@@ -989,7 +989,7 @@ wDefaultsInitDomain(char *domain, Bool requireDictionary)
} else {
if (db->dictionary && WMIsPLDictionary(shared_dict) &&
WMIsPLDictionary(db->dictionary)) {
WMMergePLDictionaries(shared_dict, db->dictionary);
WMMergePLDictionaries(shared_dict, db->dictionary, True);
WMReleasePropList(db->dictionary);
db->dictionary = shared_dict;
if (stbuf.st_mtime > db->timestamp)
@@ -1087,7 +1087,7 @@ wDefaultsCheckDomains(void *foo)
"WindowMaker", WDWindowMaker->path);
} else {
if (shared_dict) {
WMMergePLDictionaries(shared_dict, dict);
WMMergePLDictionaries(shared_dict, dict, True);
WMReleasePropList(dict);
dict = shared_dict;
shared_dict = NULL;

View File

@@ -237,7 +237,7 @@ toggleLoweredCallback(WMenu *menu, WMenuEntry *entry)
static int
matchWindow(void *item, void *cdata)
{
return (((WFakeGroupLeader*)item)->window == (Window)cdata);
return (((WFakeGroupLeader*)item)->leader == (Window)cdata);
}

View File

@@ -439,6 +439,13 @@ saveTimestamp(XEvent *event)
}
static int
matchWindow(void *item, void *cdata)
{
return (((WFakeGroupLeader*)item)->origLeader == (Window)cdata);
}
static void
handleExtensions(XEvent *event)
{
@@ -538,6 +545,8 @@ handleDestroyNotify(XEvent *event)
WWindow *wwin;
WApplication *app;
Window window = event->xdestroywindow.window;
WScreen *scr = wScreenForRootWindow(event->xdestroywindow.event);
int index;
#ifdef DEBUG
L("got destroy notify");
@@ -547,6 +556,23 @@ handleDestroyNotify(XEvent *event)
wUnmanageWindow(wwin, False, True);
}
index = WMFindInArray(scr->fakeGroupLeaders, matchWindow, (void*)window);
if (index != WANotFound) {
WFakeGroupLeader *fPtr;
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
if (fPtr->retainCount > 0) {
fPtr->retainCount--;
if (fPtr->retainCount==0 && fPtr->leader!=None) {
XDestroyWindow(dpy, fPtr->leader);
fPtr->leader = None;
XFlush(dpy);
}
}
fPtr->origLeader = None;
}
app = wApplicationOf(window);
if (app) {
if (window == app->main_window) {

View File

@@ -540,7 +540,7 @@ wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file)
if ((attr = WMGetFromPLDictionary(dict, key)) != NULL) {
if (WMIsPLDictionary(attr)) {
if (icon_value!=NULL && !same)
WMMergePLDictionaries(attr, icon_value);
WMMergePLDictionaries(attr, icon_value, False);
else
WMRemoveFromPLDictionary(attr, AIcon);
}

View File

@@ -238,13 +238,13 @@ wWindowDestroy(WWindow *wwin)
}
}
if (wwin->fake_group) {
if (wwin->fake_group->retainCount > 0)
wwin->fake_group->retainCount--;
if (wwin->fake_group->retainCount==0 && wwin->fake_group->window!=None) {
XDestroyWindow(dpy, wwin->fake_group->window);
wwin->fake_group->window = None;
XFlush(dpy);
if (wwin->fake_group && wwin->fake_group->retainCount>0) {
wwin->fake_group->retainCount--;
if (wwin->fake_group->retainCount==0 && wwin->fake_group->leader!=None) {
XDestroyWindow(dpy, wwin->fake_group->leader);
wwin->fake_group->leader = None;
wwin->fake_group->origLeader = None;
XFlush(dpy);
}
}
@@ -811,27 +811,36 @@ wManageWindow(WScreen *scr, Window window)
if (index != WANotFound) {
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
if (fPtr->retainCount == 0) {
fPtr->window = createFakeWindowGroupLeader(scr, wwin->main_window,
fPtr->leader = createFakeWindowGroupLeader(scr, wwin->main_window,
instance, class);
}
fPtr->retainCount++;
if (wwin->main_window!=wwin->client_win && fPtr->origLeader==None) {
fPtr->retainCount++;
fPtr->origLeader = wwin->main_window;
}
wwin->fake_group = fPtr;
wwin->group_id = fPtr->window;
wwin->main_window = wwin->group_id;
//wwin->group_id = fPtr->leader;
wwin->main_window = fPtr->leader;
wfree(buffer);
} else {
fPtr = (WFakeGroupLeader*)wmalloc(sizeof(WFakeGroupLeader));
fPtr->identifier = buffer;
fPtr->window = createFakeWindowGroupLeader(scr, wwin->main_window,
fPtr->leader = createFakeWindowGroupLeader(scr, wwin->main_window,
instance, class);
fPtr->origLeader = None;
fPtr->retainCount = 1;
WMAddToArray(scr->fakeGroupLeaders, fPtr);
if (wwin->main_window!=wwin->client_win) {
fPtr->retainCount++;
fPtr->origLeader = wwin->main_window;
}
wwin->fake_group = fPtr;
wwin->group_id = fPtr->window;
wwin->main_window = wwin->group_id;
//wwin->group_id = fPtr->leader;
wwin->main_window = fPtr->leader;
}
if (instance)
XFree(instance);

View File

@@ -171,7 +171,8 @@ typedef struct {
*/
typedef struct WFakeGroupLeader {
char *identifier;
Window window;
Window leader;
Window origLeader;
int retainCount;
} WFakeGroupLeader;