Repository navigation
2.2.0: window drags for SMBAct (GNOME extension and KWin script) - #7
Merged
Merged
Conversation
… event (GNOME) — new operations, API 1 The GNOME Shell extension becomes SMBAct's drag source for positioning windows with the mouse: - grab-op-begin / grab-op-end (pointer moves of normal, movable, resizable windows, primary button), the pointer and the modifiers sampled every 16 ms during the drag, hit-tested against SMBAct's zone table (hitTest.js, a port of SMBAct's hit-test; tests/ runs its fixtures, a byte-for-byte copy); events begin / zone / end with SMBAct's DragEvent shapes; Escape told by the button still down at the end (or the window put back); window closed, monitors changed, workspace changed, overview, fullscreen monitor end a drag cancelled. - dragRestoreSize: a placed window gets its size back during Mutter's grab once the pointer is 12 px off the press, under the pointer at its grab point (a one-axis maximize left first; a full maximize is Mutter's). - nativeTiling: org.gnome.mutter edge-tiling held off for the client (the user's own value saved), given back when the client leaves the bus or the extension is disabled; never written while Tiling Assistant / Tiling Shell is active; no fight when somebody else switches it on. - The extension draws nothing (draws: false): SMBAct draws its zone map and footprint itself (an XWayland window shows above a window in Mutter's move grab, checked in SMBAct's VM). - Everything stops with the client and in disable(); try/catch in every handler; nothing new in enable(). - PROTOCOL.md, README, CI runs the tests and checks the new files; scripts/call.py --drag; version 2.2.0 (not released). Checked in SMBAct's GNOME 50 VM (Ubuntu 26.04, two heads): every default zone on both heads for a Wayland and an XWayland window, restore on drag away, Escape, the hold given back on a kill and a screen lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… dragAnswer, dragRestoreSize, nativeTiling, the drag event) — new operations, API 1
The KWin script becomes SMBAct's drag source on KDE Plasma Wayland, next to the GNOME extension's (one 2.2.0 for both):
- Drags from each window's interactiveMoveResizeStarted (with `move`) / Finished: normal, movable, resizable windows that
are not fullscreen; a keyboard move is left out (KWin warps the pointer to the window's centre for it). The pointer
from workspace.cursorPos on cursorPosChanged (connected during a drag only), a QTimer for a shared edge's pause.
- The hit-test ported into the script (a KWin script is one file; no ?., ?? or object spread), run on SMBAct's shared
fixtures by tests/kwin.test.mjs, which loads the script unchanged into a fake KWin (workspace, options, callDBus,
QTimer) and also covers the drag source, the tiling hold and the watchdog.
- No modifiers from KWin: flags 0, dragWatch answers `modifier: false` (plain zones only). Escape = the window back at
its first frame after it had left it; KWin's own tile (Shift's custom tile) or maximize at the end = no zone
(reasons `tiled` / `maximized`); window closed, outputs changed, desktop changed without the window end it cancelled;
KWin's "Switch desktop on edge" carrying the window along keeps the drag going.
- dragRestoreSize: frameGeometry written during KWin's move once the pointer is 12 px off (a one-axis maximize left
first), checked and written again at most 3 times; KWin keeps the size and the grab share.
- nativeTiling on KWin: options.electricBorderTiling / electricBorderMaximize held off in KWin's memory (`options`:
which), held again on options.configChanged (the re-read values saved as the originals), given back on
suppress: false. kwinrc is never written.
- A watchdog (NameHasOwner every 2 s while the script holds something: a failed callDBus reaches no callback) gives the
hold back and stops the watch when SMBAct leaves the bus.
- PROTOCOL.md ("The KWin script's drags", "KWin's screen-edge tiling"), README, the fixtures' README.
Measured in SMBAct's KDE VM (Kubuntu 26.04, Plasma 6.6.6, two outputs): the in-memory switch holds (P-KDE-1), a size
written during the move holds (P-KDE-4); SMBAct's live check 53 / 53: every default zone on both outputs for a Wayland
and an XWayland window, restore on drag away, Escape, Shift's custom tile, "Apply" during the hold, a kill healed by the
watchdog in 2.4 s (smbact-app scripts/dev/linux/drag-snap/kde/).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New API-1 operations for SMBAct's positioning windows with the mouse. They are listed in
hello'sops, so older SMBAct and plugin pairs keep working.dragWatch {table}(null stops),dragAnswer {drag, allow},dragRestoreSize {drag, width, height},nativeTiling {suppress}, and thedragevent (begin/zone/end/error, the same shapes as SMBAct's helper).dragSource.js,hitTest.js):grab-op-begin/-end, the pointer and modifiers every 16 ms;nativeTilingholdsorg.gnome.mutter edge-tilingoff and gives it back when SMBAct leaves the bus or ondisable().interactiveMoveResizeStarted/Finishedandworkspace.cursorPos;nativeTilingholdselectricBorderTiling/electricBorderMaximizeoff in KWin's memory (kwinrc untouched), takes them again after "Apply", and gives them back when SMBAct's calls stop.draws: false); SMBAct draws the zone map and the footprint.Tests:
node --test tests/*.test.mjs52/52. Live checks in VMs:The scripts and READMEs are in smbact-app under
scripts/dev/linux/drag-snap/{gnome,kde}/.🤖 Generated with Claude Code