Reported-by: Carlos R. Mafra <[email protected]>
Signed-off-by: Amadeusz Sławiński <[email protected]>
---
src/placement.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/placement.c b/src/placement.c
index f48ee3c..7587b87 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -507,6 +507,27 @@ void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
unsigned width, unsigned
WArea usableArea = wGetUsableAreaForHead(scr,
wGetHeadForPointerLocation(scr),
NULL, True);
+ /* check if user wants dock covered */
+ 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)
+ usableArea.x2 -= offset;
+ else
+ 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;
+ }
+
switch (wPreferences.window_placement) {
case WPM_MANUAL:
InteractivePlaceWindow(wwin, x_ret, y_ret, width, height);
--
1.8.4.4
--
To unsubscribe, send mail to [email protected].