1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

- removed the collapse appicons thing

- added real appicon sharing (apps of the same kind will have a single
  shared appicon).
This commit is contained in:
dan
2001-12-17 04:02:33 +00:00
parent 739fd1a567
commit 672c42cc48
19 changed files with 251 additions and 346 deletions

View File

@@ -270,8 +270,13 @@ wApplicationCreate(WScreen *scr, Window main_window)
wapp = wApplicationOf(main_window);
if (wapp) {
wapp->refcount++;
return wapp;
wapp->refcount++;
if (wapp->app_icon && wapp->app_icon->docked &&
wapp->app_icon->relaunching && wapp->main_window_desc->fake_group) {
wDockFinishLaunch(wapp->app_icon->dock, wapp->app_icon);
}
return wapp;
}
wapp = wmalloc(sizeof(WApplication));
@@ -330,7 +335,7 @@ wApplicationCreate(WScreen *scr, Window main_window)
break;
}
}
if (wapp->app_icon) {
WWindow *mainw = wapp->main_window_desc;
@@ -413,56 +418,7 @@ wApplicationCreate(WScreen *scr, Window main_window)
if (!tmp)
extractClientIcon(wapp->app_icon);
}
/* set the application instance index */
{
WApplication *list = scr->wapp_list;
WApplication *prev = NULL;
int index = 0;
WWindow *wwin = wapp->main_window_desc;
/*
if (!WFLAGP(wwin, collapse_appicons))
return 0;
*/
#define Xstreql(a, b) ((a) == (b) || (a && b && strcmp(a, b)==0))
/* look for a free index # */
while (list) {
if (Xstreql(wwin->wm_instance,
list->main_window_desc->wm_instance)
&&
Xstreql(wwin->wm_class,
list->main_window_desc->wm_class)) {
if (list->index == index) {
index++;
/* restart list traversal */
list = scr->wapp_list;
prev = NULL;
continue;
}
}
prev = list;
list = list->next;
}
wapp->index = index;
wapp->next = NULL;
wapp->prev = NULL;
/* append to app list */
if (!prev) {
scr->wapp_list = wapp;
} else {
prev->next = wapp;
wapp->prev = prev;
}
}
wSoundPlay(WSOUND_APPSTART);
#ifdef DEBUG
@@ -545,41 +501,3 @@ wApplicationDestroy(WApplication *wapp)
void
wApplicationSetCollapse(WApplication *app, Bool flag)
{
WApplication *list = app->main_window_desc->screen_ptr->wapp_list;
WWindow *wwin = app->main_window_desc;
if (WFLAGP(app->main_window_desc, collapse_appicons) == flag)
return;
while (list) {
if (strcmp(wwin->wm_instance,
list->main_window_desc->wm_instance) == 0
&&
strcmp(wwin->wm_class,
list->main_window_desc->wm_class) == 0)
WSETUFLAG(list->main_window_desc, collapse_appicons, flag);
list = list->next;
}
if (app->app_icon && flag)
wAppIconMove(app->app_icon, app->app_icon->x_pos, app->app_icon->y_pos);
}
/*
* Returns index number of the app in case there are more than
* one instance of the same class/name.
*/
int
wApplicationIndexOfGroup(WApplication *app)
{
return app->index;
}