mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-22 08:31:50 +01:00
feat(wm): the neighbours follow the drag
While the user drags an edge of a tiled window, the tiles next to it follow, and not only once it is let go. KWin reports every step of a resize with the frame the pointer asks for. The bridge passes one on every 16 ms at most, the newest, with a single-shot timer for the last one of a burst, and the window manager keeps at most one step waiting, since each says where the edge is now. ResizeStart keeps the layout as it is when the user takes hold (LiveResize), and every step and the end are worked out from it: a drag ends the same with its steps as without them, and one that is taken back puts the neighbors back. The dragged window is the user's until they let go, so Window::set_position leaves the windows being resized alone, whatever tiles the workspace. vm-live-resize holds the edge part way and all the way and reads the neighbors while the button is down. With the neighbors following, KWin's window snapping pulled a dragged edge 9 pixels past the pointer in vm-drag-resize, since the gap between two tiles is inside its default zone, so both drag suites turn snapping off; PLATFORM.md and drag-resize.md say so. Like vm-drag-resize, it drags against the daemon the module starts with the session, and reads the drags that daemon has handled from the unit's journal. vm-live-resize waits for the panel's room (Kde.wait_for_panel_room) before it opens the windows. The daemon learned of the room while the pointer was down in a first case that had begun without it, and the retile that came with it moved the neighbor, not the pointer.
This commit is contained in:
1 parent
af560f47d7
commit
c03e5d2970
21 files changed
+1026
-32
No files matched your search
@@ -564,3 +564,26 @@ frame event KWin sends a millisecond after the end changes the frame in the tabl
|
||||
manager reads it. The end of the drag has to survive that, so it is not the window's frame. The
|
||||
frame events go on updating the window's frame, and the retile that ends the drag puts the window on
|
||||
its tile. A move changes no size, so the end of a move is the frame.
|
||||
|
||||
## Why is every step of a drag worked out from where the drag began?
|
||||
|
||||
A step says where the user has the edge now, so the drag so far is the distance from the start,
|
||||
not something to add to the step before. Starting each step, and the end, from the layout as it
|
||||
was when the user took hold makes the result of a drag the same with its steps as without them,
|
||||
and a drag that ends where it began puts the neighbors back where they were.
|
||||
|
||||
## Why is the window whose edge is being dragged not moved during the drag?
|
||||
|
||||
It is the user's until they let go: KWin moves its edge with the pointer, and komorebi puts it on
|
||||
its tile when the drag ends. A step tiles the workspace to move the neighbors, and so can anything
|
||||
else that happens during the drag, such as a window that opens. The guard is in
|
||||
`Window::set_position`, for the windows being resized, so that whatever tiles the workspace leaves
|
||||
the dragged window alone.
|
||||
|
||||
## Why are the steps of a drag thinned out?
|
||||
|
||||
The pointer makes far more steps than anyone needs. The bridge sends one every 16 ms at most, the
|
||||
newest, and a single-shot timer sends the last one of a burst, so the edge's final place is not
|
||||
lost. Each step says where the edge is now, so one waiting in the window manager's channel is
|
||||
enough: the window manager asks the window where its edges are when it gets to the step, and that
|
||||
is the newest.
|
||||
Reference in new issue
Block a user