Commit graph

59 commits

Author SHA1 Message Date
sithlord48
5eb1d7068e refactor: declare vars where they are used in if statements 2026-06-19 08:14:54 -04:00
Nick Bolton
03a4800677 feat: clipboard support for portal remote desktop
Add libportal clipboard handling to the remote desktop.
Supports both directions (server to Wayland client paste,
and copy from the Wayland client back to the server)
for UTF-8 text, plain text, and PNG/BMP images.

The shared mime-type table, BMP/DIB and PNG encode/decode helpers, and
portal selection read/write live in a new PortalClipboard
helper used by both PortalInputCapture and PortalRemoteDesktop.

If the portal returns a restored RemoteDesktop session without clipboard
enabled (a token persisted before clipboard support existed), discard
the restore token and reconnect so the user gets a fresh permission
dialog. Otherwise the session would loop with a clipboard-less token
forever.
2026-06-18 22:06:37 +01:00
Peter Hutterer
d7d3f8d4c8 feat: inputcapture clipboard support
Send the clipboard over the libportal InputCapture portal. Only built
if the installed libportal has clipboard support.

AI disclosure: Claude was used on both sides of this work.
- Peter Hutterer: "The second commit was purely written by Claude
  after I stared at this for too long without seeing any hope of
  getting started. Turns out Claude wrote something that at least
  looks correct and it does work. It needs review but also needs
  knowledge of deskflow's internals that I don't have..."
- Nick Bolton: Claude also assisted with the follow-up work listed
  below (image copy/paste, session re-request, race fixes, size/mime
  validation, and CMake detection).

Server side (Wayland host, Peter Hutterer):
- Initial scaffolding for inputcapture clipboard support, guarded so it
  only builds when the portal exposes the clipboard API.
- Integrate clipboard data into the inputcapture session so the host
  clipboard can be offered to the remote (the Claude-written commit
  referenced above).

Client side (Wayland receiver, KoljaFrahm):
- Receive clipboard data from the server and feed it into the local
  clipboard through libportal. Built on the reference code by Peter:
  https://github.com/whot/libportal-clipboard-test/tree/main

Build integration and rebase (Chris Rizzitello, sithlord48):
- Add the original CMake check for libportal/clipboard.h to define
  HAVE_LIBPORTAL_CLIPBOARD, and guard the libportal clipboard use on
  it.
- Update the code style and rebase onto the updated input capture
  session persistence: https://github.com/deskflow/deskflow/pull/9415

Image support and reliability fixes (Nick Bolton):
- Support image copy/paste in addition to text, so screenshots and
  other image clipboard contents work both ways through inputcapture.
- Re-request the input capture session when it comes up without a
  clipboard, so new testers with existing sessions can get clipboard
  functionality without needing to clear the session.
- Defer clipboard reads until the input capture session is active,
  avoiding races where reads happen before the portal is ready.
- Fix assorted style issues in original commit to match conventions.
- Check the configured clipboard size limit and validate incoming
  mime types before forwarding inputcapture clipboard data.
- Switch the CMake clipboard probe to check_symbol_exists so detection
  matches what the compiler actually sees in the headers.

Co-authored-by: Nick Bolton <nick@symless.com>
Co-authored-by: KoljaFrahm <GitHub.Kolja@dfgh.net>
Co-authored-by: Chris Rizzitello <sithlord48@gmail.com>
2026-06-18 22:06:37 +01:00
Nick Bolton
4e121dac30 chore: update 'Synergy App Ltd' copyright (company renamed) 2026-06-09 00:06:11 -04:00
sithlord48
8e469379e8 refactor(log): Squash all Debug1 And Debug2 logs into Verbose
fixes: #9725
BREAKING_CHANGE: log level values have changed settings for log level may need to be reset
2026-05-15 11:47:10 +01:00
sithlord48
a532f655c1 feat: support horizontal scrolling
fixes: #7220
based on 9f15b1bcf2
Co-authored-by: Evan Maddock <maddock.evan@vivaldi.net>
2026-02-11 11:59:28 +00:00
sithlord48
050cb649c2 refactor: use ScrollDelta for fakeMouseWheel 2026-02-09 09:02:21 +00:00
sithlord48
5612e99f1d refactor: Move the scrollModifiers to ISecondaryScreen 2026-02-09 09:02:21 +00:00
sithlord48
a520e3b2e9 refactor: check settigns for invertscroll in PlatformScreen 2026-02-06 12:51:39 +00:00
sithlord48
857326b274 refactor: rename PlatformScreen::mapClientScrollDirection -> PlatformScreen::applyClientScrollModifier
prepare for horizontal scroll support by having it handle pairs of x and y values
2026-02-06 12:51:39 +00:00
Johannes Berg
f065979b3f Fix: detect key repeat in libei input
For libei, there's no indication that a key is repeated.
However, sending repeated key down events (DKDN instead
of DKRP for the synergy protocol) can be confusing to
clients, which then causes issues like in #7971.

Detect repeated key down events in EiScreen server and
send them to the client with the repeat flag set, so in
e.g. synergy that causes the DKRP messages, to be less
confusing.

For me this fixes an issue where the synergy client is
creating a USB device, which requires repeated events
to be entirely dropped since the host OS where the USB
device is connected will do its own repeat when a key
is held down.
2026-01-30 12:19:29 +00:00
sithlord48
ecb03297fd refactor: EiScreen Sonar cleanup for new clipboard items 2025-11-20 07:57:31 -05:00
sithlord48
9960b657e3 chore: rename EiClipboard -> WaylandClipboardCollection 2025-11-20 07:57:31 -05:00
Jörg Thalheim
e55c67fa2f feat: add wayland clipboard support via wl-clipboard
this is currently based on wl-copy/wl-paste.
One could probably just implement wl-copy/wl-paste without adding much
complexity and better performance.

Co-authored-by: KoljaFrahm <GitHub.Kolja@dfgh.net>
2025-11-20 07:57:31 -05:00
sithlord48
1e672bb8a1 chore: EiScreen remove unused includes 2025-11-07 15:54:19 -05:00
sithlord48
e1fbcb379e chore: Sub classes and overloads not usings parameters of the base methods have the varible names removed 2025-10-17 09:07:21 +01:00
sithlord48
5fc00f7af4 refactor: use bool for invert scrolling 2025-09-30 06:39:54 -04:00
sithlord48
c2ee366e23 refactor: move preventsleep option into CoreArgs 2025-09-30 06:39:54 -04:00
Louis des Landes
7a2591a1fa fix: wayland sleep inhibit on client
Fixes #8827
Adds the XWindowsPowerManager to the EiScreen as, despite the name, this
works on Wayland as well.
2025-09-12 10:54:25 +01:00
sithlord48
bc63961e7e refactor: EIEventQueueBuffer remove unused screen from constructor 2025-09-05 11:52:17 +01:00
Zhuofeng Wang
927075688c fix: Pass ClientScrollDirection to EiScreen 2025-08-26 09:08:45 -04:00
sithlord48
2e193c6a78 chore: PortalInputCapture, conform to naming conventions 2025-08-11 12:58:52 -04:00
sithlord48
f95230549a chore: EiScreen: conform to nameing conventions 2025-08-11 12:58:52 -04:00
sithlord48
85d89f9846 refactor: XArch Classes => Arch Exception Classes 2025-08-11 17:14:45 +01:00
sithlord48
e4a9d1eb78 refactor: XScreen Classes => ScreenException Classes 2025-08-11 17:14:45 +01:00
Nick Bolton
9a9bd7e262 chore: Improve logging for active sides
For the longest time, this log line has bugged me:
```
active sides: e
```

It's hex, but it looks like a bug, since there's no `0x` prefix. Also, most humans can't read hex, so I added a string representation.

New version:
```
[2025-08-06T11:56:00] DEBUG: active sides: LRT (0x0e)
```
2025-08-06 08:38:00 -04:00
sithlord48
f51abad8cc feat: Wayland, only set a side to a border if if has a neighboring screen
move protocolTypes Direction enum to new base/DirectionTypes
use the direction info when calling
fixes #8572
fixes #8452
fixes #8605
fixes #8005
2025-07-14 10:31:50 +01:00
sithlord48
969b642e0b refactor: EiScreen sonar adjustments 2025-06-20 12:41:34 +01:00
sithlord48
a89f3b6892 refactor: conform EiScreen to code standards
fixes #8700
2025-06-20 12:41:34 +01:00
sithlord48
b8124107aa refactor: conform EiKeyState to coding standards 2025-06-20 12:41:34 +01:00
sithlord48
3a35b183d3 refactor: use std::function for Event callback
based on 6d347337c3
2025-06-18 13:17:16 +01:00
sithlord48
c15214aee7 refactor: use std::scoped_lock inplace of std::lock_guard 2025-06-17 10:23:42 +01:00
sithlord48
fe12972e83 chore: use const pointer / ref where possible 2025-05-22 20:46:41 +01:00
sithlord48
3cf0fb89ef chore: add comment to empty methods 2025-05-20 16:20:07 +01:00
sithlord48
52b0c1f061 chore: use auto or (const auto) where possible 2025-05-20 16:20:07 +01:00
sithlord48
c224cd4661 chore: declare const methods recommened by sonar 2025-05-20 16:20:07 +01:00
sithlord48
635962618f chore: define only one variable per line 2025-05-20 16:20:07 +01:00
sithlord48
0ff72441e6 chore: use c++17 style if,switch init-initilizer where possible
chore: correct spelling of "colon" in NetworkAddresses variables
chore: correct some multi line defines near needed init-initilizers
2025-05-20 16:20:07 +01:00
sithlord48
55a7fa3266 Port simplified EventTypes from 8b23570379 2025-05-05 17:17:01 -04:00
Dustin Kaiser
2192636d2b fix(wayland): release portal input capture when EI_EVENT_DISCONNECT is encountered, refactoring
Fixes #8005.
2025-05-01 12:35:00 +01:00
Dustin Kaiser
6194868e89 chore(wayland): add debug logline in EiScreen::handle_portal_session_closed 2025-05-01 12:35:00 +01:00
sithlord48
3dfa3d5069 chore: EiScreen, use auto where possible 2025-04-28 13:50:43 +01:00
sithlord48
fde880fb6f chore: add default case for EI_EVENT handling 2025-04-07 11:23:28 +01:00
sithlord48
3c86d9dc83 chore: rename lib/common/constants.h.in => lib/common/Constants.h.in 2025-03-20 13:06:45 +00:00
Nick Bolton
24d1d4e620 refactor: Simplify lock_guard usage by removing explicit mutex type 2025-03-12 12:18:32 -04:00
sithlord48
7f6caec162 chore: reset screen xywh on update_shape
based on https://github.com/input-leap/input-leap/pull/2167
2025-01-28 11:33:55 +00:00
sithlord48
1085df54ed refactor: Reuse compliance
build files and documentation: MIT
  images / sources: GPL-2.0-only
  breeze icons: LGPL-2.0-only
  Microsoft MSM file, vc redist license
2025-01-27 17:05:47 -05:00
Nick Bolton
6eec07b6dc refactor: Use correct log level for failure messages
This change may help us turn up some everyday problems in the field that get missed due to not using debug log level.

This could also make the log a bit noisier, so at a later date we may need to downgrade anything that is not actually a failure/warning.
2025-01-21 16:46:34 -05:00
sithlord48
3991e0c1a1 refactor: use std::string in place of String
basedon: https://github.com/debauchee/barrier/pull/709
2025-01-08 00:11:34 +00:00
sithlord48
13b58f2f7a fix: 8017, move wayland error to debug context 2024-12-28 20:46:51 +00:00