Commit Graph
3112 Commits
Author SHA1 Message Date
LGUG2Z d2a6d34a6d fix(e2e): log what ends the guest agent's connections
A windowless program has nowhere to print a panic, so the agent
writes panics and ended connections to C:\e2e\agent.log.
2026-10-30 18:22:44 -07:00
LGUG2Z db7d8480ad feat(e2e): sync the neutral core from kfde a563bf9c 2026-10-30 18:22:44 -07:00
LGUG2Z 1874b1fc10 feat(e2e): sync the neutral core from kfde 13270678 2026-10-30 18:22:44 -07:00
LGUG2Z 52f4c96817 feat(e2e): sync the neutral core from kfde 2c7e13dd 2026-10-30 18:22:44 -07:00
LGUG2Z 632b6cc366 feat(e2e): sync the neutral core from kfde 7de53180 2026-10-30 18:22:44 -07:00
LGUG2Z 8a8674ac9b feat(e2e): sync the neutral core from kfde bf5da0e6 2026-10-30 18:22:44 -07:00
LGUG2Z 7c59f3e2c6 feat(nix): run the Windows e2e scenarios with nix run .#e2e-windows
E2E_GOLDEN names the golden image built by build-golden.sh; the komorebi,
komorebic and test window binaries, QEMU, swtpm and an OVMF with TPM support
come from the flake. Also exposes the guest agent and the test window as
packages.
2026-10-30 18:22:44 -07:00
LGUG2Z fc38fbf739 feat(e2e): sync the neutral core from kfde a1024d16 2026-10-30 18:22:44 -07:00
LGUG2Z 8c990e4e1d feat(e2e): sync the neutral core from kfde 06c2b6e2 2026-10-30 18:22:44 -07:00
LGUG2Z e20e02bd12 feat(e2e): sync the neutral core from kfde 7db3f9c5 2026-10-30 18:22:44 -07:00
LGUG2Z 3ae77df287 fix(nix): build the Windows SDK the same on every host
xwin makes case-alias symlinks on a case-sensitive filesystem and none on a
case-insensitive one, so the SDK hash depended on the host. Build with
--disable-symlinks, pin that tree's hash, add the CA bundle xwin needs, and
add the lowercase aliases the linker asks for in a separate derivation.
2026-10-30 18:22:44 -07:00
LGUG2Z 048cf3b951 feat(e2e): sync the neutral core from kfde 79f05a86 2026-10-30 18:22:44 -07:00
LGUG2Z 76918d5a88 feat(e2e): sync the neutral core from kfde 5e7e4ff1
Adds commands.unknown_monitor: a window sent to a monitor that does not
exist must stay managed. From kfde change lkprqpuv.
2026-10-30 18:22:44 -07:00
LGUG2Z d2adcc9c28 feat(e2e): sync the neutral core from kfde 8b86c8ee
The commands sweep plugs in a second display first when the platform has
only one. From kfde change xzwqolrv.
2026-10-30 18:22:44 -07:00
LGUG2Z 72681c9913 feat(e2e): sync the neutral core from kfde 934fa65a
Platform gains displays, add_display, remove_display and komorebic_status,
Checks gains skip, Snapshot gains workspace_of, and the core gains the
commands, rules and hotplug scenarios. From kfde change swulsqkl.
2026-10-30 18:22:44 -07:00
LGUG2Z 40a9aa3739 feat(e2e): sync the neutral core from kfde 57e510da
Platform gains close(client), and the core gains the monocle and closing
scenarios. From kfde change nykrktvm.
2026-10-30 18:22:44 -07:00
LGUG2Z 94333870d8 feat(e2e): sync the neutral core from kfde 0be4c6ee
The Platform protocol gains has() and a Pointer, and the core gains the
resize scenario that drags the edge two tiles share. From kfde change
wumvluop.
2026-10-30 18:22:44 -07:00
LGUG2Z b34b02814f feat(e2e): sync the neutral core from kfde 6b6b7bb5
The recorded kfw and kfde states are now fixtures read by test_recorded.py,
and the sync script copies them. The only change inside komorebi_vm.core is a
diagnostic print in the workspaces scenario. From kfde change vvplllnz.
2026-10-30 18:22:44 -07:00
LGUG2Z 5ea4057ec5 fix(e2e): give the guest agent no console window
The agent opened a console, which the daemon under test tiled as a window of
its own, so every scenario saw one window too many. Build it as a windows
subsystem program and start its children with CREATE_NO_WINDOW.
2026-10-30 18:22:44 -07:00
LGUG2Z d00c4436d0 feat(e2e): vendor the neutral core from kfde
komorebi_vm.core (Rect, Checks, pixels, Snapshot, the Platform protocol and
the first scenarios) and its unit tests, copied by kfde's scripts/sync-e2e-core
from kfde change mxoqrxnx (accdd653). kfde is the source of truth until the
core moves here; the copy is not to be edited in this tree.
2026-10-30 18:22:44 -07:00
LGUG2Z eee24dad36 feat(e2e): add the guest agent and the test window for the Windows guest
komorebi-e2e-agent runs in the interactive session of the guest and answers
the host over a forwarded TCP port: exec, spawn, os_windows (DWM frame, cloak
and focus), displays, window verbs and file transfer. komorebi-testwin is a
plain Win32 window with a stable exe name and class and a control channel on
stdin. Both cross-build from Linux and pass clippy; neither has run in a
guest yet.
2026-10-30 18:22:44 -07:00
LGUG2Z 0c6864b4bc feat(e2e): add the W0 probe for a Windows 11 guest under QEMU
An unattended install of the Windows 11 evaluation ISO under QEMU with nested
KVM on WSL2, and a boot script that times the golden image to a desktop.
Measured: install 21.6 min, desktop in 36 to 51 s, with other VMs running.
W0.md records the numbers and what was found on the way: no SMM under nested
SVM, so no secure-boot OVMF; the firmware needs TPM support for Setup to see
the TPM; and the evaluation reads as expired unless the guest clock is set
back.
2026-10-30 18:22:44 -07:00
LGUG2Z 72aa4c97ad test(border): leave the paint tests to a real desktop
They create a window and a Direct2D border and check that it is painted, which
needs a desktop to paint on. Run them with --ignored.
nightly
2026-10-30 18:21:25 -07:00
LGUG2Z b3dc2ed903 test(nix): maximizing.user follows what both ports do
The scenario asked the daemon to ignore toggle-float and the stacking
commands while a window is maximized, which komorebi for Windows does
not. They are out of the ignored list, and the scenario checks that
toggle-float floats the maximized window, ends the maximize, and puts it
back in the layout the second time. BEHAVIOUR.md says the ports agree.
2026-10-30 17:13:50 -07:00
LGUG2Z aafc52f42d feat(process_command): toggle-float and stack act on a maximized window
komorebi for Windows does not ignore them while a window is maximized:
toggle-float floats the maximized window, which ends the maximize, and
stack left and stack right stack the tiles that are left. The other
layout commands stay ignored. The tests that listed the two as ignored
say so no more, and two new ones say what they do.
2026-10-30 17:13:50 -07:00
LGUG2Z e6a22e41d6 fix(nix): set_wallpaper tries again until the Plasma shell takes it
The first call of a session that has only just started can find the shell
busy, and plasma-apply-wallpaperimage fails once. wallpaper.run then
failed at its first step for no reason of its own.
2026-10-30 17:13:50 -07:00
LGUG2Z 635a64d857 style(nix): the package list of the VM library as treefmt writes it 2026-10-30 17:13:37 -07:00
LGUG2Z 434e2bc1d8 test(nix): the ring of wallpaper is read outside the frame
A port whose test window has a color of its own put it in the ring, and
a warm ring beside a cool window read as mixed. Both ports draw the
border outside the frame, so what is inside it is not read. The fake
leaves room for the ring and follows focus-workspace. BEHAVIOUR.md says
what kfw's next has fixed or found since: the maximize, the killed
daemon, and the top edge.
2026-10-30 16:50:07 -07:00
LGUG2Z 7263151275 test(nix): a failed ring check of wallpaper prints what it saw
The frame of the window, the hue that was found and the colors of the
pixels near its left edge, so that a port whose border is not repainted
(or is drawn elsewhere) can be told from one that has no border.
2026-10-30 16:39:15 -07:00
LGUG2Z 1f0ec180ca test(nix): resize presses wait for the frames to match the layout
A frame that is still on its way to its tile is not where its border is:
a press on it lands on the window, and a drop on another tile swaps
windows. kfw saw it once in three runs of edge_cases. The press now
waits until every window is where the daemon's layout says.
2026-10-30 16:39:15 -07:00
LGUG2Z aa353a7158 fix(border): do not look for a border while holding the ghosts
The border manager holds the locks of the borders while it handles a
notification and asks whether a window is ghosted as it does, which takes the
lock of the ghosts. An animation of a ghost for a window that had no border
when it was made, a new window, took the lock of the ghosts first and then
looked for the border, which takes the locks of the borders. Each waited for
the other, for good: the border manager answered no more notifications, which
piled up until they were dropped, and every animation that was landed after
that waited for its full two seconds with its ghost on screen.

Look for the border with nothing held, and remember it afterwards.
2026-10-30 16:18:33 -07:00
LGUG2Z dedcab71bc test(nix): share the wallpaper scenario, and the files kfw must sync
Wallpapers and the colors of the borders that come from them are in the
config of both ports. wallpaper.run is the neutral part: a monitor's
wallpaper at start, a workspace's own while it is shown, the ring in the
hue of the wallpaper, and a changed wallpaper put back. Platform gets
put_file, wallpaper and set_wallpaper; in a Plasma session restart_with
restarts the module's unit with the user's komorebi.json. The KDE extra
keeps what only the shell tells. sync-e2e-core carries the two fakes the
shared tests import.
2026-10-30 16:18:32 -07:00
LGUG2Z a8e79ca5d2 test(nix): share the columns of the scrolling layout, and two monitors
The checks of the scrolling suite were KDE's, but kfde and komorebi for
Windows lay the strip out with the same model. scrolling.columns is the
scenario of the five windows in two columns, now run by the scrolling
suite and by core-e2e; scrolling.two_monitors checks that a strip with a
display next to it leaves no window shown on that display.
2026-10-30 16:18:32 -07:00
LGUG2Z 9922a34bd7 chore(border): say what the border manager is stuck on
A recording had the thread that handles border notifications stop answering
after it put a border in place, while the channel it reads from filled up and
every animation that landed after that waited for its full two seconds.
Nothing said where it was.

Say what step the thread is in, warn once when it has been in one for two
seconds, say when a border has been put in place, and name the animations that
did not land, with what each of them was doing.
2026-10-30 16:13:07 -07:00
LGUG2Z 961c62383d fix(border): paint a border that is shown asynchronously
With window_handling_behaviour set to Async, a window is shown by the thread
that owns it, after the call to show it has returned. A new border was
invalidated before that, and the show does not redraw it, so it stayed blank
until something else made the border manager invalidate it again, which a
window that is restored by the user does not do.

Invalidate the border from the thread of its window, which handles what it is
sent in order, after the show.
2026-10-30 16:07:49 -07:00
LGUG2Z 103e2cf4bf chore(border): trace why a border is not painted
A border that is created and shown but never painted looks like a border
that was never made. Say when one is created, set and painted, and why a
paint is skipped, along with what the border manager saw of the foreground
window when it was notified.
2026-10-30 16:02:07 -07:00
LGUG2Z 3fa3d429fa feat(wm): track a window the user maximizes or restores
A window maximized with its button or title bar fills the work area, but the
window manager only had a window as maximized when it was done by the
command, so the layout was not put back when it was restored and the rest of
the workspace was laid out around a window that took all of it.

The location change of a window of the window manager is looked at for a
change of whether it is maximized, and the window manager is told of one as
Maximize and Unmaximize, which do what the command does. What the command
itself does is already known by the time these are read.
2026-10-30 15:51:24 -07:00
LGUG2Z b4edd1c023 feat(nix): the platform says where a resize border is pressed
The press point of the resize scenarios was a gap outside the frame, which
is KDE's resize zone. On Windows there is no invisible border on the top
of a window, so a press there reached the desktop. Platform.resize_grab
gives each port its own point; KDE keeps the gap outside the frame.
2026-10-30 15:50:24 -07:00
LGUG2Z 365d705c75 fix(animation): land every animation of a batch on its own
The last frame of the animations of a batch was drawn one after the other
before any of them was landed, so one window that did not come back from it
kept all of them from landing: their ghosts stayed up, their borders stayed
where the animation had put them, and nothing was logged as done.

Each animation now draws its last frame and lands on a thread of its own, and
the engine waits for the batch for two seconds at most.
2026-10-30 15:45:37 -07:00
LGUG2Z 2a1716bbff docs(schema): regenerate the bar schema for the pan commands
schema.bar.json embeds the socket messages, so it gets Pan, with the PanDirection that it
takes, and PanGesture, with what the fingers of a gesture do. The other two schemas are
the same as they were.
2026-10-30 15:45:37 -07:00
LGUG2Z a65b5c231e feat(komorebic): pan the Scrolling layout with the fingers on a touchpad
komorebic pan --stream reads the gestures of fingers on a touchpad from standard input, as
whkd writes them for a swipe of three or four fingers (docs/gesture-stream.md in its
repository): a line for each begin, move, end and cancel, with the distances in centimetres,
and any field or message that it does not know ignored. The row follows the fingers while they
are down, and when they lift it comes to rest with a column against an edge of the screen,
going at the speed that the times of the moves say that the fingers were. Focus goes to the
nearest column in view if the focused one is not. A gesture that is given up, or that is
not finished when the stream stops, puts the row back to what it was.

komorebic works out nothing but what it is asked to: --sensitivity multiplies the distances,
--reversed flips the way that the row goes, and --paging takes a step for every two
centimetres that the fingers go, as komorebic pan does, and not move the row with them. Moves
that wait while one is told are added up, as whkd says that they may be.

A gesture is told to komorebi on one connection, which it handles in order, as messages
that are sent on a connection each are not. With ghost movement the pictures that cover the
windows near the screen are taken when the fingers go down, a move of the fingers sets them
where the row puts the windows and does nothing else, and when the fingers lift they glide to
where it comes to rest, over the time that an animation takes, and the windows are shown. Without
it the workspace is laid out a step at a time, as it is for a drag. Ten centimetres of the
fingers move the row the width of the screen. The golden transcript of whkd and the swipes
of its demo are fixtures of the tests that read the stream.
2026-10-30 15:45:37 -07:00
LGUG2Z a63057c232 feat(komorebic): pan the Scrolling layout to the left or the right
komorebic pan <left|right> moves the view along the row of the Scrolling layout by a column
without moving focus first, and lets it come to rest with a column against an edge of the
screen. Focus goes to the nearest column on the screen if the focused one has gone off it. It
does nothing in the other layouts.

The way that the view goes is the way that focus goes for the commands that have directions:
panning to the left brings what is to the left of the screen into view, which is to move the
row to the right.

This is a command that a wheel can be bound to, as it is with whkd:
alt + wheelup : komorebic pan left.
2026-10-30 15:45:37 -07:00
LGUG2Z dd961f50f6 fix(border): draw a border again for a window that is not where it was drawn
A border follows its window from its own thread, which draws it again when the window has
changed its size or its place, and compares the window with window_rect to see whether
it has. The border manager sets window_rect too, from its thread, to where it finds the
window when it is told that the layout has changed, which is before windows that are moved
without waiting for them (window_handling_behaviour Async) have moved, or after, and when it
is after, the border sees a window that is where it already is and is not drawn again: in
a recording of three commands that resize windows the border of the focused terminal stays
the size that it was while the window grows by 200 pixels, and those of the others follow.

A border remembers the rect that it was last drawn around, and is drawn again for a window that
is not there, whatever window_rect says.
2026-10-30 15:45:37 -07:00
LGUG2Z 0811292de6 fix(resize): lay windows out in place for the commands that resize them
The pictures that stand for windows while they are moved by an animation are dimmer
and softer than the windows: text in the main terminal of a recording of resize commands
has its brightest pixels at 180 where the window has 215, and half as many pixels brighter
than 140 while the picture is up. Every resize command lays out the windows that it makes
bigger or smaller, and repeating them puts a picture over each of them every time, so it
is the commands that show it.

Windows are put where they go at once while the commands that resize them are handled, as
they are with animations off, and one that is on its way somewhere is stopped where it is
first. Dragging the edge of a window to resize it is not one of them, and has the pictures
that cover the windows that follow it, as it did. Animations of other commands are as they
were.
2026-10-30 15:45:37 -07:00
LGUG2Z 57084c4ddf fix(scrolling): put the left edge of a column where it is dragged to, however far
A column that is resized by its left edge is made wider and the strip is panned by what
it was made wider by, so that its left edge is where it was moved to and its right edge
where it was. But a column that is made wider than the room that it has to the right is
brought into view as it is made wider, which moves the strip already, so that for what
was beyond the room the strip moved twice. A recording of a drag of the last column
of a strip, 1342 pixels, has the strip 1008 pixels too far to the left at the end of it,
and every step with the strip moved by twice what the drag was less the room there was.

Say where the right edge of the column is before and after it is made wider, and pan by
the difference, which is what is left to put back whether the strip moved or not.
2026-10-30 15:45:37 -07:00
LGUG2Z 1a36f39870 fix(animation): make ghosts on a host that DWM does not crop
DWM draws a thumbnail that is stretched on a host that a thread that is aware of the
scaling of the display made with only part of its picture: a picture 1227 pixels wide
that was asked to be shown 1767 wide came out 342 wide on a host as wide as the screen at
125%, the further to the right the less of it, and all of it from a thread that is not
aware. A recording of a drag, where a tile grows while the pictures of its windows are
what is seen of them, shows File Explorer windows cut off at the right, and the trace of
what is asked of DWM shows the sizes and the picture to be the right ones.

When every display is scaled alike, and it is not 100%, the thread that owns the host
makes it, and the windows that show the pictures, as a thread that is not aware, whose
units are those of the screen divided by that scale. Where a ghost goes is worked out in
pixels as before and turned into those units where it is asked of DWM, and the part of a
picture that is shown into the units that DWM has the picture window in. Displays that are
scaled differently, or not at all, are as they were.

Measured by drawing pictures through the host and recording the screen, from a process that
is aware, at 125%: the pictures that were drawn 1226, 1074, 902, 742, 598, 460 and 342 wide
for sizes of 1227 to 1767 are now drawn 1225, 1315, 1405, 1495, 1585, 1675 and 1765 wide,
with the picture in the proportions that it has.
2026-10-30 15:45:37 -07:00
LGUG2Z 2560ee6364 feat(resize): cover the windows that a drag resizes with a picture of them
Resizing the tiles next to the edge of a window that is dragged lays out every window
that is not the one dragged again at every frame. A window that has to lay itself out
at a new size has nothing to show for a frame, a terminal that renders through a swap
chain is not there at all and the wallpaper shows through where it was, and one that is
slow to take a move, which File Explorer is, is seen at every size that it is on the
way through. A recording of a drag shows whole terminals gone for a frame, and
Explorer windows drawn twice, each of them at two sizes.

With ghost movement, the first time a step has to resize a window a picture of it is
taken before it is touched and put over it, the window is cloaked and its border is left
to the picture. Every step moves the picture, and the border with it, to where the window
is to be, with one call to DWM, and sends the window nowhere: the window is where it
was, hidden. When the end of the drag has laid the workspace out, each of the windows
that were covered is put, on a thread of its own, where the last step put its picture, made
to paint itself, given the size change that a swap chain needs to be built again, and
shown, and its picture fades out over it, as for a move that is animated.

A new drag, before that, puts them where they were to go and shows them at once. The look
at the windows after a drag leaves covered ones to this, and a window that is hidden by its
workspace is not shown by it. Every step traces where the picture is to go and what part
of it is shown there, and a picture that could not be moved says so at debug level.
2026-10-30 15:45:37 -07:00
LGUG2Z 18708d6db8 fix(resize): measure a drag from where the tile was, not where the window had got to
The start of a drag is handled after the drag has begun, so the rect read
then is already some way into it, and a mouse resize came out short by
that much: dragging an edge by 60px moved it 53px, and the longer the
drag the more was lost.

An edge that has moved since the start was read was taken from the edge
of the window's tile, so measure from that. An edge that has not moved
is not being dragged, and an edge a long way from its tile is a window
that could not be as small as it, so both stay as they were read.
2026-10-30 15:45:37 -07:00
LGUG2Z 48e30d9585 fix(scrolling): resizing a column by its left edge moves that edge
A column was made wider, or narrower, from its left edge whichever edge was
resized: dragging the left edge of the last window of a strip to the left made it
wider to the right, which is where its right edge went, and its left edge stayed
where it was. In the recording of the drag, it was the same window, 1651 wide
before and 1982 wide after, still at the same left edge, to the right of where the
user had put it.

The strip is panned by what the column was made wider by, so that the left edge is
where it was moved to and the right edge stays, and the columns to the left of the
column follow it. The right edge is the one that moves for any other direction, as
it was.
2026-10-30 15:45:37 -07:00
LGUG2Z f9610dd373 fix(logging): do not look up what a window is for every location change
A window that is moved sends a location change for each of the windows in it, and
File Explorer sends about eighteen for every move. Each one had the hook look up the
exe, the title and the class of the window, a call into it for each, to write a trace
line that says that nothing is done with it: about a millisecond and a half each,
holding up the events behind it, which include those of the window being dragged.

They are no longer logged.
2026-10-30 15:45:37 -07:00