remotedesktop 1.9.3__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/CLAUDE.md +14 -9
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/PKG-INFO +28 -14
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/pyproject.toml +7 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/readme.md +25 -12
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/__init__.py +1 -1
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/about.py +34 -4
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/app.py +181 -16
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/autostart.py +46 -40
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/client.py +3 -0
- remotedesktop-2.2.0/src/remotedesktop/clipboard.py +326 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/discovery.py +16 -2
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/frames.py +2 -4
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/performance.py +8 -11
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/preferences.py +76 -19
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/protocol.py +2 -2
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/server.py +33 -25
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/sharing.py +39 -36
- remotedesktop-2.2.0/tests/test_about.py +42 -0
- remotedesktop-2.2.0/tests/test_autostart.py +99 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_clipboard.py +153 -1
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_discovery.py +42 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_main_window.py +162 -7
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_performance.py +2 -2
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_preferences.py +44 -14
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_sharing.py +0 -20
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_sharing_tab.py +8 -9
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tools/make_demo_gifs.py +2 -2
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/uv.lock +11 -0
- remotedesktop-1.9.3/src/remotedesktop/clipboard.py +0 -120
- remotedesktop-1.9.3/tests/test_about.py +0 -32
- remotedesktop-1.9.3/tests/test_autostart.py +0 -113
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/.github/workflows/ci.yml +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/.github/workflows/release.yml +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/.gitignore +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/LICENSE +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/docs/media/client-demo.gif +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/docs/media/server-demo.gif +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/icon/remotedesktop.ico +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/run.bat +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/run_claude.bat +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/scripts/make_coverage_badge.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/scripts/make_installer.bat +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/scripts/make_venv.bat +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/__main__.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/compat.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/config.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/cursor_shape.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/db.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/dxgi.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/icon.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/input_injection.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/inventory.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/logs.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/modal_loop.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/session_lock.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/single_instance.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/tls.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/viewer.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/visual_effects.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/src/remotedesktop/window_state.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/conftest.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_compat.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_config.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_cursor_shape.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_dxgi.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_frames.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_icon.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_input.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_input_injection.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_inventory.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_logs.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_modal_loop.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_protocol.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_session_lock.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_single_instance.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_smoke.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_tls.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_visual_effects.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tests/test_window_state.py +0 -0
- {remotedesktop-1.9.3 → remotedesktop-2.2.0}/tools/make_icon.py +0 -0
|
@@ -49,6 +49,11 @@ running instance holds the CLIP's DLLs locked. Do not set
|
|
|
49
49
|
`[tool.pyship] run_on_startup` or signing keys in `pyproject.toml` (see the
|
|
50
50
|
comments there).
|
|
51
51
|
|
|
52
|
+
**No backwards compatibility is required** (per the user): upgrades just
|
|
53
|
+
must not crash. Don't add migration shims, legacy-key/value handling, or
|
|
54
|
+
old-peer fallbacks for new work — old data may be dropped or reset, as long
|
|
55
|
+
as failure is graceful.
|
|
56
|
+
|
|
52
57
|
## Commands
|
|
53
58
|
|
|
54
59
|
Managed with `uv` (hatchling build backend, src layout):
|
|
@@ -56,7 +61,7 @@ Managed with `uv` (hatchling build backend, src layout):
|
|
|
56
61
|
- `uv sync` — create/update the venv with the project and dev dependencies
|
|
57
62
|
- `uv run pytest` — run all tests
|
|
58
63
|
- `uv run pytest tests/test_smoke.py::test_version` — run a single test
|
|
59
|
-
- `uv run remotedesktop` — launch the app. It's a `gui-script`, so it runs detached with no console output; use `uv run python -m remotedesktop` when you need stdout/tracebacks. `--minimized` starts hidden in the tray when sharing is on
|
|
64
|
+
- `uv run remotedesktop` — launch the app. It's a `gui-script`, so it runs detached with no console output; use `uv run python -m remotedesktop` when you need stdout/tracebacks. `--minimized` starts hidden in the tray when sharing is on, otherwise minimized to the taskbar (the default autostart registration passes it); `--maximized` starts maximized.
|
|
60
65
|
- `uv build` — build sdist and wheel into `dist/`
|
|
61
66
|
- `uv publish` — publish to PyPI
|
|
62
67
|
- `scripts\make_installer.bat` — build the **signed Windows installer** with pyship
|
|
@@ -70,22 +75,22 @@ Managed with `uv` (hatchling build backend, src layout):
|
|
|
70
75
|
## Architecture
|
|
71
76
|
|
|
72
77
|
- One PySide6 GUI app: `src/remotedesktop/app.py` (`MainWindow` + `main()`, wired to the `remotedesktop` GUI script in `pyproject.toml`; `__main__.py` makes `python -m remotedesktop` work — the in-app Restart relaunches that). `client.py` holds the viewing-role widgets (`DiscoveryPanel`, `ServerSession`), `server.py` the sharing-role widgets (`SharingTab`, `ViewersTable`) — neither has a window or entry point of its own anymore.
|
|
73
|
-
- **The sharing lifecycle** (`server.py` `SharingTab`) lives on the "Connections" tab, arranged as one outer QGroupBox per role, side by side as widgets with "Connection log" full-width below: "Client (viewer)" (left; nests "Connected servers" — `app._SessionsTable`, the client-side twin of the viewers table fed by `_ConnectedServersSource` from the live sessions and `client_performance` — over "Server history", client-role inventory, Forget) and "Server (sharing)" (right; the `SharingTab` summary + viewers table over "Client history", server-role inventory, Revoke). **Each role box is visible only while its role is on** (`_update_connections_groups`); boxes are widgets (not column layouts) so a hidden role frees its space and the other starts at the left edge. **The mode itself is chosen in Preferences**: a three-state radio group (`preferences.py`, `sharingModeChanged` signal) wired by `MainWindow` to `SharingTab.set_mode("off"/"view"/"control")` — `server.py` exposes `SHARING_MODE_*` constants and `load_sharing_mode(settings)`, persisted as the
|
|
74
|
-
- **Tray + lifecycle** (`app.py`): while sharing, closing the window hides to a `QSystemTrayIcon` (menu: Show / Restart / Quit) and sharing continues; not sharing → close quits. `main()` sets `setQuitOnLastWindowClosed(False)`, so **every exit path must reach `QApplication.quit()`** (plain close, tray Quit, restart). `tray_available=` is injectable — tests always pass an explicit value and never call `isSystemTrayAvailable()`. `--minimized`
|
|
78
|
+
- **The sharing lifecycle** (`server.py` `SharingTab`) lives on the "Connections" tab, arranged as one outer QGroupBox per role, side by side as widgets with "Connection log" full-width below: "Client (viewer)" (left; nests "Connected servers" — `app._SessionsTable`, the client-side twin of the viewers table fed by `_ConnectedServersSource` from the live sessions and `client_performance` — over "Server history", client-role inventory, Forget) and "Server (sharing)" (right; the `SharingTab` summary + viewers table over "Client history", server-role inventory, Revoke). **Each role box is visible only while its role is on** (`_update_connections_groups`); boxes are widgets (not column layouts) so a hidden role frees its space and the other starts at the left edge. **The mode itself is chosen in Preferences**: a three-state radio group (`preferences.py`, `sharingModeChanged` signal) wired by `MainWindow` to `SharingTab.set_mode("off"/"view"/"control")` — `server.py` exposes `SHARING_MODE_*` constants and `load_sharing_mode(settings)`, persisted as the single `sharing_mode` key. View ↔ control switches apply live (`ShareServer.set_input_allowed`) without dropping viewers; off/on tears down / creates the `ShareServer` + `DiscoveryResponder` (a fresh `ShareServer` per enable; `close()` leaves teardown state), so a viewing-only instance binds no ports and never creates TLS credentials (loaded lazily on first enable). The host window calls `restore_sharing()` after wiring `statusMessage`/`peerEvent`/`sharingChanged`, so no startup status message is emitted before anyone listens. `serving` is mode-on AND actually listening. `revoke_client` works even while not sharing (direct `PairedClients.revoke`). The Restart app button also lives in Preferences (`preferences_tab.restart_button` → `MainWindow._restart_app`).
|
|
79
|
+
- **Tray + lifecycle** (`app.py`): while sharing, closing the window hides to a `QSystemTrayIcon` (menu: Show / Restart / Quit) and sharing continues; not sharing → close quits. `main()` sets `setQuitOnLastWindowClosed(False)`, so **every exit path must reach `QApplication.quit()`** (plain close, tray Quit, restart). `tray_available=` is injectable — tests always pass an explicit value and never call `isSystemTrayAvailable()`. `--minimized` starts hidden in the tray when sharing is on, otherwise minimized; `--maximized` starts maximized. `single_instance.py` (`SingleInstance`, QLocalServer-based) enforces one instance per user session; a second launch tells the first to `bring_to_front()` and exits. **Start at login is a four-way start mode** (`autostart.py` `START_MINIMIZED/NORMAL/MAXIMIZED/OFF`): Preferences radios persist it as `autostart_mode` (`load_autostart_mode`, default **minimized** — the recommended setting) and `PreferencesTab` mirrors it into the HKCU Run value `"remotedesktop"` at every construction, so the start-minimized default takes effect on a fresh install and the registered path follows the current installation. The mode is encoded in the registered command's flag (`--minimized` / none / `--maximized`; no value = off, `Autostart.mode()` reads it back). Tests always inject `Autostart(key_path=...)` pointed at an isolated test key — a real `Autostart` in a test would rewrite the developer's actual Run key at tab construction.
|
|
75
80
|
- The remote desktop view is a widget, `ViewerWidget` in `src/remotedesktop/viewer.py`. Screen display and keyboard/mouse/clipboard forwarding belong in this widget, not in the window. **Multiple simultaneous server connections**: each is a `ServerSession` in `client.py` (its own `ShareClient` + `ViewerWidget`, hosted in a `QScrollArea` tab page — `session.page` is the tab widget, `session.viewer` the viewer), shown as a closable tab at the front of `MainWindow`'s central `QTabWidget`, titled with the server's reported hostname (fixed tabs get their close buttons stripped). Fit mode is `widgetResizable(True)`; **View → Actual size** flips the page to non-resizable and the viewer sizes itself to `frame / devicePixelRatio` (1:1 device pixels, the no-resample paint branch; input mapping unchanged because the frame fills the widget). Sessions are keyed by `host:port`; activating an already-known server reconnects in its existing tab, activating a connected one just focuses it. The window title lists the connected server names and a "— sharing" suffix while serving (`_update_window_title`); the status bar's message area follows the currently selected session tab (`status_text` per session) and a permanent right-side label shows "Sharing — N viewer(s)" whenever sharing is on (driven by `SharingTab.viewerCountChanged`). The `ClipboardSync`, inventories, and Connection log are shared across sessions; `client_performance.reset()` is only called when no *other* session is connected (resetting detaches every stream). Per-session status log lines are prefixed `[name]`.
|
|
76
|
-
- **Auto-reconnect** (`app.py`): a session that *was connected* and drops retries `client.connect_to` with exponential backoff (base `reconnect_base_seconds=2.0` kwarg — tests inject ~0.05 — doubling to a 30 s cap), driven by a per-session single-shot QTimer. `ShareClient.connectionFailed` exists because **Qt emits `disconnected` only for sockets that reached ConnectedState** — refused/unreachable attempts fire `errorOccurred` with the socket back in UnconnectedState. The active-timer guard dedupes the errorOccurred+disconnected double-fire. Denial cancels until a manual activation; tab close/forget/quit cancel; retries bypass `_connect_session` on purpose (no perf reset, no tab steal, no inventory attempt spam). **Open session tabs persist** (`open_sessions` JSON in Settings, written on connect/rename/close) and are restored + reconnected at startup with `auto_reconnect` pre-armed, so a not-yet-available server is retried on the backoff loop; deliberately closed tabs are not restored. While no session exists, a non-closable "Server" placeholder tab (instructions) sits at index 0 and swaps with the first session's tab.
|
|
77
|
-
- **Menus & shortcuts contract** (`app.py` `_build_menus`, `viewer.py`): File/View/Help menu bar; shortcuts Ctrl+W (close session tab), Ctrl+Q (quit), F5 (rescan), F11 (fullscreen). While a viewer shows a frame it **accepts `ShortcutOverride`** so every key forwards to the remote machine — **F11 is the single reserved local key**. Shortcut actions are also `addAction`-ed on the window so they fire with the menu bar hidden (fullscreen). Keep every menu/action as an attribute — PySide6 gives Python ownership of `addMenu`/`addAction` (and `QAction.menu()`) wrappers, and a GC'd local deletes the C++ object. Fullscreen hides menu/status bars, dock, and tab bar and restores them (including pre-fullscreen dock visibility) on exit; `closeEvent` exits fullscreen before persisting layout. Window geometry AND dock layout persist (`window_state.save_state`/`restore_state`, key `main_window_state`; the dock needs its objectName).
|
|
81
|
+
- **Auto-reconnect** (`app.py`): a session that *was connected* and drops retries `client.connect_to` with exponential backoff (base `reconnect_base_seconds=2.0` kwarg — tests inject ~0.05 — doubling to a 30 s cap), driven by a per-session single-shot QTimer. `ShareClient.connectionFailed` exists because **Qt emits `disconnected` only for sockets that reached ConnectedState** — refused/unreachable attempts fire `errorOccurred` with the socket back in UnconnectedState. The active-timer guard dedupes the errorOccurred+disconnected double-fire. Denial cancels until a manual activation; tab close/forget/quit cancel; retries bypass `_connect_session` on purpose (no perf reset, no tab steal, no inventory attempt spam). **Re-discovery follows a moved server**: sessions, tokens, and pins are all keyed by `host:port`, so a DHCP address change across a server reboot would otherwise strand every retry — once `_REDISCOVER_AFTER_ATTEMPTS` (2) direct attempts have failed, each further failure also runs a discovery scan on a worker thread (`rediscover=` kwarg — tests inject a fake, `make_window` defaults it to a no-op so window tests never broadcast; result delivered via the queued `_rediscoveryFinished` signal). A scanned server matching the session's pinned cert fingerprint (discovery replies advertise it as `fp`; display-name match is the fallback for servers too old to send one) at a *different* address migrates the session: the `KnownServers` record is re-keyed (token preserved — no re-approval), the inventory row moves, sessions re-persist, and the connect is immediate with a fresh backoff. This is not background polling — it runs only while a session is failing to reconnect. **Open session tabs persist** (`open_sessions` JSON in Settings, written on connect/rename/close) and are restored + reconnected at startup with `auto_reconnect` pre-armed, so a not-yet-available server is retried on the backoff loop; deliberately closed tabs are not restored. While no session exists, a non-closable "Server" placeholder tab (instructions) sits at index 0 and swaps with the first session's tab.
|
|
82
|
+
- **Menus & shortcuts contract** (`app.py` `_build_menus`, `viewer.py`): File/View/Help menu bar; shortcuts Ctrl+W (close the current session tab or the Preferences tab), Ctrl+, (Preferences), Ctrl+Q (quit), F5 (rescan), F11 (fullscreen). **Preferences and About are not pinned tabs**: File ▸ Preferences… shows `preferences_tab` as an on-demand *closable* tab (the widget is built once at startup — its constructor and signal wiring drive the roles — and `removeTab` on close keeps it alive for the next open); Help ▸ About shows the single modeless `about.AboutDialog` instance (`_about_dialog`, wrapping `AboutPage`). While a viewer shows a frame it **accepts `ShortcutOverride`** so every key forwards to the remote machine — **F11 is the single reserved local key**. Shortcut actions are also `addAction`-ed on the window so they fire with the menu bar hidden (fullscreen). Keep every menu/action as an attribute — PySide6 gives Python ownership of `addMenu`/`addAction` (and `QAction.menu()`) wrappers, and a GC'd local deletes the C++ object. Fullscreen hides menu/status bars, dock, and tab bar and restores them (including pre-fullscreen dock visibility) on exit; `closeEvent` exits fullscreen before persisting layout. Window geometry AND dock layout persist (`window_state.save_state`/`restore_state`, key `main_window_state`; the dock needs its objectName).
|
|
78
83
|
- **Privacy toggles**: Preferences' "Sync clipboard" checkbox (`clipboard_sync_enabled`, default on) drives `ClipboardSync.enabled` — while off, local copies aren't sent and peer payloads aren't applied. View-only sharing is the "view" mode of the Screen sharing radios (`ShareServer.set_input_allowed` — a server-side drop, no wire change, that releases held input when switched off). Quitting with ≥1 viewer connected asks for confirmation (declining resets `_quitting`); restart shuts sharing down first so it never double-prompts.
|
|
79
84
|
- **Screen capture** (`app.py`): the dock's "Screen capture" group (Copy / Save…, viewer-role UI hidden with the panel) and the matching File-menu actions (`copy_capture_action`/`save_capture_action`, same handlers) capture the current session tab's last frame at full server resolution (`ViewerWidget.frame_image()` — the lock overlay is display-only and never part of it). Copy goes through `ClipboardSync.copy_image`, which records the content signature *before* setting the clipboard so the capture is never echoed to peers, and works with sync disabled (the preference governs syncing, not local copies). Save is `QFileDialog.getSaveFileName` (tests monkeypatch it) defaulting to `Pictures\<server> <timestamp>.png`, PNG only. All four widgets enable only while the current tab shows a frame — `_update_capture_actions()`, called from tab change, `_on_frame` (unconditionally: auto-reconnect refills a cleared viewer without `_connect_session`), and every `viewer.clear` path (connect/denied/approval-pending/disconnect).
|
|
80
85
|
- **Reduce visual effects while sharing** (`visual_effects.py`): animations/fades are a burst of changed frames for the lossless pipeline, so while the preference is on (default on, `reduce_effects_enabled`, `load_reduce_effects_enabled`) **and ≥1 viewer is connected**, `MainWindow` applies `VisualEffectsReducer` and restores it when the last viewer leaves (driven by `SharingTab.viewerCountChanged`; explicit safety-net restore in `closeEvent`). The reduced set: SPI_SETUIEFFECTS off, drop shadows off, client-area + min/max animations off, submenu delay lowered to 50 ms (never raised). All via `SystemParametersInfo` **without** SPIF_UPDATEINIFILE — session-scoped, never persisted, self-heals at logoff; knobs already at the reduced value are left untouched so the user's own choices are never "restored" over. The backend (`SpiBackend`) is injectable — **tests must always inject `FakeSpiBackend`** (the preference defaults on, so a real reducer in a test would change the host's actual Windows settings; `make_window` in `tests/test_main_window.py` injects it for every window test, and real-backend tests may only read).
|
|
81
86
|
- **Theme preference** (`preferences.py`): a three-radio group in Preferences — follow the Windows light/dark setting (default) / Light / Dark — persisted as `THEME_KEY` (`"system"`/`"light"`/`"dark"`, `load_theme` falls back to system on junk). `apply_theme` drives `QStyleHints.setColorScheme` (`unsetColorScheme` for system, so OS-side switches keep applying); the radios apply live and `MainWindow.__init__` re-applies the persisted choice before building widgets. Tests that set a non-system theme must restore with `apply_theme(THEME_SYSTEM)` — the color scheme is process-global QApplication state.
|
|
82
87
|
- **Two `PerformanceMonitor`s, never one**: `MainWindow.client_performance` (viewing sessions) and `server_performance` (the SharingTab's viewers). `ShareServer.close()` resets its monitor, so sharing a monitor across roles would wipe the other role's graphs. The Performance tab has "Client (viewer)"/"Server (sharing)" sub-tabs (`MainWindow.performance_pages`) — but only for roles that can produce data: the client sub-tab exists only with the viewer role, the server one only while actually serving (`_update_performance_tabs`, driven from the viewer toggle and `sharingChanged`; both off shows an enable-a-role hint). `PreferencesTab` takes the list of monitors and applies the history-window setting to all.
|
|
83
|
-
- **Autodiscovery** (`src/remotedesktop/discovery.py`) is a stdlib-only UDP probe/response protocol, deliberately not mDNS: the client broadcasts a JSON probe to `DISCOVERY_PORT` (48653) and servers reply with `{name, port}
|
|
88
|
+
- **Autodiscovery** (`src/remotedesktop/discovery.py`) is a stdlib-only UDP probe/response protocol, deliberately not mDNS: the client broadcasts a JSON probe to `DISCOVERY_PORT` (48653) and servers reply with `{name, port}` plus an optional `fp` — the server's TLS cert fingerprint (`ServerInfo.fingerprint`, empty when absent; junk `fp` is blanked, never drops the reply), the stable identity auto-reconnect re-discovery matches on; datagrams with the wrong magic/version/type are dropped. **Scan robustness**: probes are re-sent every `_PROBE_INTERVAL` (0.3 s) for the whole scan window (a lost broadcast only delays discovery), ICMP port-unreachable resets never abort the scan (Windows `SIO_UDP_CONNRESET` ioctl + `ConnectionResetError` → continue), and the panel passes `client._broadcast_hosts()` — 255.255.255.255 plus every up non-loopback interface's directed broadcast, because Windows routes the limited broadcast out only one interface (VPN/virtual adapters made scans come up empty). A sharing instance runs a `DiscoveryResponder` thread while sharing is enabled; the `DiscoveryPanel` (dock in `MainWindow`) calls the blocking `discover_servers()` on a worker thread and delivers results to the GUI via a queued signal. With `auto_scan=True` (the app; tests default to False and never broadcast) it scans **once at startup only** — further scans happen only on manual Refresh/F5 (deliberately no periodic background scanning; the user asked for this), guarded against overlapping scans and preserving the selection across repopulation; it also has a Connect button, a right-click Connect menu, and an empty-state hint. The "(this computer)" entry is not connectable (Connect disabled, activation swallowed, plus a `MainWindow._on_server_activated` guard). `DEFAULT_CONNECT_PORT` is 48654. An instance that shares and scans discovers itself — `DiscoveryPanel`'s `is_self=` callable labels that entry "(this computer)" (never hidden).
|
|
84
89
|
- Discovery tests run over loopback with ephemeral ports (`bind_host`/`discovery_port`/`broadcast_hosts` parameters exist for this), so they never touch the real LAN or fixed ports.
|
|
85
|
-
- **Screen sharing** (`sharing.py` + `protocol.py` + `frames.py`) runs entirely on the Qt event loop — no threads or locks. `MessageStream` frames messages over a QTcpSocket (4-byte length + kind byte; JSON control messages, full frames, or inter-frame deltas; malformed input aborts the socket). `ShareServer` owns one QTimer that grabs the primary screen at full resolution via `_capture()` (a seam tests override to drive deterministic frame content) and fans out to all clients, skipping clients whose send buffer is backlogged; the timer only runs while clients are connected. Capture is DXGI desktop duplication (`dxgi.py`, hand-rolled ctypes COM — ~10 ms per changed 4K frame, ~0 when idle, and "unchanged" is signalled by returning the same QImage object so the diff is skipped) with automatic fallback to `QScreen.grabWindow` (~96 ms) whenever duplication is unavailable or lost (secure desktop, RDP, display-mode change, CI); unit tests fake the duplication (`FakeDuplication` in `tests/test_dxgi.py`) and the real-hardware test skips where DXGI is unavailable. **Frame transfer is lossless and inter-frame compressed** (`frames.py`): consecutive captures are diffed in 64-row bands (memoryview compares), and only changed bands ship as PNG in a delta payload the client patches onto its previous frame; an unchanged screen sends nothing. Full PNG keyframes go to clients that just joined, just recovered from a send backlog, or requested one (a `{"type": "keyframe"}` message — sent when a delta fails to apply, so desync self-heals).
|
|
90
|
+
- **Screen sharing** (`sharing.py` + `protocol.py` + `frames.py`) runs entirely on the Qt event loop — no threads or locks. `MessageStream` frames messages over a QTcpSocket (4-byte length + kind byte; JSON control messages, full frames, or inter-frame deltas; malformed input aborts the socket). `ShareServer` owns one QTimer that grabs the primary screen at full resolution via `_capture()` (a seam tests override to drive deterministic frame content) and fans out to all clients, skipping clients whose send buffer is backlogged; the timer only runs while clients are connected. Capture is DXGI desktop duplication (`dxgi.py`, hand-rolled ctypes COM — ~10 ms per changed 4K frame, ~0 when idle, and "unchanged" is signalled by returning the same QImage object so the diff is skipped) with automatic fallback to `QScreen.grabWindow` (~96 ms) whenever duplication is unavailable or lost (secure desktop, RDP, display-mode change, CI); unit tests fake the duplication (`FakeDuplication` in `tests/test_dxgi.py`) and the real-hardware test skips where DXGI is unavailable. **Frame transfer is lossless and inter-frame compressed** (`frames.py`): consecutive captures are diffed in 64-row bands (memoryview compares), and only changed bands ship as PNG in a delta payload the client patches onto its previous frame; an unchanged screen sends nothing. Full PNG keyframes go to clients that just joined, just recovered from a send backlog, or requested one (a `{"type": "keyframe"}` message — sent when a delta fails to apply, so desync self-heals). Every client is assumed delta-capable (no negotiation). Each variant (keyframe PNG / delta) is encoded at most once per tick and shared across clients. `ShareClient` decodes/patches to QImage for the viewer, which displays it scaled with a cached `SmoothTransformation` copy (full resolution is always delivered; scaling happens client-side only).
|
|
86
91
|
- **All persistence is one SQLite database** (`db.py`): `db.connect(path)` opens the DB and ensures every table (`settings`, `paired_clients`, `known_servers`, and the inventory tables). The file lives at `config.default_db_path()` — `platformdirs.user_data_dir("remotedesktop")` (`%LOCALAPPDATA%\remotedesktop\remotedesktop.db` on Windows). **Use `platformdirs` for any new data location; don't hardcode `%APPDATA%`.** Every store (`Settings`, `PairedClients`, `KnownServers`, `ConnectionInventory`) takes a `sqlite3.Connection`; the app opens one connection and shares it. **Boolean settings go through `Settings.get_bool`/`set_bool`** (the `tobool` package's `to_bool_strict`; on-disk form stays the historical `"1"`/`"0"`, junk falls back to the caller's default) — don't hand-roll `!= "0"` comparisons. This applies to binary values stored as strings/ints; ctypes Win32 `BOOL`s keep plain `bool()` (TRUE is "any nonzero", which strict parsing correctly refuses). `MainWindow` takes a `connection=` keyword so tests inject a temp-file DB and never touch the real one (see `tests/test_main_window.py` / `test_sharing_tab.py`). Tests pass `db.connect(tmp_path/"x.db")` (or omit for in-memory), and use **separate DB files per simulated machine**.
|
|
87
92
|
- **Trust model plumbing** (`config.py`): the client has a stable UUID identity (`load_client_identity`, in the `settings` table) and the server maps each approved client-id to a token (`PairedClients`). `ShareServer` takes an `approve_client(client_id, name) -> bool` callback; `SharingTab` implements it as a modal stay-on-top QMessageBox. Tests inject stores backed by a temp DB and explicit identities so they never touch real data or prompt.
|
|
88
|
-
- **Status/debug logging is a feature**: `ShareServer`, `ShareClient`, `SharingTab`, and `DiscoveryPanel` emit human-readable `status`/`statusMessage` signals for every connection phase, shown in the window's timestamped "Connection log" pane. When adding connection behavior, emit a status message for each new phase or failure path — there's a test asserting the server's phase messages. Everything the pane shows is also written to a rotating debug log file (`logs.py`; `logs.init_logging("remotedesktop")` is called only by `app.main()`, under `platformdirs.user_log_dir("remotedesktop")` — `%LOCALAPPDATA%\remotedesktop\Logs\remotedesktop.log` on Windows; pre-1.0 `client.log`/`server.log` files just age out). Lower-level detail (socket state changes, protocol aborts, frame-drop/backlog, discovery datagram drops) goes straight to `logging.getLogger("remotedesktop.*")` at debug/warning level — silent failure paths should log there even when a status message would be too noisy. Library code and tests never call `init_logging`; without a handler those loggers are no-ops.
|
|
93
|
+
- **Status/debug logging is a feature**: `ShareServer`, `ShareClient`, `SharingTab`, and `DiscoveryPanel` emit human-readable `status`/`statusMessage` signals for every connection phase, shown in the window's timestamped "Connection log" pane. **Byte counts in any user-facing string go through `humanize.naturalsize(n, binary=True)`** ("2.0 KiB", "1.3 MiB") — never hand-rolled `// 1024` math (the `humanize` package is a dependency; `performance.format_rate` wraps it for rates). When adding connection behavior, emit a status message for each new phase or failure path — there's a test asserting the server's phase messages. Everything the pane shows is also written to a rotating debug log file (`logs.py`; `logs.init_logging("remotedesktop")` is called only by `app.main()`, under `platformdirs.user_log_dir("remotedesktop")` — `%LOCALAPPDATA%\remotedesktop\Logs\remotedesktop.log` on Windows; pre-1.0 `client.log`/`server.log` files just age out). Lower-level detail (socket state changes, protocol aborts, frame-drop/backlog, discovery datagram drops) goes straight to `logging.getLogger("remotedesktop.*")` at debug/warning level — silent failure paths should log there even when a status message would be too noisy. Library code and tests never call `init_logging`; without a handler those loggers are no-ops.
|
|
89
94
|
- **Connection inventory** (`inventory.py`): the Connections tab has two grouped tables ("Client history" for the sharing role, "Server history" for the viewing role), each backed by its own `ConnectionInventory` — one `PeerRecord` per peer with attempts count, current state, first/last seen. The sharing side is driven by `ShareServer.peerEvent` (a structured `{key, event, name, address, detail}` signal emitted alongside the status strings at each phase — keep both in sync when adding phases), forwarded through `SharingTab.peerEvent`. The viewing side is driven by `MainWindow`'s own handlers (discovered servers from `DiscoveryPanel.serversFound`, plus attempt/connected/denied/disconnected). Server peers key by client-id; client peers key by `host:port`. **Persisted in SQLite** and reloaded on startup, so it survives restarts.
|
|
90
95
|
- **Revoking access**: `InventoryTab` takes an optional `(action_label, action_callback)`; each row gets its own button labeled `action_label` (in the trailing stretch column) whose callback receives that row's peer key. "Client history" wires "Revoke" → `SharingTab.revoke_client(client_id)` (via `ShareServer.revoke_client` while sharing — removes the token via `PairedClients.revoke`, disconnects any live stream with a `denied: access revoked`, and `_drop` emits a "revoked" peer event; a `_revoked` set distinguishes it from a plain disconnect — or directly via `PairedClients.revoke` while not sharing). "Server history" wires "Forget" → `KnownServers.forget(key)` + disconnect + `ConnectionInventory.remove(key)`. **Both delete the peer's row from the table and the DB outright** (`MainWindow._record_server_peer` turns a "revoked" event into a `remove`); a rescan or new connection attempt records the peer afresh. After either, the next connection needs a fresh approval. The roles use *separate tables* (`server_peers` / `client_peers`, selected via the `table=` arg) so they don't commingle; `peers` is the default table used by tests. `ConnectionInventory` never lets a DB error break connectivity (load/save are wrapped).
|
|
91
96
|
- Sharing tests drive real sockets on the GUI thread by pumping `qapp.processEvents()` until a condition holds (see `pump()` in `tests/test_sharing.py`). Use the `make_server`/`make_client` helpers there and the session-scoped `credentials` fixture (one generated cert reused across tests — generating per test is ~100ms each). Tests exercise the real pairing flow (auto-approve), so there is no "pre-approve" shortcut anymore.
|
|
@@ -97,7 +102,7 @@ Managed with `uv` (hatchling build backend, src layout):
|
|
|
97
102
|
- **Injection is isolated behind `InputInjector`** (`input_injection.py`, Windows `SendInput` via ctypes; inert stub off-Windows). ShareServer takes an `injector=` param so tests pass a recording fake — **never let tests construct a real `InputInjector`, or they will move the host's actual mouse/keyboard.** Normalized 0..1 coords map directly to SendInput's 0..65535 absolute range over the primary monitor.
|
|
98
103
|
- **Transport is TLS + a token handshake** (`tls.py`, `sharing.py`, `config.py`). The Qt SSL backend here is Windows **schannel** (no OpenSSL); it does complete server-side TLS with a `cryptography`-generated self-signed cert loaded from PEM (verified), but be wary of schannel-specific quirks if you change the config. The server persists a self-signed cert/key under the config dir (`tls.load_or_create_credentials`; `ShareServer(credentials=...)`, or ephemeral if omitted). The client connects with `connectToHostEncrypted`, ignores the expected self-signed cert errors (`PeerVerifyMode.VerifyNone`), and pins the cert fingerprint **softly** — a change is logged but does *not* block the connection (robustness over strict security, per the trusted-LAN intent). Authentication: on first connect the server user approves and the server issues a random token (`PairedClients.pair`, stored server-side by client-id; client stores it in `KnownServers` keyed by `host:port` with the fingerprint). On reconnect the client sends the token in its hello and is admitted with no prompt; a missing/invalid token just falls back to re-approval (never hard-fails). **Do not reintroduce hard cert-pinning or challenge-response** — the user explicitly wanted robust connections over maximum security.
|
|
99
104
|
- **Performance monitoring** (`performance.py` + `preferences.py`): `PerformanceMonitor` is an opt-in collaborator (`performance=` on `ShareServer`/`ShareClient`, the `clipboard=` pattern — plain sharing tests leave it off). While admitted streams are attached, a 1 s QTimer samples `MessageStream.bytes_sent/bytes_received` counters into rolling `MetricSeries` (bandwidth, aggregated across streams via per-stream baselines) and pings **every** attached stream (each ping id maps to its stream; a pong is honored only on the stream it was sent to). The graphs' RTT series follow only the *active* (most recently admitted) stream; per-stream send/recv/RTT snapshots come from `metrics_for(stream)` and feed the Server tab's `ViewersTable` (`server.py`; it takes the monitor and follows the current ShareServer via `set_share_server`, empty when None), which joins them with `ShareServer.viewers()` — identity fields the client hello reports (`_client_details()`; `user`/`os` are displayed — `host` is still on the wire but not shown, since the display name defaults to the hostname; missing on old clients, shown as dashes). The ping is: `{"type": "ping", "id", "rtt"}` / `{"type": "pong", "id"}` — each side measures its own RTT and piggybacks it on its next ping so both ends graph both directions; peers without the feature ignore pings harmlessly (RTT graphs show "no data"). Ping/pong is admitted-streams-only on the server, like input/clipboard. The "Performance" tab (`PerformanceTab`, custom QPainter graphs, one per role sub-tab) schedules **no paint work while hidden** (gated on `isVisible()`, repaint on `showEvent`); the "Preferences" tab's history-window setting persists via the `Settings` store (`performance_window_seconds`, default 120). The monitor's timer runs only while streams are attached; all timing is `time.monotonic()` with an injectable `clock=` for tests — never monkeypatch `time.monotonic` (the test `pump()` helper depends on it).
|
|
100
|
-
- **Clipboard sync is bidirectional** (`clipboard.py` `ClipboardSync`): client copy → server and server copy → all clients, as `{"type": "clipboard", "text"/"image_png"}` messages. It's opt-in — `ShareServer`/`ShareClient` take a `clipboard=` param and do nothing with clipboard if it's None, so only the GUI (and clipboard tests) enables it; **plain sharing/input tests must leave it off to avoid touching the real OS clipboard.** The app shares ONE `ClipboardSync` across both roles (one OS clipboard): a real local copy fans out to connected servers and own viewers; a peer-received payload records its signature before applying, so it never re-emits `changed` and cannot loop between the roles. Echo/loop prevention is by *content signature*, not just a guard flag, because Windows fires `QClipboard.dataChanged` asynchronously (after a flag would be cleared); image signatures hash canonical RGBA pixels so a re-encoded PNG round trip doesn't loop. Server only accepts clipboard from streams past the approval handshake. Tests use a `FakeClipboard(QObject)` with a `changed` signal and recording `apply()` so two independent clipboards exist in one process.
|
|
105
|
+
- **Clipboard sync is bidirectional** (`clipboard.py` `ClipboardSync`): client copy → server and server copy → all clients, as `{"type": "clipboard", "text"/"image_png"/"files"}` messages. **Files sync by content**: a local file copy (Qt local-file URLs) ships `files: [{name, data-b64}, ...]` capped at `FILES_CAP_BYTES` (32 MB — the batch is one JSON message under the 64 MB protocol cap, sharing the stream's socket) with folders skipped; `apply` sanitizes names to their final component, writes a fresh batch dir under `default_files_dir()` (`%LOCALAPPDATA%\remotedesktop\clipboard`, injectable `files_dir=` for tests), purges older batches best-effort, and puts the written paths on the clipboard as URLs (CF_HDROP → Explorer paste works). When files are present they travel alone — text/image on the same clipboard entry is ignored on both ends. `ClipboardSync.status` feeds the Connection log with **problems only** (skipped folders, over-cap, disk errors); routine traffic is described by the transport's own status lines via `clipboard.describe_payload` (kinds + sizes, never content — e.g. "Sending clipboard to 1 viewer(s): 2 file(s) (1.3 MiB)"), so one copy produces one log line per direction. It's opt-in — `ShareServer`/`ShareClient` take a `clipboard=` param and do nothing with clipboard if it's None, so only the GUI (and clipboard tests) enables it; **plain sharing/input tests must leave it off to avoid touching the real OS clipboard.** The app shares ONE `ClipboardSync` across both roles (one OS clipboard): a real local copy fans out to connected servers and own viewers; a peer-received payload records its signature before applying, so it never re-emits `changed` and cannot loop between the roles. Echo/loop prevention is by *content signature*, not just a guard flag, because Windows fires `QClipboard.dataChanged` asynchronously (after a flag would be cleared); image signatures hash canonical RGBA pixels so a re-encoded PNG round trip doesn't loop, and file signatures hash names + contents (never paths) so the receiving side's temp copies don't loop either. Server only accepts clipboard from streams past the approval handshake. Tests use a `FakeClipboard(QObject)` with a `changed` signal and recording `apply()` so two independent clipboards exist in one process.
|
|
101
106
|
- The package version lives only in `src/remotedesktop/__init__.py` (`__version__`); hatchling reads it from there (`[tool.hatch.version]`), so bump it in that one place. **Versioning is strict semver** (`compat.py`, using the `semver` package): major = client/server compatibility contract, minor = backward-compatible features, patch = bug fixes — bump the major when the wire protocol or behavior breaks older peers. Both sides compare majors on every connection (hello/welcome carry `app_version`) and show a strong warning on mismatch (server status log + ⚠ in the viewers table's Version column; client log + non-modal dialog + status-bar marker) but never block the connection. Peers too old to report a version produce no warning.
|
|
102
107
|
- Widget tests need a `QApplication`; use the session-scoped `qapp` fixture in `tests/conftest.py`.
|
|
103
108
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: remotedesktop
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Remote desktop app for Windows computers on the same LAN, with autodiscovery. View other computers and optionally share this one — screen, keyboard, mouse, and clipboard, without RDP or Microsoft authentication.
|
|
5
5
|
Project-URL: Homepage, https://github.com/jamesabel/remotedesktop
|
|
6
6
|
Project-URL: Repository, https://github.com/jamesabel/remotedesktop
|
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
16
16
|
Classifier: Topic :: System :: Networking
|
|
17
17
|
Requires-Python: >=3.14
|
|
18
18
|
Requires-Dist: cryptography>=49.0.0
|
|
19
|
+
Requires-Dist: humanize>=4.0
|
|
19
20
|
Requires-Dist: platformdirs>=4.10.0
|
|
20
21
|
Requires-Dist: pyside6>=6.11.1
|
|
21
22
|
Requires-Dist: semver>=3.0
|
|
@@ -78,15 +79,15 @@ one-click *Forget* / *Revoke*, and the live connection log.
|
|
|
78
79
|
- ⌨️🖱️ **Full input control** — mouse, wheel, and keyboard forwarding that is safe against interruptions: anything still held down is released on the server if the viewer loses focus or disconnects, so no stuck keys. Prefer eyes-only? Choose *Shared, view only* and sharing becomes view-only, switchable live.
|
|
79
80
|
- 🖲️ **Cursor shape mirroring** — the pointer is never burned into the captured frame; instead your own cursor takes the remote cursor's shape (an I-beam over text, resize arrows on a window edge), so it is always crisp and lag-free.
|
|
80
81
|
- 🖼️ **View your way** — each connection scales to fit or shows the remote screen at 1:1 pixels with panning, and F11 goes full screen. While you type into a remote session every key is forwarded — F11 is the one key that stays local.
|
|
81
|
-
- 📋 **Two-way clipboard** — text and
|
|
82
|
+
- 📋 **Two-way clipboard** — text, images, and files copied on either machine appear on the other (files up to 32 MB per copy, pasted as real local copies; folders aren't synced); a Preferences toggle turns syncing off entirely.
|
|
82
83
|
- 📸 **Screen captures** — grab the remote screen at its full resolution and copy it to the clipboard or save it as a PNG, from the *Screen capture* panel buttons or the File menu.
|
|
83
84
|
- 🔒 **TLS + approve-once pairing** — every connection is encrypted; the server user approves a new client once, after which it reconnects with a stored token and no prompt.
|
|
84
85
|
- 🔐 **Honest lock-screen behavior** — a locked server tells viewers so with a clear on-screen notice instead of a frozen frame, and streaming resumes by itself once someone signs in at the machine (see [The Windows lock screen](#the-windows-lock-screen)).
|
|
85
86
|
- 📊 **Built-in performance monitoring** — live bandwidth and round-trip-time graphs with window statistics (mean/min/max/p99/jitter), plus a per-viewer table on the server.
|
|
86
|
-
- 🔁 **Robust connections** — dead connections are detected within seconds, and dropped sessions reconnect automatically with backoff; a server restart heals by itself, no clicks needed. Connections that were open when the app closed are restored on the next start.
|
|
87
|
-
- 🚀 **Hands-off operation** —
|
|
87
|
+
- 🔁 **Robust connections** — dead connections are detected within seconds, and dropped sessions reconnect automatically with backoff; a server restart heals by itself, no clicks needed. Even a server that comes back on a **different IP address** (a new DHCP lease after a reboot) is found again: reconnection re-scans the LAN, recognizes the server by its certificate identity, and follows it to the new address — pairing intact, so still no prompt. Connections that were open when the app closed are restored on the next start.
|
|
88
|
+
- 🚀 **Hands-off operation** — start-at-login (per-user, no admin rights) with a choice of minimized (the default and recommended — sharing resumes after a reboot with no clicks), normal, maximized, or not starting at all; close-to-tray while sharing (the screen stays available with the window closed); and a *Restart app* button usable from the remote session itself, so you can update the software without visiting the machine.
|
|
88
89
|
- 🗃️ **Persistent peer inventory** — a SQLite-backed history of every peer seen on the LAN, with one-click *Revoke* / *Forget*.
|
|
89
|
-
- 🧭 **Desktop-app niceties** — a real menu bar with standard shortcuts, a status-bar sharing indicator, a confirmation before quitting with viewers connected, and window/panel layout that persists across restarts.
|
|
90
|
+
- 🧭 **Desktop-app niceties** — a real menu bar with standard shortcuts (Preferences on *File ▸ Preferences*, Ctrl+,; About on the Help menu), a status-bar sharing indicator, a confirmation before quitting with viewers connected, and window/panel layout that persists across restarts.
|
|
90
91
|
|
|
91
92
|
In scope: screen, keyboard, mouse, and clipboard. Out of scope: shared
|
|
92
93
|
drives, devices, and audio — and smooth playback of fast-changing
|
|
@@ -118,8 +119,8 @@ it prepares the environment on first use and launches the app.
|
|
|
118
119
|
## Quick start
|
|
119
120
|
|
|
120
121
|
1. Run `remotedesktop` on both computers.
|
|
121
|
-
2. On the computer to share, open *Preferences* and set
|
|
122
|
-
to one of the *Shared* modes.
|
|
122
|
+
2. On the computer to share, open *File ▸ Preferences* (Ctrl+,) and set
|
|
123
|
+
*Server (sharing)* to one of the *Shared* modes.
|
|
123
124
|
3. On the viewing computer, the shared computer appears in the panel on
|
|
124
125
|
the left — double-click it (or select it and click *Connect*).
|
|
125
126
|
4. Approve the connection in the dialog that pops up on the shared
|
|
@@ -209,10 +210,17 @@ still held down (a dragged button, a modifier key) is released
|
|
|
209
210
|
automatically if the viewer disconnects or loses focus.
|
|
210
211
|
|
|
211
212
|
**Clipboard.** Both sides watch their local clipboard via Qt and forward
|
|
212
|
-
copies (text,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
copies (text, images as PNG, or files) over the same connection. A file
|
|
214
|
+
copy ships the file *contents* — a path would be meaningless on another
|
|
215
|
+
machine — capped at 32 MB per copy so a transfer never chokes the screen
|
|
216
|
+
stream; the receiving side materializes the files in a scratch folder and
|
|
217
|
+
puts them on its clipboard, so pasting in Explorer produces real local
|
|
218
|
+
copies (only the newest received batch is kept on disk; folders are
|
|
219
|
+
skipped). Echo loops are prevented by content signature — an image is
|
|
220
|
+
hashed by its canonical pixels and files by their names and contents (not
|
|
221
|
+
their paths), so content that makes a round trip through the OS clipboard
|
|
222
|
+
and comes back re-encoded or re-homed is still recognized and not sent
|
|
223
|
+
again.
|
|
216
224
|
|
|
217
225
|
**Transport.** Each client talks to the server over a single TCP
|
|
218
226
|
connection: TLS via the Windows schannel backend with a self-signed
|
|
@@ -220,7 +228,8 @@ certificate the server generates and keeps, then simple length-prefixed
|
|
|
220
228
|
messages on top — JSON for control (hello/welcome, input, clipboard,
|
|
221
229
|
ping/pong for the round-trip-time graphs, log exchange) and binary
|
|
222
230
|
payloads for frames and deltas. Discovery is a UDP broadcast probe that
|
|
223
|
-
every server answers with its name and
|
|
231
|
+
every server answers with its name, port, and certificate fingerprint
|
|
232
|
+
(see below).
|
|
224
233
|
|
|
225
234
|
## Versioning
|
|
226
235
|
|
|
@@ -240,7 +249,12 @@ not guaranteed. Keep both computers on the same version for best results.
|
|
|
240
249
|
## How discovery works
|
|
241
250
|
|
|
242
251
|
The client broadcasts a small JSON probe over UDP (port 48653); each server
|
|
243
|
-
on the LAN replies with its hostname
|
|
252
|
+
on the LAN replies with its hostname, connection port, and TLS certificate
|
|
253
|
+
fingerprint. The fingerprint is the server's stable identity: when a
|
|
254
|
+
reconnecting client can no longer reach a server at its last known address
|
|
255
|
+
(typically a new DHCP lease after a reboot), it re-scans and matches the
|
|
256
|
+
fingerprint to follow the server to its new address, keeping the stored
|
|
257
|
+
pairing token so no fresh approval is needed. Windows Firewall
|
|
244
258
|
must allow Python to receive inbound UDP on that port for a server to be
|
|
245
259
|
discoverable from other machines.
|
|
246
260
|
|
|
@@ -16,6 +16,7 @@ classifiers = [
|
|
|
16
16
|
]
|
|
17
17
|
dependencies = [
|
|
18
18
|
"cryptography>=49.0.0",
|
|
19
|
+
"humanize>=4.0",
|
|
19
20
|
"platformdirs>=4.10.0",
|
|
20
21
|
"pyside6>=6.11.1",
|
|
21
22
|
"semver>=3.0",
|
|
@@ -60,6 +61,12 @@ upload = false
|
|
|
60
61
|
# run_on_startup deliberately NOT set: it would write an HKLM Run value named
|
|
61
62
|
# "remotedesktop", colliding with the app's own HKCU autostart preference.
|
|
62
63
|
|
|
64
|
+
[tool.ruff.lint]
|
|
65
|
+
# CI runs the latest ruff (uvx). Ruff 0.16 expanded its default rule set
|
|
66
|
+
# (I, UP, RUF, S, BLE, ...), which the codebase was never linted against —
|
|
67
|
+
# pin the selection to the historical defaults so unrelated PRs stay green.
|
|
68
|
+
select = ["E4", "E7", "E9", "F"]
|
|
69
|
+
|
|
63
70
|
[tool.ty.environment]
|
|
64
71
|
# The app targets Windows (SendInput via ctypes.windll); type-check as such
|
|
65
72
|
# even when ty runs on a Linux CI runner.
|
|
@@ -54,15 +54,15 @@ one-click *Forget* / *Revoke*, and the live connection log.
|
|
|
54
54
|
- ⌨️🖱️ **Full input control** — mouse, wheel, and keyboard forwarding that is safe against interruptions: anything still held down is released on the server if the viewer loses focus or disconnects, so no stuck keys. Prefer eyes-only? Choose *Shared, view only* and sharing becomes view-only, switchable live.
|
|
55
55
|
- 🖲️ **Cursor shape mirroring** — the pointer is never burned into the captured frame; instead your own cursor takes the remote cursor's shape (an I-beam over text, resize arrows on a window edge), so it is always crisp and lag-free.
|
|
56
56
|
- 🖼️ **View your way** — each connection scales to fit or shows the remote screen at 1:1 pixels with panning, and F11 goes full screen. While you type into a remote session every key is forwarded — F11 is the one key that stays local.
|
|
57
|
-
- 📋 **Two-way clipboard** — text and
|
|
57
|
+
- 📋 **Two-way clipboard** — text, images, and files copied on either machine appear on the other (files up to 32 MB per copy, pasted as real local copies; folders aren't synced); a Preferences toggle turns syncing off entirely.
|
|
58
58
|
- 📸 **Screen captures** — grab the remote screen at its full resolution and copy it to the clipboard or save it as a PNG, from the *Screen capture* panel buttons or the File menu.
|
|
59
59
|
- 🔒 **TLS + approve-once pairing** — every connection is encrypted; the server user approves a new client once, after which it reconnects with a stored token and no prompt.
|
|
60
60
|
- 🔐 **Honest lock-screen behavior** — a locked server tells viewers so with a clear on-screen notice instead of a frozen frame, and streaming resumes by itself once someone signs in at the machine (see [The Windows lock screen](#the-windows-lock-screen)).
|
|
61
61
|
- 📊 **Built-in performance monitoring** — live bandwidth and round-trip-time graphs with window statistics (mean/min/max/p99/jitter), plus a per-viewer table on the server.
|
|
62
|
-
- 🔁 **Robust connections** — dead connections are detected within seconds, and dropped sessions reconnect automatically with backoff; a server restart heals by itself, no clicks needed. Connections that were open when the app closed are restored on the next start.
|
|
63
|
-
- 🚀 **Hands-off operation** —
|
|
62
|
+
- 🔁 **Robust connections** — dead connections are detected within seconds, and dropped sessions reconnect automatically with backoff; a server restart heals by itself, no clicks needed. Even a server that comes back on a **different IP address** (a new DHCP lease after a reboot) is found again: reconnection re-scans the LAN, recognizes the server by its certificate identity, and follows it to the new address — pairing intact, so still no prompt. Connections that were open when the app closed are restored on the next start.
|
|
63
|
+
- 🚀 **Hands-off operation** — start-at-login (per-user, no admin rights) with a choice of minimized (the default and recommended — sharing resumes after a reboot with no clicks), normal, maximized, or not starting at all; close-to-tray while sharing (the screen stays available with the window closed); and a *Restart app* button usable from the remote session itself, so you can update the software without visiting the machine.
|
|
64
64
|
- 🗃️ **Persistent peer inventory** — a SQLite-backed history of every peer seen on the LAN, with one-click *Revoke* / *Forget*.
|
|
65
|
-
- 🧭 **Desktop-app niceties** — a real menu bar with standard shortcuts, a status-bar sharing indicator, a confirmation before quitting with viewers connected, and window/panel layout that persists across restarts.
|
|
65
|
+
- 🧭 **Desktop-app niceties** — a real menu bar with standard shortcuts (Preferences on *File ▸ Preferences*, Ctrl+,; About on the Help menu), a status-bar sharing indicator, a confirmation before quitting with viewers connected, and window/panel layout that persists across restarts.
|
|
66
66
|
|
|
67
67
|
In scope: screen, keyboard, mouse, and clipboard. Out of scope: shared
|
|
68
68
|
drives, devices, and audio — and smooth playback of fast-changing
|
|
@@ -94,8 +94,8 @@ it prepares the environment on first use and launches the app.
|
|
|
94
94
|
## Quick start
|
|
95
95
|
|
|
96
96
|
1. Run `remotedesktop` on both computers.
|
|
97
|
-
2. On the computer to share, open *Preferences* and set
|
|
98
|
-
to one of the *Shared* modes.
|
|
97
|
+
2. On the computer to share, open *File ▸ Preferences* (Ctrl+,) and set
|
|
98
|
+
*Server (sharing)* to one of the *Shared* modes.
|
|
99
99
|
3. On the viewing computer, the shared computer appears in the panel on
|
|
100
100
|
the left — double-click it (or select it and click *Connect*).
|
|
101
101
|
4. Approve the connection in the dialog that pops up on the shared
|
|
@@ -185,10 +185,17 @@ still held down (a dragged button, a modifier key) is released
|
|
|
185
185
|
automatically if the viewer disconnects or loses focus.
|
|
186
186
|
|
|
187
187
|
**Clipboard.** Both sides watch their local clipboard via Qt and forward
|
|
188
|
-
copies (text,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
copies (text, images as PNG, or files) over the same connection. A file
|
|
189
|
+
copy ships the file *contents* — a path would be meaningless on another
|
|
190
|
+
machine — capped at 32 MB per copy so a transfer never chokes the screen
|
|
191
|
+
stream; the receiving side materializes the files in a scratch folder and
|
|
192
|
+
puts them on its clipboard, so pasting in Explorer produces real local
|
|
193
|
+
copies (only the newest received batch is kept on disk; folders are
|
|
194
|
+
skipped). Echo loops are prevented by content signature — an image is
|
|
195
|
+
hashed by its canonical pixels and files by their names and contents (not
|
|
196
|
+
their paths), so content that makes a round trip through the OS clipboard
|
|
197
|
+
and comes back re-encoded or re-homed is still recognized and not sent
|
|
198
|
+
again.
|
|
192
199
|
|
|
193
200
|
**Transport.** Each client talks to the server over a single TCP
|
|
194
201
|
connection: TLS via the Windows schannel backend with a self-signed
|
|
@@ -196,7 +203,8 @@ certificate the server generates and keeps, then simple length-prefixed
|
|
|
196
203
|
messages on top — JSON for control (hello/welcome, input, clipboard,
|
|
197
204
|
ping/pong for the round-trip-time graphs, log exchange) and binary
|
|
198
205
|
payloads for frames and deltas. Discovery is a UDP broadcast probe that
|
|
199
|
-
every server answers with its name and
|
|
206
|
+
every server answers with its name, port, and certificate fingerprint
|
|
207
|
+
(see below).
|
|
200
208
|
|
|
201
209
|
## Versioning
|
|
202
210
|
|
|
@@ -216,7 +224,12 @@ not guaranteed. Keep both computers on the same version for best results.
|
|
|
216
224
|
## How discovery works
|
|
217
225
|
|
|
218
226
|
The client broadcasts a small JSON probe over UDP (port 48653); each server
|
|
219
|
-
on the LAN replies with its hostname
|
|
227
|
+
on the LAN replies with its hostname, connection port, and TLS certificate
|
|
228
|
+
fingerprint. The fingerprint is the server's stable identity: when a
|
|
229
|
+
reconnecting client can no longer reach a server at its last known address
|
|
230
|
+
(typically a new DHCP lease after a reboot), it re-scans and matches the
|
|
231
|
+
fingerprint to follow the server to its new address, keeping the stored
|
|
232
|
+
pairing token so no fresh approval is needed. Windows Firewall
|
|
220
233
|
must allow Python to receive inbound UDP on that port for a server to be
|
|
221
234
|
discoverable from other machines.
|
|
222
235
|
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
"""The "About"
|
|
1
|
+
"""The "About" dialog (Help ▸ About).
|
|
2
2
|
|
|
3
3
|
Shows the same metadata the PyPI page shows — summary, author, license,
|
|
4
4
|
Python requirement, links — read from the installed package's metadata via
|
|
5
|
-
importlib.metadata, with static fallbacks so the
|
|
5
|
+
importlib.metadata, with static fallbacks so the page still renders in odd
|
|
6
6
|
environments (the version always comes from `remotedesktop.__version__`,
|
|
7
7
|
the single source hatchling packages)."""
|
|
8
8
|
|
|
9
9
|
from importlib import metadata
|
|
10
10
|
|
|
11
11
|
from PySide6.QtCore import Qt
|
|
12
|
-
from PySide6.QtWidgets import
|
|
12
|
+
from PySide6.QtWidgets import (
|
|
13
|
+
QDialog,
|
|
14
|
+
QDialogButtonBox,
|
|
15
|
+
QLabel,
|
|
16
|
+
QVBoxLayout,
|
|
17
|
+
QWidget,
|
|
18
|
+
)
|
|
13
19
|
|
|
14
20
|
from remotedesktop import __version__, icon
|
|
15
21
|
|
|
@@ -36,7 +42,7 @@ def _field(name: str) -> str:
|
|
|
36
42
|
return str(value) if value else _FALLBACKS.get(name, "")
|
|
37
43
|
|
|
38
44
|
|
|
39
|
-
class
|
|
45
|
+
class AboutPage(QWidget):
|
|
40
46
|
"""Package metadata as a rich-text page with clickable links."""
|
|
41
47
|
|
|
42
48
|
def __init__(self, parent: QWidget | None = None) -> None:
|
|
@@ -70,3 +76,27 @@ class AboutTab(QWidget):
|
|
|
70
76
|
layout.addWidget(logo)
|
|
71
77
|
layout.addWidget(body)
|
|
72
78
|
layout.addStretch(1)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class AboutDialog(QDialog):
|
|
82
|
+
"""Help ▸ About: the AboutPage in a modeless dialog with a Close button.
|
|
83
|
+
|
|
84
|
+
Modeless on purpose — like the rest of the app it stays usable from a
|
|
85
|
+
remote session, and it must never block streaming or approval prompts.
|
|
86
|
+
The window keeps one instance and re-shows it (`open_`).
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
def __init__(self, parent: QWidget | None = None) -> None:
|
|
90
|
+
super().__init__(parent)
|
|
91
|
+
self.setWindowTitle("About Remote Desktop")
|
|
92
|
+
buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Close)
|
|
93
|
+
buttons.rejected.connect(self.close)
|
|
94
|
+
layout = QVBoxLayout(self)
|
|
95
|
+
layout.addWidget(AboutPage(self))
|
|
96
|
+
layout.addWidget(buttons)
|
|
97
|
+
|
|
98
|
+
def open_(self) -> None:
|
|
99
|
+
"""Show (or re-raise) the dialog, modeless."""
|
|
100
|
+
self.show()
|
|
101
|
+
self.raise_()
|
|
102
|
+
self.activateWindow()
|