mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
move maximization size adjustments to maximization function
now wGetUsableAreaForHead returns better result Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
This commit is contained in:
committed by
Carlos R. Mafra
parent
bd4abc5304
commit
952319ae60
@@ -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);
|
||||
|
||||
|
||||
10
src/screen.c
10
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);
|
||||
|
||||
Reference in New Issue
Block a user