From 1194889c9530de5c462453c1da0335f7b533f2ca Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 15 Sep 2010 22:13:26 -0400 Subject: [PATCH] Fix bounce direction of docked appicons I have my dock on the right edge of the screen, and my clip right next to it. So the first icon underneath the clip is 64 pixels from the top and 64 from the right. It seems silly for it to bounce downwards instead of sideways like every other icon under the clip. So make the choice of vertical or horizontal for docked icons be relative to the dock or clip rather than absolute screen position. Left/right or up/down is still chosen by screen position, as are situations where the icon is a chess bishop's move from the clip. --- src/superfluous.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/superfluous.c b/src/superfluous.c index 75652f4a..d5aaf504 100644 --- a/src/superfluous.c +++ b/src/superfluous.c @@ -355,8 +355,13 @@ static int bounceDirection(WAppIcon *aicon) v = b; } - if (h < v) dir &= ~(top_e | bottom_e); - else dir &= ~(left_e | right_e); + if (aicon->dock && abs(aicon->xindex) != abs(aicon->yindex)) { + if (abs(aicon->xindex) < abs(aicon->yindex)) dir &= ~(top_e | bottom_e); + else dir &= ~(left_e | right_e); + } else { + if (h < v) dir &= ~(top_e | bottom_e); + else dir &= ~(left_e | right_e); + } switch (dir) { case left_e: