komorebi-layouts now carries the platform-free half of the Scrolling
layout: the model of a strip of columns, re-exported as
komorebi_layouts::scrolling::model, and what a host needs around it,
which is the layout options for the model, the placement of containers
in a work area, resizing a column or a tile, and the hand-over of column
records between workspaces.
The center_focused_column layout option of the Scrolling layout is one
of Never, Always and OnOverflow there, and a boolean is still read as
true for Always and false for Never. The two places here that said true
say Always, and the schema and the options for nix say so.
This is the revision of the feature/moar-scrolling branch of komorebi
that has them. It is pinned by revision until the branch is merged, and
komorebi-themes moves with it so that the repository is fetched once.
komorebi-scrolling has no license field, so deny.toml clarifies it as it
does the other crates of that repository.
Dragging a tile's edge was unreliable: long drags were dropped, the
divider next to a different window drifted by a few points, and in
recordings made with komorebi-recorder a drag to the left shrank the tile
instead of growing it. This fixes the causes that were found there.
Resize bounds: bump komorebi-layouts and komorebi-themes to
LGUG2Z/komorebi@f08aa55, where DefaultLayout::resize only accumulates and
no longer refuses any adjustment larger than half of the container's own
size. resize_window now grants the largest amount that keeps every tile
at least a tenth of the work area (or as large as it already is), found
by bisection, instead of all or nothing. Keyboard resizing goes through
the same path. RUSTSEC-2024-0449 is ignored in deny.toml, as upstream
does in the same bump.
The dragged container: ResizeStart records the rect of the dragged window
once, since AXWindowResized fires again all through a drag, and ResizeEnd
hands it to the new WindowManager::resize_by_drag along with the rect the
window ended in. That resizes the container of the dragged window instead
of the focused one, for each edge that moved, instead of guessing the
edges from the difference to latest_layout (which made apps that snap to
a grid of cells resize edges that nobody touched).
Where the drag began: AXWindowResized is first reported after the edge
has moved, and handlers run one at a time, so the rect recorded as the
start can already be 22 points into the drag, or be the rect the drag
ended in. An edge that ended up more than 32 points from its tile is
measured from its tile edge; every other edge from the recorded start.
The reaper: it re-tiled the focused workspace on every mouse-up and
key-up to find windows that had gone away. That ran as soon as the button
went up, ahead of the ResizeEnd queued behind slower handlers, so the
window was back on its tile when ResizeEnd read where it had been dropped
and the drag was measured backwards. It now only looks for windows that
no longer exist and reaps them, without moving any window.
The tests reproduce each of these, including the numbers from the
recordings: a first step of 22 points, a drag already over when it was
first seen, and a mouse-up that must leave the layout alone.
This commit is largely lift and shift of LGUG2Z/komorebi@c165172:
The implementation adds a new layout-ratio CLI command to komorebi that
allows users to dynamically set column and row ratios for layouts at
runtime via komorebic layout-ratio --columns 0.3 0.4 --rows 0.5.
A public validate_ratios function was added to komorebi-layouts that
clamps ratio values between 0.1 and 0.9, truncates when the cumulative
sum would reach or exceed 1.0, and limits to a maximum of 5 ratios. This
function is shared between config file deserialization and the new CLI
command, ensuring consistent validation behavior.
The SocketMessage enum in komorebi/src/core/mod.rs has a new
LayoutRatios variant. The handler in process_command.rs uses the shared
validate_ratios function to process the ratios before applying them to
the focused workspace's layout options.
When the CLI command is called without any arguments, it prints a
helpful message instead of returning an error.
This commit adds parity with the layout_options and ratio support added
to LGUG2Z/komorebi@22e8a79833 by @CtByte,
which is largely integrated into komorebi for Mac through the importing
of the new komorebi-layouts crate.
This commit migrates to the new komorebi-layouts crate exposed in the
LGUG2Z/komorebi repository, significantly reducing duplication and
change maintenance between the two komorebi implementations.
This commit removes the hardcoded entries in TABBED_APPLICATIONS for
Finder and Ghostty, and instead leaves this for users to source either
through their own configs using the "tabbed_applications" config option
or via an ASC file.
There is a slight discrepancy in the two schemas as the personal config
file will accept an Exe string identifying the app, whereas the ASC goes
with a full MatchingRule to keep the ASC consistent.
However, for both tabbed and titleless application options as exposed on
the ASC schema, when read in komorebi it will only accept
MatchingRule::Simple with an Exe identifier.
This commit uses raw-window-handle to access the NSWindow of the bar and
set the window level to `kCGBackstopMenuLevel` (-20), positioning the
bar behind the menu bar, and at the same level as the notch on Macbook
screens.
This approach means the bar occupies space already excluded from the
work area by the menu bar, so the automatic work area offset calculation
is no longer needed and has been commented out. (I think... Need to
validate this on regular non-Macbook external displays...)
The explicit user-configured `work_area_offset` option is preserved for
users who want more flexibility.
Centralized both KomorebiTheme and KomobarTheme in the komorebi-themes
module in komorebi for Windows.
This commit removes the duplicated references in komorebi for Mac and
just pulls in those; now we only have to update the docs in one place.
Regenerated all the schemas after pulling in the changes.
This commit optimizes the objc2 dependency tree by disabling default
features and enabling only the minimal set of features actually used
by the codebase. This reduces compilation time and dependency bloat.
I was meant to do this earlier but during the initial implementation it was
easier to just pull in everything. Now that we are getting ready for a public
release it's time to improve on this.
I ended up:
* Removing unused direct dependencies:
- objc2-core-services
- objc2-core-video
* Setting `default-features = false` on all objc2 crates and added only
the specific features required for the types and methods used
* Updating objc2, objc2-app-kit, objc2-foundation,
objc2-application-services, objc2-core-foundation, objc2-core-graphics,
and objc2-quartz-core with minimal feature sets
After all those changes, the following transitive dependencies are no longer
pulled in: objc2-metal, objc2-core-image, objc2-core-data, objc2-cloud-kit,
objc2-core-text, and loads of unused Foundation/AppKit class bindings.
Some before and after numbers:
| Metric | Before | After | Change |
|---------------------------------|---------|---------|----------|
| objc2 dep lines (komorebi) | 84 | 50 | -40.5% |
| objc2 dep lines (komorebi-bar) | 91 | 59 | -35.2% |
| Dependency tree (komorebi) | 973 | 917 | -5.8% |
| Dependency tree (komorebi-bar) | 1181 | 1131 | -4.2% |
| Clean build time | 3m 05s | 2m 21s | -23.8% |
The almost 24% reduction in clean build time is a big win!
This commit adds a new workspace crate, version, which is consumed by
komorebi and komorebic.
If either of those binaries are being built by
the Nix Flake, the git rev info will be pulled from inputs.self.rev
instead of querying the git repo, because the git files are not passed
to the derivation.
The build.rs for the version crate decides if the build is happening by
querying the shadow-rs build output for BRANCH, which will always be
empty when a "nix build" is running.
Cargo builds will use the standard git information retrieval mechanisms
in shadow-rs.
The information in both cases is exposed as version::LONG_VERSION, and
passed to clap as the string to return when either binary is called with
the --version flag.
Add a new "completions" command which takes a supported shell as an
argument. This command outputs a completions file to stdout, which can
be redirected to a file.
This commit migrates the komorebi-bar from komorebi for Windows. Mostly
lifting and shifting code, exposing stuff we need in komorebi-client
etc.
A few widgets will need to be reworked completely so they have been
removed for now.
Mouse and command stuff also needs updating a little so that has also
been removed for now.
This commit introduces a very introductory attempt at a border manager.
All of the colors work, from some brief usage it seems to behave as
expected based on windows, with some caveats.
There are issues with the window layering and popups which are annoyng -
the borders always stay drawn on top of RustRover popups, for example.
Also, the window tracking is incredibly slow and laggy when you try to
move or resize using the mouse.
Probably because the implementation uses NSWindow under the hood which
according to Google is notoriously unperformant. None of the config
options have been brought over yet.
The border manager is defaulting to off for now in the absence of config
- anyone at this commit who really wants to try it out should set
BORDER_ENABLED in border_manager/mod.rs to "true".
This commit switches from executing things which need a MainThreadMarker
in our main loop in main.rs to executing them via Grand Central Dispatch
using the dispatch2 crate.
All the monitor reconciliator stuff is now much faster.
This commit switches to using absolute intead of relative monitor sizes,
I don't fully understand by the NS APIs and the CG APIs return totally
different coordinate systems.
There was also a deadlock in the monitor reconciliator which I think I
figured out; it's a little ugly both in code and in execution but the
deadlocks and pkill -9s can be put away from now.
Cross-monitor moves aren't working which I'll look into next.
Starting to think about documentation and adding in commands to generate
JSON schemas for the ApplicationSpecificConfiguration, SocketSchema and
StaticConfig.
schemars 0.8 > 0.9 has way too many breaking changes for me to care
about right now, let around 0.8 > 1.0. I'm happy being pinned on 0.8 for
now.
This commit adds logs written to files in the app's datadir, which can
then be tailed by the komorebic log command. temp_dir() was being weird
so I just stuck with DATA_DIR.