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

Remove code duplication by calling removeAppIconFor()

The function removeAppIconFor() does exactly the same thing as the code inside
wApplicationDestroy(), including the last call to wArrangeIcons(). So let's
simply remove the code and call the function instead.
This commit is contained in:
Rodolfo García Peñas (kix)
2012-06-01 18:57:43 +02:00
committed by Carlos R. Mafra
parent fbab31b798
commit e8074ae1cd

View File

@@ -365,25 +365,9 @@ void wApplicationDestroy(WApplication * wapp)
wAppMenuDestroy(wapp->menu); wAppMenuDestroy(wapp->menu);
wApplicationDeactivate(wapp); wApplicationDeactivate(wapp);
if (wapp->app_icon) { /* Remove application icon */
if (wapp->app_icon->docked && !wapp->app_icon->attracted) { removeAppIconFor(wapp);
wapp->app_icon->running = 0;
/* since we keep it, we don't care if it was attracted or not */
wapp->app_icon->attracted = 0;
wapp->app_icon->icon->shadowed = 0;
wapp->app_icon->main_window = None;
wapp->app_icon->pid = 0;
wapp->app_icon->icon->owner = NULL;
wapp->app_icon->icon->icon_win = None;
wapp->app_icon->icon->force_paint = 1;
wAppIconPaint(wapp->app_icon);
} else if (wapp->app_icon->docked) {
wapp->app_icon->running = 0;
wDockDetach(wapp->app_icon->dock, wapp->app_icon);
} else {
wAppIconDestroy(wapp->app_icon);
}
}
wwin = wWindowFor(wapp->main_window_desc->client_win); wwin = wWindowFor(wapp->main_window_desc->client_win);
wWindowDestroy(wapp->main_window_desc); wWindowDestroy(wapp->main_window_desc);
@@ -393,9 +377,6 @@ void wApplicationDestroy(WApplication * wapp)
XSaveContext(dpy, wwin->client_win, wWinContext, (XPointer) & wwin->client_descriptor); XSaveContext(dpy, wwin->client_win, wWinContext, (XPointer) & wwin->client_descriptor);
} }
wfree(wapp); wfree(wapp);
if (wPreferences.auto_arrange_icons)
wArrangeIcons(scr, True);
} }
void wApplicationActivate(WApplication *wapp) void wApplicationActivate(WApplication *wapp)