mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
- Fixed xmms problem with shared appicons
- Fixed a problem with saving user defaults for windows after the shared appicon changes. - Fixed GNUstep apps not to show 2 appicons.
This commit is contained in:
@@ -52,5 +52,6 @@
|
||||
xmixer = {Icon = mixer.#extension#;};
|
||||
xmcd = {Icon = Radio.xpm;};
|
||||
xplaycd = {Icon = Radio.xpm;};
|
||||
xmms.Xmms = {NoAppIcon = Yes;};
|
||||
"*" = {Icon = defaultAppIcon.#extension#;SharedAppIcon = Yes;};
|
||||
}
|
||||
|
||||
@@ -3203,7 +3203,7 @@ retry:
|
||||
}
|
||||
found = True;
|
||||
if (!wPreferences.no_animations && !icon->launching &&
|
||||
!dock->screen_ptr->flags.startup) {
|
||||
!dock->screen_ptr->flags.startup && !dock->collapsed) {
|
||||
WAppIcon *aicon;
|
||||
int x0, y0;
|
||||
|
||||
|
||||
@@ -556,8 +556,8 @@ handleDestroyNotify(XEvent *event)
|
||||
wUnmanageWindow(wwin, False, True);
|
||||
}
|
||||
|
||||
index = WMFindInArray(scr->fakeGroupLeaders, matchWindow, (void*)window);
|
||||
if (index != WANotFound) {
|
||||
while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow,
|
||||
(void*)window)) != WANotFound) {
|
||||
WFakeGroupLeader *fPtr;
|
||||
|
||||
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
|
||||
|
||||
45
src/window.c
45
src/window.c
@@ -793,6 +793,10 @@ wManageWindow(WScreen *scr, Window window)
|
||||
}
|
||||
#endif /* OLWM_HINTS */
|
||||
|
||||
if (wwin->flags.is_gnustep) {
|
||||
WSETUFLAG(wwin, shared_appicon, 0);
|
||||
}
|
||||
|
||||
/* Make broken apps behave as a nice app. */
|
||||
if (WFLAGP(wwin, emulate_appicon)) {
|
||||
wwin->main_window = wwin->client_win;
|
||||
@@ -803,6 +807,8 @@ wManageWindow(WScreen *scr, Window window)
|
||||
WFakeGroupLeader *fPtr;
|
||||
int index;
|
||||
|
||||
#define ADEQUATE(x) ((x)!=None && (x)!=wwin->client_win && (x)!=fPtr->leader)
|
||||
|
||||
PropGetWMClass(wwin->main_window, &class, &instance);
|
||||
buffer = wmalloc(strlen(instance)+strlen(class)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
@@ -815,9 +821,25 @@ wManageWindow(WScreen *scr, Window window)
|
||||
instance, class);
|
||||
}
|
||||
fPtr->retainCount++;
|
||||
if (wwin->main_window!=wwin->client_win && fPtr->origLeader==None) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->main_window;
|
||||
#undef method2
|
||||
if (fPtr->origLeader==None) {
|
||||
#ifdef method2
|
||||
if (ADEQUATE(wwin->group_id)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->group_id;
|
||||
} else if (ADEQUATE(wwin->client_leader)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->client_leader;
|
||||
} else if (ADEQUATE(wwin->main_window)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->main_window;
|
||||
}
|
||||
#else
|
||||
if (ADEQUATE(wwin->main_window)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->main_window;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
wwin->fake_group = fPtr;
|
||||
/*wwin->group_id = fPtr->leader;*/
|
||||
@@ -834,10 +856,23 @@ wManageWindow(WScreen *scr, Window window)
|
||||
|
||||
WMAddToArray(scr->fakeGroupLeaders, fPtr);
|
||||
|
||||
if (wwin->main_window!=wwin->client_win) {
|
||||
#ifdef method2
|
||||
if (ADEQUATE(wwin->group_id)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->group_id;
|
||||
} else if (ADEQUATE(wwin->client_leader)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->client_leader;
|
||||
} else if (ADEQUATE(wwin->main_window)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->main_window;
|
||||
}
|
||||
#else
|
||||
if (ADEQUATE(wwin->main_window)) {
|
||||
fPtr->retainCount++;
|
||||
fPtr->origLeader = wwin->main_window;
|
||||
}
|
||||
#endif
|
||||
wwin->fake_group = fPtr;
|
||||
/*wwin->group_id = fPtr->leader;*/
|
||||
wwin->main_window = fPtr->leader;
|
||||
@@ -847,6 +882,8 @@ wManageWindow(WScreen *scr, Window window)
|
||||
if (class)
|
||||
XFree(class);
|
||||
|
||||
#undef method2
|
||||
#undef ADEQUATE
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
126
src/winspector.c
126
src/winspector.c
@@ -512,14 +512,14 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
WWindow *wwin = panel->inspected;
|
||||
WDDomain *db = WDWindowAttributes;
|
||||
WMPropList *dict = db->dictionary;
|
||||
WMPropList *winDic, *value, *key;
|
||||
WMPropList *winDic, *appDic, *value, *key, *key2;
|
||||
char *icon_file;
|
||||
int flags = 0;
|
||||
int different = 0;
|
||||
int different = 0, different2 = 0;
|
||||
|
||||
/* Save will apply the changes and save them */
|
||||
applySettings(panel->applyBtn, panel);
|
||||
|
||||
|
||||
if (WMGetButtonSelected(panel->instRb) != 0)
|
||||
key = WMCreatePLString(wwin->wm_instance);
|
||||
else if (WMGetButtonSelected(panel->clsRb) != 0)
|
||||
@@ -557,6 +557,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
WMPLSetCaseSensitive(True);
|
||||
|
||||
winDic = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
appDic = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
|
||||
/* Update icon for window */
|
||||
icon_file = WMGetTextFieldText(panel->fileText);
|
||||
@@ -564,6 +565,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
if (icon_file[0] != 0) {
|
||||
value = WMCreatePLString(icon_file);
|
||||
different |= insertAttribute(dict, winDic, AIcon, value, flags);
|
||||
different2 |= insertAttribute(dict, appDic, AIcon, value, flags);
|
||||
WMReleasePropList(value);
|
||||
}
|
||||
wfree(icon_file);
|
||||
@@ -650,19 +652,58 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
different |= insertAttribute(dict, winDic, ANoLanguageButton, value, flags);
|
||||
#endif
|
||||
|
||||
/* application wide settings for when */
|
||||
/* the window is the leader, save the attribute with the others */
|
||||
if (panel->inspected->main_window == panel->inspected->client_win) {
|
||||
|
||||
value = (WMGetButtonSelected(panel->appChk[0])!=0) ? Yes : No;
|
||||
different |= insertAttribute(dict, winDic, AStartHidden, value, flags);
|
||||
value = (WMGetButtonSelected(panel->appChk[0])!=0) ? Yes : No;
|
||||
different2 |= insertAttribute(dict, appDic, AStartHidden, value, flags);
|
||||
|
||||
value = (WMGetButtonSelected(panel->appChk[1])!=0) ? Yes : No;
|
||||
different |= insertAttribute(dict, winDic, ANoAppIcon, value, flags);
|
||||
|
||||
value = (WMGetButtonSelected(panel->appChk[2])!=0) ? Yes : No;
|
||||
different |= insertAttribute(dict, winDic, ASharedAppIcon, value, flags);
|
||||
}
|
||||
value = (WMGetButtonSelected(panel->appChk[1])!=0) ? Yes : No;
|
||||
different2 |= insertAttribute(dict, appDic, ANoAppIcon, value, flags);
|
||||
|
||||
value = (WMGetButtonSelected(panel->appChk[2])!=0) ? Yes : No;
|
||||
different2 |= insertAttribute(dict, appDic, ASharedAppIcon, value, flags);
|
||||
|
||||
if (panel->inspected->fake_group) {
|
||||
key2 = WMCreatePLString(panel->inspected->fake_group->identifier);
|
||||
if (WMIsPropListEqualTo(key, key2)) {
|
||||
WMMergePLDictionaries(winDic, appDic, True);
|
||||
different |= different2;
|
||||
} else {
|
||||
WMRemoveFromPLDictionary(dict, key2);
|
||||
if (different2) {
|
||||
WMPutInPLDictionary(dict, key2, appDic);
|
||||
}
|
||||
}
|
||||
WMReleasePropList(key2);
|
||||
WMReleasePropList(appDic);
|
||||
} else if (panel->inspected->main_window != panel->inspected->client_win) {
|
||||
WApplication *wapp = wApplicationOf(panel->inspected->main_window);
|
||||
|
||||
if (wapp) {
|
||||
char *instance = wapp->main_window_desc->wm_instance;
|
||||
char *class = wapp->main_window_desc->wm_class;
|
||||
char *buffer;
|
||||
|
||||
buffer = wmalloc(strlen(instance)+strlen(class)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
key2 = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
|
||||
if (WMIsPropListEqualTo(key, key2)) {
|
||||
WMMergePLDictionaries(winDic, appDic, True);
|
||||
different |= different2;
|
||||
} else {
|
||||
WMRemoveFromPLDictionary(dict, key2);
|
||||
if (different2) {
|
||||
WMPutInPLDictionary(dict, key2, appDic);
|
||||
}
|
||||
}
|
||||
WMReleasePropList(key2);
|
||||
WMReleasePropList(appDic);
|
||||
}
|
||||
} else {
|
||||
WMMergePLDictionaries(winDic, appDic, True);
|
||||
different |= different2;
|
||||
WMReleasePropList(appDic);
|
||||
}
|
||||
|
||||
WMRemoveFromPLDictionary(dict, key);
|
||||
if (different) {
|
||||
@@ -672,61 +713,6 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
WMReleasePropList(key);
|
||||
WMReleasePropList(winDic);
|
||||
|
||||
different = 0;
|
||||
|
||||
/* application wide settings */
|
||||
if (panel->inspected->main_window != panel->inspected->client_win
|
||||
&& !(flags & UPDATE_DEFAULTS)) {
|
||||
WApplication *wapp;
|
||||
WMPropList *appDic;
|
||||
|
||||
wapp = wApplicationOf(panel->inspected->main_window);
|
||||
if (wapp) {
|
||||
char *instance = wapp->main_window_desc->wm_instance;
|
||||
char *class = wapp->main_window_desc->wm_class;
|
||||
char *iconFile, *buffer;
|
||||
|
||||
appDic = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
|
||||
assert(instance!=NULL);
|
||||
assert(class!=NULL);
|
||||
|
||||
buffer = wmalloc(strlen(instance)+strlen(class)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
key = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
|
||||
iconFile = wDefaultGetIconFile(wwin->screen_ptr,
|
||||
instance, class, False);
|
||||
|
||||
if (iconFile && iconFile[0]!=0) {
|
||||
value = WMCreatePLString(iconFile);
|
||||
different |= insertAttribute(dict, appDic, AIcon, value,
|
||||
flags&~IS_BOOLEAN);
|
||||
WMReleasePropList(value);
|
||||
}
|
||||
|
||||
value = (WMGetButtonSelected(panel->appChk[0])!=0) ? Yes : No;
|
||||
different |= insertAttribute(dict, appDic, AStartHidden, value,
|
||||
flags);
|
||||
|
||||
value = (WMGetButtonSelected(panel->appChk[1])!=0) ? Yes : No;
|
||||
different |= insertAttribute(dict, appDic, ANoAppIcon, value,
|
||||
flags);
|
||||
|
||||
value = (WMGetButtonSelected(panel->appChk[2])!=0) ? Yes : No;
|
||||
different |= insertAttribute(dict, appDic, ASharedAppIcon, value,
|
||||
flags);
|
||||
|
||||
WMRemoveFromPLDictionary(dict, key);
|
||||
if (different) {
|
||||
WMPutInPLDictionary(dict, key, appDic);
|
||||
}
|
||||
WMReleasePropList(key);
|
||||
WMReleasePropList(appDic);
|
||||
}
|
||||
}
|
||||
|
||||
WMWritePropListToFile(dict, db->path, True);
|
||||
|
||||
/* clean up */
|
||||
|
||||
Reference in New Issue
Block a user