…although, you may have a window that can be resized, e.g. by a juce resizer comp, and that won’t be detected here, although you may still want to let the WM resize it. Not sure what a good fix for that would be…
mmm right, the resizer component is not working anymore with this fix. Applying the change only for windows with a titlebar helps for the juce file browser and other non-native resizable juce dialogs , but it does not help for windows with a native titlebar and a resizer comp
the windowBorder argument was indeed useful for the call to XMoveResizeWindow as the (x,y) argument to this function is the position of the decorated window, with its titlebar and border:
If not done, the window will move by a few pixels each time it is resized, which is a bit annoying !
the “if (!mapped)” for the windowmanager hints should be replaced by “if (1)” (or something like if (!mapped || w != ww || h != wh)) in order to make sure that the window size hintz are updated when the window is resized – otherwise the window border does not get resized.