mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +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
@@ -1858,8 +1858,10 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
||||
int baseH = 0;
|
||||
|
||||
if (wwin->normal_hints) {
|
||||
if (!wwin->flags.maximized) {
|
||||
winc = wwin->normal_hints->width_inc;
|
||||
hinc = wwin->normal_hints->height_inc;
|
||||
}
|
||||
minW = wwin->normal_hints->min_width;
|
||||
minH = wwin->normal_hints->min_height;
|
||||
maxW = wwin->normal_hints->max_width;
|
||||
@@ -1922,6 +1924,7 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
||||
}
|
||||
}
|
||||
|
||||
if (!wwin->flags.maximized) {
|
||||
if (baseW != 0)
|
||||
width = (((width - baseW) / winc) * winc) + baseW;
|
||||
else
|
||||
@@ -1931,6 +1934,7 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
||||
height = (((height - baseH) / hinc) * hinc) + baseH;
|
||||
else
|
||||
height = (((height - minH) / hinc) * hinc) + minH;
|
||||
}
|
||||
|
||||
/* broken stupid apps may cause preposterous values for these.. */
|
||||
if (width > 0)
|
||||
|
||||
Reference in New Issue
Block a user