mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: workspace padding and container padding is inconsistent before/after retile #153
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 @maxbane on GitHub (Oct 21, 2022).
Describe the bug
When komorebi first starts up, the padding between windows (i.e. between each other) and between windows and monitor edges seems "too large" to me (I've configured smaller padding than default).
komorebic retilecauses the padding to shrink a lot (more like what I want), but this seems like a bug. Which padding is correct? Before the retile or after the retile?See screencap video below for a demonstration.
To Reproduce
Snippet from my
komorebi.ahk:My intention is for the padding between windows (and monitor edges) to be about the same as the thickness of the active window border. But I find that the configuration above gives different actual padding amounts depending on whether komorebi has just started up, or whether a retile or configuration-reload has occurred.
Expected behavior
The amount of padding should presumably be the same at start-up as after retile/reload.
Screenshots and Videos
Demonstration video: https://imgur.com/a/bPiQRjb
Operating System
@LGUG2Z commented on GitHub (Oct 21, 2022):
Definitely looks a little weird; can you try starting with the
--await-configurationflag and see if the same behaviour persists? I have a feeling that the configuration option initially gets sent after the initial layout has taken place; with--await-configurationthe first layout should not happen until all commands have been sent.@maxbane commented on GitHub (Oct 22, 2022):
Interesting, yeah, I think that's what's happening, but the fix is tricky. Even with
--await-configurationthe behavior would sometimes persist and sometimes not. I finally realized from the logs that it's because the order in which the configuration commands are processed is not deterministic, and not necessarily the order in which they appear inkomorebi.ahk. I would often see thatCompleteConfigurationgot processed beforeContainerPaddingwas processed, even thoughCompleteConfigurationis last in the config file.It's because
komorebic.lib.ahkusesRunfor all of itskomorebic.execalls. This is asynchronous and doesn't guarantee that a sequence of calls will finish in a particular order... all of thekomorebic.exeprocesses get forked in the background and run in parallel.Replacing all the usages of
RunwithRunWaitinkomorebic.lib.ahkfixed the behavior, and it doesn't seem to be any slower.Maybe consider generating
komorebic.lib.ahkwithRunWaitinstead ofRun? I think it might be the only way to ensure that configuration commands get processed in their order of appearance in the config file, which is probably what the user expects.@LGUG2Z commented on GitHub (Oct 22, 2022):
Good catch, I didn't realise that
Runwas an async command. I've updated the library generation command and the example library and the generated file at the root of the repo. You should be able to runiwr https://raw.githubusercontent.com/LGUG2Z/komorebi/master/komorebic.lib.ahk -OutFile $Env:USERPROFILE\komorebic.lib.ahkto grab the latest and try again.@maxbane commented on GitHub (Oct 24, 2022):
Cool, thanks! I'll call this closed 👍🏻