mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
fixed [joeyh@debian.org: Bug#99311: full screen maximization cuts off bottom 6 pixels]
This commit is contained in:
@@ -498,8 +498,14 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wWindowConstrainSize(wwin, &new_width, &new_height);
|
wWindowConstrainSize(wwin, &new_width, &new_height);
|
||||||
|
|
||||||
|
wWindowCropSize(wwin, usableArea.x2-usableArea.x1,
|
||||||
|
usableArea.y2-usableArea.y1,
|
||||||
|
&new_width, &new_height);
|
||||||
|
|
||||||
wWindowConfigure(wwin, new_x, new_y, new_width, new_height);
|
wWindowConfigure(wwin, new_x, new_y, new_width, new_height);
|
||||||
|
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
#ifdef GNOME_STUFF
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
wGNOMEUpdateClientStateHint(wwin, False);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
28
src/window.c
28
src/window.c
@@ -1850,6 +1850,9 @@ wWindowConstrainSize(WWindow *wwin, int *nwidth, int *nheight)
|
|||||||
maxAX = wwin->normal_hints->max_aspect.x;
|
maxAX = wwin->normal_hints->max_aspect.x;
|
||||||
maxAY = wwin->normal_hints->max_aspect.y;
|
maxAY = wwin->normal_hints->max_aspect.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
baseW = wwin->normal_hints->base_width;
|
||||||
|
baseH = wwin->normal_hints->base_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width < minW)
|
if (width < minW)
|
||||||
@@ -1905,7 +1908,7 @@ wWindowConstrainSize(WWindow *wwin, int *nwidth, int *nheight)
|
|||||||
width = (((width - minW) / winc) * winc) + minW;
|
width = (((width - minW) / winc) * winc) + minW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseW != 0) {
|
if (baseH != 0) {
|
||||||
height = (((height - baseH) / hinc) * hinc) + baseH;
|
height = (((height - baseH) / hinc) * hinc) + baseH;
|
||||||
} else {
|
} else {
|
||||||
height = (((height - minH) / hinc) * hinc) + minH;
|
height = (((height - minH) / hinc) * hinc) + minH;
|
||||||
@@ -1919,6 +1922,29 @@ wWindowConstrainSize(WWindow *wwin, int *nwidth, int *nheight)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
wWindowCropSize(WWindow *wwin, int maxW, int maxH,
|
||||||
|
int *width, int *height)
|
||||||
|
{
|
||||||
|
int baseW = 0, baseH = 0;
|
||||||
|
int winc = 1, hinc = 1;
|
||||||
|
|
||||||
|
if (wwin->normal_hints) {
|
||||||
|
baseW = wwin->normal_hints->base_width;
|
||||||
|
baseH = wwin->normal_hints->base_height;
|
||||||
|
|
||||||
|
winc = wwin->normal_hints->width_inc;
|
||||||
|
hinc = wwin->normal_hints->height_inc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*width > maxW)
|
||||||
|
*width = maxW - (maxW - baseW) % winc;
|
||||||
|
|
||||||
|
if (*height > maxH)
|
||||||
|
*height = maxH - (maxH - baseH) % hinc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -352,6 +352,8 @@ void wWindowUnfocus(WWindow *wwin);
|
|||||||
|
|
||||||
void wWindowUpdateName(WWindow *wwin, char *newTitle);
|
void wWindowUpdateName(WWindow *wwin, char *newTitle);
|
||||||
void wWindowConstrainSize(WWindow *wwin, int *nwidth, int *nheight);
|
void wWindowConstrainSize(WWindow *wwin, int *nwidth, int *nheight);
|
||||||
|
void wWindowCropSize(WWindow *wwin, int maxw, int maxh,
|
||||||
|
int *nwidth, int *nheight);
|
||||||
void wWindowConfigure(WWindow *wwin, int req_x, int req_y,
|
void wWindowConfigure(WWindow *wwin, int req_x, int req_y,
|
||||||
int req_width, int req_height);
|
int req_width, int req_height);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user