diff --git a/src/actions.c b/src/actions.c index ad1a69b7..43b4906c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1704,154 +1704,6 @@ void wArrangeIcons(WScreen * scr, Bool arrangeAll) wfree(vars); } -#if 0 -void wArrangeIcons(WScreen * scr, Bool arrangeAll) -{ - WWindow *wwin; - WAppIcon *aicon; - int pf; /* primary axis */ - int sf; /* secondary axis */ - int fullW; - int fullH; - int pi, si; - int sx1, sx2, sy1, sy2; /* screen boundary */ - int sw, sh; - int xo, yo; - int xs, ys; - int isize = wPreferences.icon_size; - - /* - * Find out screen boundaries. - */ - - /* - * Allows each head to have miniwindows - */ - WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr)); - - sx1 = rect.pos.x; - sy1 = rect.pos.y; - sw = rect.size.width; - sh = rect.size.height; - sx2 = sx1 + sw; - sy2 = sy1 + sh; - if (scr->dock) { - if (scr->dock->on_right_side) - sx2 -= isize + DOCK_EXTRA_SPACE; - else - sx1 += isize + DOCK_EXTRA_SPACE; - } -#if 0 - sw = isize * (scr->scr_width / isize); - sh = isize * (scr->scr_height / isize); -#else - sw = isize * (sw / isize); - sh = isize * (sh / isize); -#endif - fullW = (sx2 - sx1) / isize; - fullH = (sy2 - sy1) / isize; - - /* icon yard boundaries */ - if (wPreferences.icon_yard & IY_VERT) { - pf = fullH; - sf = fullW; - } else { - pf = fullW; - sf = fullH; - } - if (wPreferences.icon_yard & IY_RIGHT) { - xo = sx2 - isize; - xs = -1; - } else { - xo = sx1; - xs = 1; - } - if (wPreferences.icon_yard & IY_TOP) { - yo = sy1; - ys = 1; - } else { - yo = sy2 - isize; - ys = -1; - } - - /* arrange icons putting the most recently focused window - * as the last icon */ -#define X ((wPreferences.icon_yard & IY_VERT) ? xo + xs*(si*isize)\ - : xo + xs*(pi*isize)) -#define Y ((wPreferences.icon_yard & IY_VERT) ? yo + ys*(pi*isize)\ - : yo + ys*(si*isize)) - - /* arrange application icons */ - aicon = scr->app_icon_list; - /* reverse them to avoid unnecessarily sliding of icons */ - while (aicon && aicon->next) - aicon = aicon->next; - - pi = 0; - si = 0; - while (aicon) { - if (!aicon->docked) { - if (aicon->x_pos != X || aicon->y_pos != Y) { -#ifdef ANIMATIONS - if (!wPreferences.no_animations) { - SlideWindow(aicon->icon->core->window, aicon->x_pos, aicon->y_pos, X, Y); - } -#endif /* ANIMATIONS */ - } - wAppIconMove(aicon, X, Y); - pi++; - } - /* we reversed the order so we use prev */ - aicon = aicon->prev; - if (pi >= pf) { - pi = 0; - si++; - } - } - - /* arrange miniwindows */ - - wwin = scr->focused_window; - /* reverse them to avoid unnecessarily shuffling */ - while (wwin && wwin->prev) - wwin = wwin->prev; - - while (wwin) { - if (wwin->icon && wwin->flags.miniaturized && !wwin->flags.hidden && - (wwin->frame->workspace == scr->current_workspace || - IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)) { - - if (arrangeAll || !wwin->flags.icon_moved) { - if (wwin->icon_x != X || wwin->icon_y != Y) { -#ifdef ANIMATIONS - if (wPreferences.no_animations) { - XMoveWindow(dpy, wwin->icon->core->window, X, Y); - } else { - SlideWindow(wwin->icon->core->window, wwin->icon_x, - wwin->icon_y, X, Y); - } -#else - XMoveWindow(dpy, wwin->icon->core->window, X, Y); -#endif /* ANIMATIONS */ - } - wwin->icon_x = X; - wwin->icon_y = Y; - pi++; - } - } - if (arrangeAll) { - wwin->flags.icon_moved = 0; - } - /* we reversed the order, so we use next */ - wwin = wwin->next; - if (pi >= pf) { - pi = 0; - si++; - } - } -} -#endif - void wSelectWindow(WWindow * wwin, Bool flag) { WScreen *scr = wwin->screen_ptr; diff --git a/src/screen.c b/src/screen.c index 0819a9fd..58649f95 100644 --- a/src/screen.c +++ b/src/screen.c @@ -860,85 +860,6 @@ void wScreenUpdateUsableArea(WScreen * scr) wArrangeIcons(scr, True); } -#if 0 -void wScreenUpdateUsableArea(WScreen * scr) -{ - scr->totalUsableArea = scr->usableArea; - - if (scr->dock && (!scr->dock->lowered || wPreferences.no_window_over_dock)) { - - int offset = wPreferences.icon_size + DOCK_EXTRA_SPACE; - - if (scr->dock->on_right_side) { - scr->totalUsableArea.x2 = WMIN(scr->totalUsableArea.x2, scr->scr_width - offset); - } else { - scr->totalUsableArea.x1 = WMAX(scr->totalUsableArea.x1, offset); - } - } - - if (wPreferences.no_window_over_icons) { - if (wPreferences.icon_yard & IY_VERT) { - - if (!(wPreferences.icon_yard & IY_RIGHT)) { - scr->totalUsableArea.x1 += wPreferences.icon_size; - } else { - scr->totalUsableArea.x2 -= wPreferences.icon_size; - } - } else { - - if (wPreferences.icon_yard & IY_TOP) { - scr->totalUsableArea.y1 += wPreferences.icon_size; - } else { - scr->totalUsableArea.y2 -= wPreferences.icon_size; - } - } - } -#ifdef NETWM_HINTS - { - WArea area; - if (wNETWMGetUsableArea(scr, &area)) { - scr->totalUsableArea.x1 = WMAX(scr->totalUsableArea.x1, area.x1); - scr->totalUsableArea.y1 = WMAX(scr->totalUsableArea.y1, area.y1); - scr->totalUsableArea.x2 = WMIN(scr->totalUsableArea.x2, area.x2); - scr->totalUsableArea.y2 = WMIN(scr->totalUsableArea.y2, area.y2); - } - } -#endif - - if (scr->totalUsableArea.x2 - scr->totalUsableArea.x1 < scr->scr_width / 2) { - scr->totalUsableArea.x2 = scr->usableArea.x2; - scr->totalUsableArea.x1 = scr->usableArea.x1; - } - if (scr->totalUsableArea.y2 - scr->totalUsableArea.y1 < scr->scr_height / 2) { - scr->totalUsableArea.y2 = scr->usableArea.y2; - scr->totalUsableArea.y1 = scr->usableArea.y1; - } -#ifdef NETWM_HINTS - wNETWMUpdateWorkarea(scr); -#endif - - { - unsigned size = wPreferences.workspace_border_size; - unsigned position = wPreferences.workspace_border_position; - - if (size > 0 && position != WB_NONE) { - if (position & WB_LEFTRIGHT) { - scr->totalUsableArea.x1 += size; - scr->totalUsableArea.x2 -= size; - } - if (position & WB_TOPBOTTOM) { - scr->totalUsableArea.y1 += size; - scr->totalUsableArea.y2 -= size; - } - } - } - - if (wPreferences.auto_arrange_icons) { - wArrangeIcons(scr, True); - } -} -#endif - void wScreenRestoreState(WScreen * scr) { WMPropList *state;