From ad0ae4887fc14715aedf803633e8bf53feb31adc Mon Sep 17 00:00:00 2001 From: dan Date: Sun, 3 Jul 2005 17:37:03 +0000 Subject: [PATCH] - new algorithm for placing miniwindows after unhiding the application they belong to, that works without auto-arranging the icons, while still avoiding multiple icons in the same spot by moving the miniwindows to a new slot if their old slot was occupied in the meantime. - double clicking an appicon will also raise the miniwindows that belong to that application to the front (along with the normal windows). --- ChangeLog | 6 ++++++ src/actions.c | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c80b051..94a94b81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,12 @@ Changes since version 0.91.0: are closed and there remains only their menu (Matt Rice ) - try fixed font for the technical drawing font if helvetica-12 is not available to avoid crashing (Timo Juhani Lindfors ) +- new algorithm for placing miniwindows after unhiding the application they + belong to, that works without auto-arranging the icons, while still avoiding + multiple icons in the same spot by moving the miniwindows to a new slot if + their old slot was occupied in the meantime. +- double clicking an appicon will also raise the miniwindows that belong to + that application to the front (along with the normal windows). Changes since version 0.90.0: diff --git a/src/actions.c b/src/actions.c index 56c08752..6e6e45c1 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1458,7 +1458,6 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS) WScreen *scr; WWindow *wlist, *next; WWindow *focused=NULL; - Bool shouldArrangeIcons = False; int animate; if (!wapp) @@ -1488,9 +1487,18 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS) if (bringToCurrentWS || wPreferences.sticky_icons || wlist->frame->workspace == scr->current_workspace) { if (wlist->icon && !wlist->icon->mapped) { + int x, y; + + PlaceIcon(scr, &x, &y, wGetHeadForWindow(wlist)); + if (wlist->icon_x!=x || wlist->icon_y!=y) { + XMoveWindow(dpy, wlist->icon->core->window, x, y); + } + wlist->icon_x = x; + wlist->icon_y = y; XMapWindow(dpy, wlist->icon->core->window); wlist->icon->mapped = 1; } + wRaiseFrame(wlist->icon->core); } if (bringToCurrentWS) wWindowChangeWorkspace(wlist, scr->current_workspace); @@ -1499,7 +1507,6 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS) wlist->frame->workspace == scr->current_workspace) { wDeiconifyWindow(wlist); } - shouldArrangeIcons = True; WMPostNotificationName(WMNChangedState, wlist, "hide"); } else if (wlist->flags.shaded) { if (bringToCurrentWS) @@ -1539,7 +1546,7 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS) wSetFocusTo(scr, focused); } wapp->last_focused = NULL; - if (shouldArrangeIcons || wPreferences.auto_arrange_icons) { + if (wPreferences.auto_arrange_icons) { wArrangeIcons(scr, True); } #ifdef HIDDENDOT