Skip to content

2.2.0: window drags for SMBAct (GNOME extension and KWin script) - #7

Merged
glani merged 2 commits into
mainfrom
feature/drag-snap
Nov 22, 2026
Merged

glani merged 2 commits into
mainfrom
feature/drag-snap

Conversation

@glani

@glani glani commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

New API-1 operations for SMBAct's positioning windows with the mouse. They are listed in hello's ops, so older SMBAct and plugin pairs keep working.

  • Operations: dragWatch {table} (null stops), dragAnswer {drag, allow}, dragRestoreSize {drag, width, height}, nativeTiling {suppress}, and the drag event (begin / zone / end / error, the same shapes as SMBAct's helper).
  • GNOME Shell extension (dragSource.js, hitTest.js):
    • drags from grab-op-begin / -end, the pointer and modifiers every 16 ms;
    • the hit-test runs a copy of SMBAct's shared fixture;
    • restore during Mutter's move;
    • nativeTiling holds org.gnome.mutter edge-tiling off and gives it back when SMBAct leaves the bus or on disable().
  • KWin script:
    • drags from interactiveMoveResizeStarted / Finished and workspace.cursorPos;
    • no modifier on KDE;
    • restore during KWin's move;
    • nativeTiling holds electricBorderTiling / electricBorderMaximize off in KWin's memory (kwinrc untouched), takes them again after "Apply", and gives them back when SMBAct's calls stop.
  • Drawing: the plugins draw nothing (draws: false); SMBAct draws the zone map and the footprint.
  • Docs: PROTOCOL.md and README updated. Version 2.2.0 in metadata; no tag yet: the release waits until SMBAct's Windows version is out.

Tests: node --test tests/*.test.mjs 52/52. Live checks in VMs:

  • GNOME 50 on Ubuntu 26.04: 56/56, twice.
  • KDE Plasma 6.6.6: 53/53, twice.

The scripts and READMEs are in smbact-app under scripts/dev/linux/drag-snap/{gnome,kde}/.

🤖 Generated with Claude Code

glani and others added 2 commits November 22, 2026 19:29
… 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>
@glani
glani merged commit 65f3479 into main Nov 22, 2026
1 check passed
@glani
glani deleted the feature/drag-snap branch November 22, 2026 20:52
@glani glani mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant