now wGetUsableAreaForHead returns better result --- src/actions.c | 18 +++++++++++++++--- src/screen.c | 10 ---------- 2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/actions.c b/src/actions.c index 1087117..b1dca26 100644 --- a/src/actions.c +++ b/src/actions.c @@ -354,6 +354,7 @@ void wMaximizeWindow(WWindow *wwin, int directions) WArea usableArea, totalArea; Bool has_border = 1; int adj_size; + WScreen *scr = wwin->screen_ptr; if (!IS_RESIZABLE(wwin)) return; @@ -362,14 +363,14 @@ void wMaximizeWindow(WWindow *wwin, int directions) has_border = 0; /* the size to adjust the geometry */ - adj_size = wwin->screen_ptr->frame_border_width * 2 * has_border; + adj_size = scr->frame_border_width * 2 * has_border; /* save old coordinates before we change the current values */ if (!wwin->flags.maximized) save_old_geometry(wwin, SAVE_GEOMETRY_ALL); - totalArea.x2 = wwin->screen_ptr->scr_width; - totalArea.y2 = wwin->screen_ptr->scr_height; + totalArea.x2 = scr->scr_width; + totalArea.y2 = scr->scr_height; totalArea.x1 = 0; totalArea.y1 = 0; usableArea = totalArea; @@ -386,6 +387,17 @@ void wMaximizeWindow(WWindow *wwin, int directions) usableArea = wGetUsableAreaForHead(scr, head, &totalArea, 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; + } + } + /* Only save directions, not kbd or xinerama hints */ directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS); diff --git a/src/screen.c b/src/screen.c index c7295f3..d40d333 100644 --- a/src/screen.c +++ b/src/screen.c @@ -710,16 +710,6 @@ void wScreenUpdateUsableArea(WScreen * scr) scr->totalUsableArea[i].x2 = rect.pos.x + rect.size.width; scr->totalUsableArea[i].y2 = rect.pos.y + rect.size.height; - if (scr->dock && dock_head == i && (!scr->dock->lowered || wPreferences.no_window_over_dock)) { - int offset = wPreferences.icon_size + DOCK_EXTRA_SPACE; - - if (scr->dock->on_right_side) { - scr->totalUsableArea[i].x2 -= offset; - } else { - scr->totalUsableArea[i].x1 += offset; - } - } - if (wNETWMGetUsableArea(scr, i, &area)) { scr->totalUsableArea[i].x1 = WMAX(scr->totalUsableArea[i].x1, area.x1); scr->totalUsableArea[i].y1 = WMAX(scr->totalUsableArea[i].y1, area.y1); -- 1.8.4.3 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.