From cf719c297972ab2a2a23e2449e6e4c2b5cc3316a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Wed, 13 Nov 2013 15:39:13 +0100 Subject: [PATCH] take dock into account when not covering icons next to it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Amadeusz Sławiński --- src/actions.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/actions.c b/src/actions.c index 60e1174a..4b336c94 100644 --- a/src/actions.c +++ b/src/actions.c @@ -397,6 +397,17 @@ void wMaximizeWindow(WWindow *wwin, int directions) usableArea.x1 += offset; } + /* check if icons are on the same side as dock, and adjust if not done already */ + if (scr->dock && wPreferences.no_window_over_icons && !wPreferences.no_window_over_dock && (wPreferences.icon_yard & IY_VERT)) { + int offset = wPreferences.icon_size + DOCK_EXTRA_SPACE; + + if (scr->dock->on_right_side && (wPreferences.icon_yard & IY_RIGHT)) + usableArea.x2 -= offset; + /* can't use IY_LEFT in if, it's 0 ... */ + if (!scr->dock->on_right_side && !(wPreferences.icon_yard & IY_RIGHT)) + usableArea.x1 += offset; + } + /* Only save directions, not kbd or xinerama hints */ directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);