Hi Amadeusz, Unfortunately this patch causes a regression for me. I didn't think about the why, I just noticed that this patch causes it and I'm planning to revert it with the commit below, where you find the description of the regression.
What do you think? >From 38fb3e30af8762c43650737ff4b57a2be0f4eaaa Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" <[email protected]> Date: Sat, 23 Nov 2013 11:12:27 +0000 Subject: [PATCH] Revert "move maximization size adjustments to maximization function" This reverts commit c5f853271705d82b00baab9841b3803c74a07486 because it causes a regression. I have a maximized chrome window which does not cover the dock (on the right) because of the "do not cover dock" option. When I open a new window (Ctrl+N), this new window partially covers the dock (by around 32 pixels), so it does no longer respect the "do not cover dock" option. Reverting this commit fixes the issue. Conflicts: src/actions.c Signed-off-by: Carlos R. Mafra <[email protected]> --- src/actions.c | 10 ---------- src/screen.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/actions.c b/src/actions.c index 4b336c9..d9601cf 100644 --- a/src/actions.c +++ b/src/actions.c @@ -387,16 +387,6 @@ 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; - } - /* 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; diff --git a/src/screen.c b/src/screen.c index 3735fc0..d078318 100644 --- a/src/screen.c +++ b/src/screen.c @@ -707,6 +707,16 @@ 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.1.4 On Wed, 13 Nov 2013 at 15:39:11 +0100, Amadeusz Sławiński wrote: > now wGetUsableAreaForHead returns better result > > Signed-off-by: Amadeusz Sławiński <[email protected]> > --- > src/actions.c | 17 ++++++++++++++--- > src/screen.c | 10 ---------- > 2 files changed, 14 insertions(+), 13 deletions(-) > > diff --git a/src/actions.c b/src/actions.c > index 1087117..f9da91c 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,16 @@ 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 [email protected]. -- To unsubscribe, send mail to [email protected].
