Commit Graph
287 Commits
Author SHA1 Message Date
LGUG2Z 2fb9dfdffa feat(workspace): make retile put the widths of scrolling columns back
retile already forgot the resize adjustments of the layouts that are
made of splits, and the widths of the columns of the Scrolling layout
are the same kind of thing. The focused workspace of each monitor
gets its columns back to what scrolling-layout-columns gives, and the
focused column stays where it is unless it has to scroll.

The variant of retile that keeps resize dimensions keeps the widths.
2026-10-29 16:38:53 -07:00
LGUG2Z 65265c95f3 fix(window): hide windows on the display of the monitor that has them
A window whose top-left corner is past the left edge of the screen is
on no display, as far as CGGetDisplaysWithPoint is concerned. Looking
the display up from the corner then found nothing, and hide, the
scrolling rest and the slide back in all skipped the window without a
word. The Scrolling layout lets a column overhang the left edge, so a
column that scrolled out of view that way stayed on screen, and so did
a window of a workspace that was left while it overhung.

A workspace now takes the display from its monitor and hands it down
to Container::hide and Window::hide_on, and arrange_scrolling hands
it to hide_scrolling. A window that is parked remembers the display it
was parked on, so sliding it back in no longer looks at its target.

The lookup by position stays for callers that have no monitor, and is
total: the display under the corner when there is one, otherwise the
display with the most overlap, otherwise the nearest, and the main
display when the system reports none. Not finding a display to hide a
window on is logged as a warning, and which rest a window gets is
logged at trace.
2026-10-29 16:38:53 -07:00
LGUG2Z acc4d7d67a docs(repo): describe the scrolling layout
Add a page on the Scrolling layout: how column widths work, when the
screen scrolls, what closing a window focuses, how resizing works, where
windows that are out of view go and why, and what is not done yet.
2026-10-29 16:38:24 -07:00
LGUG2Z d9319e0f66 docs(komorebic): say what scrolling-layout-columns means
The Scrolling layout no longer shares the screen between however many
windows there are until `columns` of them exist. The count is how many
columns fit across the screen, which is how wide a new column is, so the
help says that, and not that it is the number of visible columns.
2026-10-29 16:38:24 -07:00
LGUG2Z 8c4949e405 feat(scrolling): choose what has focus after a window is closed
Closing a window moved focus to the container on its left, whatever had
focus and wherever the window was. A strip of columns knows better.

Focus goes back to the column that the closed one was opened next to,
with the viewport as it was, if nothing has moved focus since. Otherwise
it goes to the column that takes the closed one's place on the right. A
window that is closed without having focus no longer takes focus with
it.

The strip is told what there is just before the container goes, so that
it can answer. A workspace that has not laid out a strip yet moves focus
left as before.
2026-10-29 16:38:24 -07:00
LGUG2Z 0aa97042a3 feat(window): rest windows that scroll out of view at the edge
A window that scrolled out of view in the Scrolling layout used to be sent
to a corner of the screen and hidden there. It now comes to rest at the
edge of the screen that it left by, with a sliver of it on screen, and
keeps its size and its height up the screen. Bringing it back is then a
matter of moving it, and it never has to be resized.

With animations on the window slides there and stays, where it used to
carry on into the corner. With animations off it is moved there at once,
so the layout behaves the same either way. Where the edge is next to
another display, and the window would be seen on it, it is still hidden
in the corner.

The marker that says a window is out of the way is now also cleared when
a window is put back without animating it. Only sliding a window in
cleared it, which was enough only while nothing set the marker unless
animations were on.
2026-10-29 16:38:24 -07:00
LGUG2Z 03cb86d507 feat(scrolling): lay out the scrolling layout with the scrolling model
The Scrolling layout is now laid out by komorebi-scrolling instead of by
the layouts crate. A workspace in that layout keeps a ScrollingSpace next
to its containers, makes it match the containers and the focus whenever
the layout is calculated, and takes the rectangles from it. As a result:

- a window that opens gets the width of a column and no other column
  changes width, where every column used to be resized to share the
  viewport until there were as many as `columns`
- focusing a column that is already in view does not scroll the strip
- a column that has been resized keeps its width as windows come and go
- columns that were never resized follow the `columns` option, so
  changing it, or crossing a threshold of layout_options_rules, still
  lays them out again

Resizing changes the width of the focused column, by half of the delta
per edge as the other layouts do. A strip has no heights, so resizing a
height does nothing.

Windows that are partly in view keep their size and overhang the edge of
the screen, unless that would show them on another display, where they
are clamped to the work area as before.

What needs a Workspace is in the scrolling module, and what does not is
in komorebi_layouts::scrolling, which the model comes through. What only
the old Scrolling layout needed goes: the percentage override in
update(), laying the strip out again without resize adjustments in
hide(), the resize constraints, and the feedback of the unclamped
layout.
2026-10-29 16:38:24 -07:00
LGUG2Z bc962167b7 chore(deps): bump komorebi-layouts for the scrolling model
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.
2026-10-29 16:38:24 -07:00
LGUG2Z 0fb5de3c0e fix(workspace): make scrolling-layout-columns work with other options
The command only set the column count when the workspace had no layout
options at all, or already had scrolling options. A workspace with
options for something else (column_ratios, say) and no scrolling options
matched the second arm and was left unchanged, so the command silently
did nothing.

Move the logic to Workspace::set_scrolling_columns, which creates the
scrolling options when they are missing and keeps every other option,
and test all three cases.
2026-10-29 16:38:24 -07:00
LGUG2Z 1098dfc6ec fix(workspace): keep the scrolling view put while focus moves within it
The Scrolling layout works out which column is first in view from the
layout it produced last time. Workspace::update stored that layout after
clamping it to the work area, which pulls every off-screen column onto
the left edge, so the previous view always read as starting at column 0.
Once more windows were open than fit on screen, focusing left shifted the
whole strip by a column on every step instead of leaving it where it was.

Keep the layout as the algorithm produced it and feed that back for
Scrolling, both in Workspace::update and in resize_window. The clamp
becomes a function of its own so that the regression test runs the same
code as update().
2026-10-29 16:38:24 -07:00
LGUG2Z 253600966b feat(animation): say where windows really ended up
An app is free to refuse a size, and many do: a window that will not get
narrower than some width stays that wide however it is asked. The animator is
the first to find out, when it looks at a window after a journey, and until now
it only re-sent the size and moved on, so a layout that places the next column
as if the window had the width it was given places it on top of the window that
did not.

The arrival module is new here. It is where whatever finds out that a window is
wider than it was told to be says so, from any thread and without the lock of
the window manager, for a layout to pick up the next time that it runs.

Say what every verification found to it, which keeps the windows that
turned out wider than they were told to be for the layout to pick up, and
forgets those that have taken their size since, so it is said every time and
whatever the answer. That includes the last attempt, where the window is looked
at again after it was last told to take its size, as nothing verifies it after
that and the attempts are given up on.

This is said from where the frame is read, not carried out of the state machine,
which has no business with anything global.
2026-10-29 16:38:24 -07:00
LGUG2Z 0af7b0fcf7 fix(animation): treat every journey that ended before it settled as cut short
take_unfinished only knew about a journey that was to go on to somewhere else
afterwards and never got there. A window that slides out of view in the
Scrolling layout rests where it slid to and has nowhere to go afterwards, so a
slide that was cut short went unnoticed, and the window was left partly in view.

Count every journey that ends other than by the window being found where it was
sent: one that was grabbed or taken over, given up on because the app stopped
answering or the window was gone, or that never got to where it was sent in the
verifications that follow. A journey that settles is not cut short, and nobody
has to ask for the news to be kept within bounds.
2026-10-29 16:38:24 -07:00
LGUG2Z 86adb69bd3 docs(animation): describe how to use animations
Describe the duration, style and fps options, per-animation settings, and what
to expect from the animator: windows stay in step with each other, apps that are
slow to resize are sent sizes less often, and a window that is grabbed is let
go of.
2026-10-29 16:38:24 -07:00
LGUG2Z bc4dc76f39 feat(window): slide windows in the Scrolling layout out of view and back
Windows that scroll out of view were hidden with an instant jump to a corner of
the screen, and animated back in diagonally across it. With animations on, slide
them out sideways to the edge of the screen they left by, at the same height,
and park them in the corner once they are out of sight; and put a parked window
back at that edge before it slides in, so that it comes from where it left.
Windows that would be seen on a neighbouring display on the way fall back to the
instant hide, and a window that is stopped on its way out is hidden again rather
than left in view.

Without animations nothing changes.
2026-10-29 16:38:24 -07:00
LGUG2Z fa8f422c02 fix(window): take a window over from the animator before writing to it directly
hide, restore and the direct position and size writers wrote to a window while
an animation thread kept writing frames to it. Take the window over first, which
stops its animation and waits for what is already on its way to land, so that it
cannot land on top of what the caller writes next.

A window that is hidden while it is on its way somewhere is now restored to
where it was going, rather than to wherever it happened to be at the time.
2026-10-29 16:38:24 -07:00
LGUG2Z 5bfbaf5f8a fix(window): recognise our own move and resize notifications
The moves and resizes the animator makes are reported back to us like any
others. They used to be avoided by removing and re-adding the AX observers
around every animation, which cost four AX calls a window and still let some
through. Recognise them instead: a notification for any window of an app we are
moving, or have moved in the last 300ms, is an echo and is swallowed. With the
mouse down it is only taken for somebody grabbing the window, and the animation
let go of, if the window's origin is nowhere we put it, so that apps which snap
or clamp their size are not mistaken for a drag.

Once an app has had a window animated, the move and resize notifications that
arrive while the mouse is up are also throttled per window, so that an app that
will not stop reporting cannot fill the event channel and cost the window
manager real events such as focus changes.

Borders no longer ask a window where it is while it is being animated, as the
animator moves them. A drag cancels the animation of the window being dragged,
and what is known about a process is forgotten when it terminates, as a new
process may be given the same id.
2026-10-29 16:38:24 -07:00
LGUG2Z 590e0ad57a feat(window): animate windows with the animator
Every animated window used to get a thread of its own that slept between frames,
so neighbouring windows moved out of step, a retarget had to wait for the old
thread to notice (a 125ms poll), every frame wrote both the position and the
size, and the app-side animation guard was applied to the window element, where
AXEnhancedUserInterface does not live, instead of the application element.

Move windows with the animator instead, and remove the thread-per-window engine
and the render dispatcher. Stacking operations suspend animations with a guard
instead of swapping the global flag, which was left off for good if the
operation failed, and the animator is shut down before the daemon puts every
window back where it found it.

The configuration is untouched: enabled, duration, style and fps, global or per
animation, are read exactly as before, and nothing is added to it. An fps of 0
no longer panics.
2026-10-29 16:38:24 -07:00
LGUG2Z c4b5738706 feat(animation): add the animator that moves windows
Run the state machine on one frame thread that steps every animated window on
the same clock, and hand the writes to a lane per app, which make them side by
side. The frame thread never talks to an app, and a frame is only started once
the last has been applied to every moving window, so that neighbouring windows
stay on the same frame and the gaps between them do not open and close. An app
that takes longer than a frame is not waited for.

Also expose the pieces the window manager needs around it: animation::motion_for
to read the configured duration and style for a kind of animation, and
animation::suspend to skip animations for as long as an operation runs, which
unlike turning the global setting off and on again puts everything back when the
operation fails part of the way through.

Nothing uses it yet.
2026-10-29 16:38:24 -07:00
LGUG2Z 17943f5c0a feat(border_manager): let a border follow a window that is being moved
Borders follow a window through their own AX observer, which asks the window
where it is over AX on the main thread for every notification, so a border lags
a window that is being moved a frame at a time. Add a way to hand a border the
frame a window has just been moved to instead, batched onto the main thread
once per turn with only the latest frame of each window applied.

The border state is held by the border thread while it creates borders, which
it does by waiting for the main thread, so it is only ever tried, never waited
for, from there; frames that find it busy are put back and tried again.
2026-10-29 16:38:24 -07:00
LGUG2Z 190f9b44ce feat(animation): add a notification throttle and animation stats
An app that moves its own windows, or is moved faster than it can report, can
send a notification for every frame, and the window manager's event channel is
small. throttle lets one through per window per interval. stats keeps just
enough of how an animation burst went to answer why it felt slow from the log:
how regular the frames were, and how long the apps took to apply them.
2026-10-29 16:38:24 -07:00
LGUG2Z 877c4e0e28 feat(animation): add the state machine for animating windows
Keep the bookkeeping of an animation free of threads, clocks and macOS APIs, so
that it can be tested with a fake clock. step holds the maths, and tracks knows
which windows are in flight, where each is, where it is going, and what has to
be written to it next, in whole-frame steps that are handed back as commits for
a runtime to carry out:

- retargeting a window overwrites its target and carries on from where it is
- only the dimension that changed is written, and an app that is slow to apply
  a size is sent them less often, so that it keeps moving in between
- where a window was last put is remembered, so that a window can be animated
  without asking it where it is
- a finished window is verified, and re-sent if the app ignored the move
- work that is never reported on is given up on after a few seconds
- the notifications our own writes cause are recognised as echoes, by window
  and by process, unless the mouse is down and the window's origin is nowhere
  we put it, in which case somebody has grabbed it
2026-10-29 16:38:24 -07:00
LGUG2Z ecc3d4a9aa feat(accessibility): turn an app's own animations off while its windows move
AXEnhancedUserInterface makes an app animate every move and resize it is asked
to make over AX. It belongs to the application element, not to a window, and it
is shared by all of an application's windows, so turning it off has to be
reference counted per process, with the last window to finish putting it back.
Almost no app has it on, so an app that has been seen not to is left alone for
a while without being asked again.

Also add a messaging timeout helper, so that an app that has hung cannot hold a
caller for several seconds, and expose the application's own element.
2026-10-29 16:38:24 -07:00
LGUG2Z ea3a7a4551 refactor(reaper): reap a window from its element
notify_on_error needed a whole Window to decide whether a failed write meant
that the window was gone, but only used its id and its element. The tabbed
application check was also subsumed by the validity check that follows it: a
window whose element still answers is never reaped. Add notify_if_gone, which
takes just the id and the element, for writers that do not have a Window,
and have notify_on_error call it.
2026-10-29 16:38:24 -07:00
LGUG2Z 43011bfb5b perf(workspace): only ask a window where it is when the layout needs to know
Workspace::update asked every window where it was, which is a round trip to
the app that owns it, before deciding what to do with it. The answer only
matters for a window that the layout would put entirely out of view, so ask
only then.
2026-10-29 16:38:24 -07:00
LGUG2Z 2cd5884f21 docs(schema): regenerate schemas, nix options and cli docs
Bring the generated files back in line with the code on master.

- schema.json: add monocle_focus_behaviour and the MonocleFocusBehaviour
  definition. schema.asc.json and schema.bar.json were already current.
- nix/komorebi-options.nix: add the monocle_focus_behaviour option.
  nix/komorebi-bar-options.nix was already current.
- docs/cli: add the pages for layout-ratios, monocle-focus-behaviour,
  permissions and toggle-monocle-focus-behaviour. Update 19 pages for
  the --bar flag of enable-autostart, the per-value help of enum
  arguments and reworded help text. Re-wrap 4 pages whose text did not
  change.

How the files were made:

- schemars-nixgen writes the properties of an object in a different
  order on every run, so the files are not regenerated whole. Only the
  new option is added; the rest of a full run was checked to be the same
  lines in another order.
- docgen on master writes a bare fence with no heading and "Usage: name",
  where the pages in docs/cli have a "# name" heading and "Usage:
  komorebic name". The pages keep the format they have.
- Pages are wrapped at 100 columns, the width docgen uses when it does
  not write to a terminal, instead of the width of the terminal the old
  pages were made in.
2026-10-29 16:38:24 -07:00
LGUG2Z ed19380659 fix(border): give the focused window its border while its app still names another
komorebi focuses one window of an application next to another of its
windows, and the application can be slow to say that window is the one
focused, or not say it at all. The border was decided on what the window
server reported, still the other window, so the focused window had none.

Count the window in the focused container as the one with the focus when
the window the window server reports is another window of the same
application that komorebi manages. The decision is a function with tests,
and the border manager traces what it decided for each container.
2026-10-29 16:38:24 -07:00
LGUG2Z 0ce08b84ca fix(wm): leave the focus where komorebi put it when an app comes to the front
An application that comes to the front names its main window, which is
not necessarily the one komorebi focused. When it is another of the
application's windows, komorebi took it as a request to go there:

- parked on another workspace, the workspace reconciliator switched to
  that workspace, so a focus command between windows of one application
  changed workspace;
- beside the focused window on the workspace that is showing, its
  container took the focus back, so the window komorebi had just focused
  lost it.

Do neither when the notification is the application coming to the front
and one of its windows is the focused one here. Choosing a window of the
application is said with AXMainWindowChanged and is still followed. The
decisions are functions with tests.
2026-10-29 16:38:24 -07:00
LGUG2Z 297c4ea0b7 fix(monitor): lay out on the display that replaced the one that went away
Closing a laptop lid with an external display attached swaps one display
for another, so the monitor count is unchanged and the reconciliator
logged "reconciliation not required" while komorebi kept laying windows
out on the old display's work area. Compare the serial numbers as well as
the count and hand the unplugged monitor's workspaces to the display that
took its place.

The workspaces that are not showing kept the work area of the old display
too, so they were put away on a display that was gone and their windows
stayed in view. Refresh the work area of every workspace before putting
them away, and let a window that cannot be hidden not leave the ones
after it in view.

Resize notifications matched monitors by display id, which changes when a
display is reconnected, so they never updated anything and then re-laid
out the focused workspace once per device. Match by serial number, and
only re-lay out when a known monitor changed.
2026-10-29 16:38:24 -07:00
LGUG2Z 8f768fd4ca fix(process_event): follow focus to the window that came to the front
When an application on a hidden workspace came to the front, its focus
was not followed to its workspace, and when it was, the window that came
to the front was not the one that ended up focused.

Follow the notification to its window when the application has no main
window to ask for, say when that was needed, and focus the container of
that window before the reconciliator loads the workspace, instead of
the one the workspace last had focused. The stale focus check then
agrees with where focus went.
2026-10-28 12:29:04 -07:00
LGUG2Z 3e59a2b210 fix(process_event): warn when a focus notification is not followed
A notification that an application came to the front is not followed
while another application is in front. That is right when komorebi has
since moved on to another, and it is also all there is to see when the
window server refused to bring the application to the front at all, in
which case focus moves in komorebi and nowhere else. At debug level it
was left out of the log by default, so the only trace of that refusal
was in the OS log. Make it a warning.
2026-10-27 19:56:30 -07:00
LGUG2Z 95ec707852 fix(window): ask the window server to bring an application to the front
Focusing a window activated its application with NSRunningApplication,
which from a background process reaches the window server as a request
stamped with the time komorebi started. Once the user has typed or
clicked since, the window server turns it away as expired ("Rejecting
expired request") and the application that was in front stays there:
focus moves in komorebi, the border, which only marks the window that
has the keyboard, stays unfocused, and the keys keep going to the
terminal that `komorebic focus` was run from.

Ask the window server directly first, with the request marked as the
user's, which is what clicking a window does. The two private symbols
it takes are looked up when first wanted and not linked, so that macOS
taking one away leaves komorebi starting and focusing as it did, with
one warning. A window server that refuses three times in a row is not
asked again, and a process without a serial number is left to the
usual way without counting against it.
2026-10-27 19:56:20 -07:00
LGUG2Z 2d06e68b48 fix(monitor): show a workspace's windows all at once when switching
Switching workspace hides the windows of the others and restores the
windows of the one that is wanted, one window at a time, each through
the accessibility API and each as slow as the app it belongs to. The
handler took 260 to 430 ms in a recording, and frames taken in the
middle of it show both workspaces on screen together: with Zed and Zen
gone, two WezTerm windows from the old workspace still up and Beeper
and Discord from the new one not there yet.

Workspace::update already batches its window moves with SLSDisableUpdate
and SLSReenableUpdate so that they appear together. Hiding and restoring
did not. BatchedUpdates holds the screen back until it is dropped, which
an early return does too, so an error cannot leave it frozen, and
load_focused_workspace keeps one for the hiding and the restoring. The
wallpaper, which can generate a theme, is put up after it is dropped,
which is why Workspace::restore is split into the windows and the
wallpaper. restore does what it did.

The screen does not change at all for as long as it is held, which is
now the length of the switch. How the private SkyLight calls behave
when it is held for that long, and whether it is long enough to notice,
was not tried on a screen.
2026-10-27 18:46:16 -07:00
LGUG2Z 407a011b5e fix(process_event): follow focus only while the app is still in front
komorebi brings an app to the front with activateWithOptions and then
hears about it from NSWorkspace and the accessibility API some time
later, 0.8 to 1.7 s in a recording, by which time it has often brought
another app to the front. The FocusChange handler took every such
notification at its word, which had two effects:

- focus moved back to the app that had had it, so Left, Left landed on
  the window in between rather than the one two along
- the app of a window on a workspace that is not showing made the
  workspace reconciliator switch to that workspace, which undid a
  workspace change that had been asked for a moment earlier

The handler now asks which app is in front and does not follow a
notification about any other. The last notification that is followed
is always about the app that really is in front, so the state ends up
where the system is. Notifications about an app that is not in front
still go through the rest of the handler, and nothing is ignored when
the accessibility API will not say what is in front.

Found in a recording of the installed build at db1c18b. That the
notifications are late and that the OS front process had moved on was
read off the OS trace; the change itself is tested only for the
decision, and was not tried on a screen.
2026-10-27 18:44:46 -07:00
LGUG2Z 7129778086 chore(deps): cargo update 2026-10-27 12:41:58 -07:00
LGUG2Z db1c18b5b6 fix(wm): make drag-to-resize follow the dragged edge
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.
2026-10-27 12:27:40 -07:00
LGUG2Z bdf10452f1 feat(wm): add monocle_focus_behaviour to gate monocle cycling
LGUG2Z/komorebi@5f629e1 made directional focus cycle the monocle
container in the underlying ring. Useful on a single monitor, but
undesired when focusing across monitors — the focus stays trapped on the
monocle workspace instead of crossing the boundary.

This commit adds a new top-level monocle_focus_behaviour option with two
variants, Cycle (the post-5f629e1f behaviour) and NoOp (the pre-5f629e1f
behaviour, now the default), along with a ToggleMonocleFocusBehaviour
socket message and corresponding komorebic subcommands to flip between
them at runtime.
2026-05-04 19:06:39 -07:00
LGUG2Z 0cc4ca7f67 docs(nix): update options 2026-05-03 11:13:42 -07:00
LGUG2Z 2b4760db1a feat(wm): add global layout_defaults for per-layout default options
This commit migrates this feature as it was implemented in
LGUG2Z/komorebi@24c0ce0b1d by @CtByte.
2026-05-03 11:04:20 -07:00
LGUG2Z 7e54fed8de feat(wm): add threshold-based layout_options_rules for workspaces
This commit migrates this feature as it was implemented in
LGUG2Z/komorebi@d6b17bbc7c by @CtByte.
2026-05-03 10:50:15 -07:00
LGUG2Z d8b0c2964a docs(nix): update options 2026-05-02 14:39:34 -07:00
LGUG2Z 41f338dea3 chore(deps): cargo update 2026-05-01 17:11:27 -07:00
LGUG2Z 323be43556 fix(wm): keep mouse on monocle when toggling w/ mff
This commit fixes a bug where, when toggling on monocle mode, the cursor
would go to the configured hiding corner.

Thanks to ziggee on Discord for pointing this out because I hadn't
noticed it despite using monocle mode all the time!
2026-04-09 20:55:07 -07:00
LGUG2Z 742543188d feat(wm): add dynamic work area offsets
This commit migrates this features as it was implemented in
LGUG2Z/komorebi@d3779e5a74 and
LGUG2Z/komorebi@53c81c4596.
2026-03-29 15:29:50 -07:00
LGUG2Z a17a39ea3b feat(bar): add storage_display_name option
This commit implements this feature as it was added in
LGUG2Z/komorebi@c84fa50fc9.
2026-03-29 15:22:29 -07:00
LGUG2Z 24878dc3a4 feat(wm): cycle monocle container when focusing in direction
The commit migrates this feature as it was added in
LGUG2Z/komorebi@5f629e1f1a.
2026-03-09 16:14:53 -07:00
LGUG2Z b4e12d8c39 chore(dev): begin v0.1.1 2026-03-01 17:46:39 -08:00
LGUG2Z 64341e29a2 chore(release): v0.1.0 2026-03-01 17:13:36 -08:00
LGUG2Z 4398cce054 chore(deps): bump komorebi-layouts for flip axis fixes
This commit pulls in the fixes from
komorebi@634a3e7f3b9f4f7d8108fd5cb86889ad6bebac0f.
2026-03-01 09:20:56 -08:00
LGUG2Z 5a37f6357d fix(bar): avoid bobbing when switching between populated/empty workspaces
This was debugged by Lando Calrissian on Discord who submitted this text
patch. The rest of this commit message is from Lando's investigation
summary shared on Discord:

The left panel in komorebi-bar uses `Align2::LEFT_CENTER` anchor, which
vertically centers the panel content within the bar. When switching
between workspaces with windows (icons) and empty workspaces (text
labels only), the content height differed by ~1-2px, causing the
vertical center point to shift - resulting in visible "bobbing" of the
workspace indicators.

The height inconsistency occurred because:

1. `show_icons()` wrapped content in a Frame with inner_margin
2. `show_fallback_icon()` had NO Frame wrapper
3. `show_label()` had NO Frame wrapper and used default text height

Fix:

1. Wrap `show_fallback_icon()` in the same Frame with inner_margin as
   show_icons
2. Wrap `show_label()` in the same Frame with inner_margin as show_icons
3. Add `ui.set_min_height(self.icon_size.y)` to show_label to ensure the
   label has the same minimum height as icons
4. Change show_label from static to instance method (&self) to access
   icon_size

This ensures all three rendering functions produce consistent content
height, preventing the LEFT_CENTER anchor from shifting when workspace
content changes.
2026-02-16 10:17:38 -08:00
LGUG2Z 1c699ed4c4 perf(bar): reduce cpu usage by sticking to logical pixels
This was debugged by Lando Calrissian on Discord who submitted this text
patch. The rest of this commit message is from Lando's investigation
summary shared on Discord:

Every frame, the update() method checks if egui's window rect matches
the stored size_rect. The comparison code multiplied egui's outer_rect
(which is in logical pixels) by scale_factor, producing physical pixel
values (e.g., 3584x40 on a 2x Retina display). But size_rect stores
logical pixel values (1792x20). These can never match on a HiDPI
display, so every frame:

1. `size_rect != current_rect` evaluates to `true`
2. `position_bar()` is called, sending `ViewportCommand::OuterPosition`
   and `ViewportCommand::InnerSize`
3. Each `send_viewport_cmd` internally calls `request_repaint()` in egui
4. egui schedules another frame → go to step 1

Result: 120fps continuous rendering, consuming ~12% CPU.

Debugging Method:

Instrumented the code with frame counters, FPS tracking, and repaint
cause logging. Systematically disabled components (repaint thread,
komorebi notifications, widget rendering) to isolate the cause. Traced
egui's repaint causes to context.rs:3853 (send_viewport_cmd_to), then
found the size_rect mismatch firing 1112 times in 10 seconds.

Fix:

Removed the erroneous scale_factor multiplication from the rect
comparison, since outer_rect already reports in logical pixels — the
same coordinate space as size_rect.

Result:

┌────────────┬───────────┬───────────────────┐
│   Metric   │  Before   │       After       │
├────────────┼───────────┼───────────────────┤
│ CPU (idle) │ 12-13%    │ 0.0-0.1%          │
├────────────┼───────────┼───────────────────┤
│ Frames/sec │ 120       │ ~1 (timer-driven) │
├────────────┼───────────┼───────────────────┤
│ CPU spikes │ Up to 20% │ None observed     │
└────────────┴───────────┴───────────────────┘
2026-02-16 10:13:15 -08:00