mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Ignore WM_NORMAL_HINTS resize increment for maximized windows
If you are trying to maximize old apps that are setting a resize increment in term of WM_NORMAL_HINTS notion the window will not be maximized fully (by a few pixels). It's easy to reproduce with xterm, ctrl double click on the title bar. xprop extract sample is giving: program specified resize increment: 6 by 13 For those maximized windows the patch is just ignoring the resize increment. Seems the same issue happened on that project https://github.com/paperwm/PaperWM/issues/106
This commit is contained in:
committed by
Carlos R. Mafra
parent
532acdc443
commit
370adc94e7
24
src/window.c
24
src/window.c
@@ -1858,8 +1858,10 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
|||||||
int baseH = 0;
|
int baseH = 0;
|
||||||
|
|
||||||
if (wwin->normal_hints) {
|
if (wwin->normal_hints) {
|
||||||
winc = wwin->normal_hints->width_inc;
|
if (!wwin->flags.maximized) {
|
||||||
hinc = wwin->normal_hints->height_inc;
|
winc = wwin->normal_hints->width_inc;
|
||||||
|
hinc = wwin->normal_hints->height_inc;
|
||||||
|
}
|
||||||
minW = wwin->normal_hints->min_width;
|
minW = wwin->normal_hints->min_width;
|
||||||
minH = wwin->normal_hints->min_height;
|
minH = wwin->normal_hints->min_height;
|
||||||
maxW = wwin->normal_hints->max_width;
|
maxW = wwin->normal_hints->max_width;
|
||||||
@@ -1922,15 +1924,17 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseW != 0)
|
if (!wwin->flags.maximized) {
|
||||||
width = (((width - baseW) / winc) * winc) + baseW;
|
if (baseW != 0)
|
||||||
else
|
width = (((width - baseW) / winc) * winc) + baseW;
|
||||||
width = (((width - minW) / winc) * winc) + minW;
|
else
|
||||||
|
width = (((width - minW) / winc) * winc) + minW;
|
||||||
|
|
||||||
if (baseH != 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;
|
||||||
|
}
|
||||||
|
|
||||||
/* broken stupid apps may cause preposterous values for these.. */
|
/* broken stupid apps may cause preposterous values for these.. */
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user