mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: Window size imprecise #258
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mangkoran on GitHub (Nov 1, 2023).
Describe the bug
Several applications have imprecise window size. So far I found WezTerm and Discord.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Precise window size
Screenshots and Videos

WezTerm - Notepad++ (Notepad++ is fine)
Chrome - Discord (really small/fine but it's there)


Operating System
Provide the output of
systeminfo | grep "^OS Name\|^OS Version"komorebic checkOutputProvide the output of
komorebic checkAdditional context
None
@LGUG2Z commented on GitHub (Nov 1, 2023):
I'm not sure that there is much that can be done here as these applications seem to be reporting their window and border dimensions incorrectly to the operating system.
In theory we could provide another per-window override configured by the user to target applications like this on a case by case basis, but it would be better for everyone if these issues could be fixed in the applications themselves rather than being targeted by overrides in a window manager.
I'll leave this ticket open if people want to brainstorm, but I suggest opening issues on the repos of the relevant applications and referencing back to this issue.
@mangkoran commented on GitHub (Nov 3, 2023):
Thank you for your reply.
Hmm if it's due to the affected application, then it is surely will be a long, hard work 😅
I wonder, Microsoft's PowerToys has a feature called FancyZones that can "tile"/resize windows (although it's not a tiling WM like komorebi). I am using FZ daily, and with FZ it can tile almost (if not all) windows/apps perfectly. Well it is might be due to different implementation, but I wonder why FZ can tile more perfectly?
WezTerm - Notepad++ (both using FZ)

@LGUG2Z commented on GitHub (Nov 3, 2023):
I've tried to reproduce your first example on Windows 11, with significant overlapping of the windows of WezTerm and Notepad++ by using exaggerated negative container padding, but I haven't been able to reproduce the height difference shown on your first screenshot.
This is the only instance in the codebase where an override may be applied to window size calculation; it is explicitly opt-in and it applies overrides to all four sides of the
Rectrather than any one side: https://github.com/LGUG2Z/komorebi/blob/master/komorebi/src/window.rs#L151Otherwise, all of the window size calculations are made indiscriminately on plain
Rectobjects with no information about the applications that they will be applied to; there isn't really a way that I can see that heights would be calculated different for specific applications regardless of their positions: https://github.com/LGUG2Z/komorebi/blob/master/komorebi-core/src/arrangement.rs#L28I'm not very familiar with the PowerToys/FancyZones codebase, but if someone is, and the replication of what they are doing to overcome these height differences does not require significant changes to the layout/arrangement code, I'm happy to accept a PR here.
For future users who notice this, can you please specify here if you are running Win10 or Win11? It would be good to get some more data to determine if this impacts both Win10+11, or just Win10. 🙏
@Zinvoke commented on GitHub (Nov 14, 2023):
This actually is a problem in GlazeWM and Komorebi if you try out FancyWM you will see that the issue doesn't exist for any applications even if applications are reporting wrong sizes. Lars thought this might be the correct way of doing things
67519f111a/src/WinMan.Windows/Windows/Win32Window.cs (L606)@LGUG2Z commented on GitHub (Nov 15, 2023):
Hmm @Zinvoke if we get the frame margins does that mean that we don't need to remove the invisible borders anymore? 🤔
@Zinvoke commented on GitHub (Nov 16, 2023):
No idea but somehow FancyWM pulls it off :(
if you look at these screenshots you can see that the 2 outside windows when using komorebi are both different sizes then the middle window and when using FancyWM all of the windows are the same size!
Komorebi Screenshot:

FancyWM Screenshot:

Note: In the screenshots the border colors are changed via a program I made called FancyBorders using the DWMWA_BORDER_COLOR flag which allows you to see the actual border sizes better and the programs are Explorer, Vscode, Windows Terminal, Discord
@xidsyed commented on GitHub (Sep 1, 2024):
Sorry this is a bit late, but and unrelated, but how have you found the experience of using FanzyWM. What features does it lack compared to komorebi