New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
borderWidth incorporated with window size hints (x11 or xmonad?) #198
Comments
This is a bit weird as the code that computes float sizes does take border into consideration: xmonad/src/XMonad/Operations.hs Lines 573 to 574 in d6f8891
Also, I can't reproduce the issue here with neither soffice nor ssh-askpass, but my xmonad.hs is considerably longer than your minimal example, so I might have something somewhere that works around it, but I'm not aware of it. |
I'm not in a position to poke at this, but I'd like to remind people that this border is part of the window, not hanging around it as in reparenting window managers. This can cause confusion as to who "owns" it; people tend to expect it to belong to the window manager, but changing the border width reflects back into the client / program which may resize the window in response or etc. (This has been known to cause loops.) Or put differently, setting the border width nonzero may take away from the drawing area the client expects to have, since the internal border is rarely used these days. It looks like this may be what's happening here, and if the client doesn't expect it then there may not be much to be done except use the |
There's also at least two places that need to deal with float window sizes, and this causes problems sometimes. Floating dialogs tend to be withdrawn and represented later, rather than being rebuilt each time they're needed, and because we store relative instead of absolute sizes ( The whole thing probably needs to be reviewed and we need to make sure the right sizes are used in the right places. And if the above is still true, it needs to be fixed; but my recollection was it was hard to fix because we don't actually store the size, the withdrawn window still has its size and border and that's why it keeps growing as we reapply the appropriate-for-screen border each time while ignoring the existing one. We may have to catch the Note that the above means you can't reproduce this at all with only one monitor, and possibly not if all monitors are the same size, because it'll always compute the same sizes in those cases, IIRC. |
I should also note that soffice dialogs in general behave much better with Personally, I think we're well past the point where |
@geekosaur Thanks for the input. Also perhaps slightly off topic, how do soffice dialogs behave better with I've started using this module in my actual xmonad config not too long ago, though I'm not sure I've noticed a difference in this regard. |
I mentioned loops earlier? soffice was one of the main culprits there, absent This said, modern programs in general really want |
My setup is Arch + LightDM + XMonad (no DE). I have the same issue with a custom python TK program. I use I can reproduce it with a python TK app, which basically does:
and xwininfo outputs this:
In the end, the whole window is 300x300, but the border is indeed inside the given size instead of outside (the content is 292x292 instead of 300x300, and the whole window is 300x300 instead of 308x308 with border = 4). I tried with the @liskin 's xmonad public dotfile and I get the same behavior. |
xmonad uses the window's internal border (see |
Without going to such complex rework, according to the liskin's answer, shouldn't the floating window size be already increased by twice the border width to workaround this internal-border-restriction? |
Looking back over this, a complication here is that when the window is initially sized, the |
I think this is already what I did :
I did some testing, and it appears that if I remove the line |
The relevant code: adjust (W.RationalRect x y w h)
| x + w > 1 || y + h > 1 || x < 0 || y < 0
= W.RationalRect (0.5 - w/2) (0.5 - h/2) w h
adjust r = r In the source it's confusingly formatted and written, but the first part conditionally resizes the rectangle and the second leaves it unchanged. It could be written differently: adjust r@(W.RationalRect x y w h) =
if x + w > 1 || y + h > 1 || x < 0 || y < 0
then W.RationalRect (0.5 - w/2) (0.5 - h/2) w h
else r |
Problem Description
When running applications, some floating windows (e.g. dialog or save prompts) are set to have a fixed size. Setting
borderWidth
to some non-zero value inxmonad.hs
means that such windows (including the border) respect the size hint. This results in a "squished" window.I used LibreOffice to produce this prompt.
Configuration File
Here is a minimal configuration to reproduce the issue.
Additional information
xprop
output of save prompt:xwininfo
output of the save prompt:Other
I don't see this as serious, it's more of an aesthetics thing. I apologize in advance if this is specific to X11, I'm not too familiar with the implementation of xmonad or X11. Otherwise, I'm very fond of this tiling window manager.
The text was updated successfully, but these errors were encountered: