Commit graph

4546 commits

Author SHA1 Message Date
Nick Bolton
fc44b0bb18 fix: restore client protocol downgrade message 2026-07-04 15:58:17 +01:00
BeaCox
bcd3a658fc fix: use local clipboard limit for client receive 2026-07-04 00:53:42 +01:00
BeaCox
8a535fd5dd fix: enforce clipboard receive size limits 2026-07-04 00:53:42 +01:00
sithlord48
205a3c803e fix: clamp mapped modifiers 2026-07-03 13:44:59 +01:00
sithlord48
b21f5a7ca8 i18n: make sure log levels text is translated 2026-07-02 12:07:44 +00:00
sithlord48
8266fbbe6a fix: Check options array is always an even size 2026-07-01 17:02:09 +01:00
sithlord48
570c9a494b refactor: upgrade server options section setting to new format 2026-06-25 12:08:33 +01:00
sithlord48
f66dbf69f3 chore: remove unused Config methods removeScreen removeScreens removeAllScreens removeOption removeOptions 2026-06-24 21:03:26 +01:00
sithlord48
a45e81fb15 refactor: Remove undocumented hold modifiers to switch code 2026-06-24 20:46:15 +01:00
sithlord48
55b6789728 refactor: save aliases without restarting the core. remove unknown screens when saving the server config 2026-06-23 19:28:35 +01:00
sithlord48
8010d8a8b2 refactor: move saving of screen aliases to general deskflow.conf 2026-06-23 19:28:35 +01:00
sithlord48
2d5cf33f16 chore: remove unused removeAlias methods 2026-06-23 19:28:35 +01:00
sithlord48
f3fb31914d refactor: replace use of insert for std::maps with try_emplace 2026-06-22 10:27:35 -04:00
sithlord48
a54d4d6754 refactor: remove server dead corners. instead set per screen 2026-06-22 10:10:47 -04:00
sithlord48
95ffe1ba03 fix: set new options before reading old ones 2026-06-22 13:52:03 +01:00
sithlord48
161b72e43d refactor: Use mutex to protect m_time in MSWindowsClipboard 2026-06-19 08:26:51 -04:00
sithlord48
698ebc30b3 refactor: Use mutex to protect m_open / m_time in EiClipboard 2026-06-19 08:26:51 -04:00
sithlord48
0042b43bac refactor: use Mutex to protect vars in XWindowClipboard 2026-06-19 08:26:51 -04:00
sithlord48
81e6e13d94 refactor: Use Mutex to protect m_open and m_time in Clipboard.cpp 2026-06-19 08:26:51 -04:00
sithlord48
5eb1d7068e refactor: declare vars where they are used in if statements 2026-06-19 08:14:54 -04:00
sithlord48
31018910f8 refactor KeySqquenceWidget::event join identical cases 2026-06-19 08:14:54 -04:00
sithlord48
f52fdec236 refactor: make PortalRemoteDesktop:handleSessionTransfer a const 2026-06-19 08:14:54 -04:00
sithlord48
a42b6cf897 refactor: make PortalRemoteDesktop:handleSessionOwnerChanged a const 2026-06-19 08:14:54 -04:00
sithlord48
710aae5f3f refactor: make PortalRemoteDesktop::claimClipboard a const 2026-06-19 08:14:54 -04:00
sithlord48
e800512160 refactor: PortalInputCapture remove extra private section in header 2026-06-19 08:14:54 -04:00
sithlord48
cc35a3dc7d refactor: make PortalInputCapture::HandleSelectionTransfer const 2026-06-19 08:14:54 -04:00
sithlord48
9196b23f50 refactor: make PortalInputCapture::claimClipbaordOwnership const 2026-06-19 08:14:54 -04:00
sithlord48
cd1652b758 reactor: mark that session var maybe unused 2026-06-19 08:14:54 -04:00
sithlord48
4f5fdbca11 refactor: make PortalInputCapture::readClipboardSelection const 2026-06-19 08:14:54 -04:00
sithlord48
9f7dbe46ef refactor: make ServerConfigDialog::initConnections const 2026-06-19 08:14:54 -04:00
sithlord48
3fc0aaec5e refactor: change server clipboard grab messages to DEBUG level 2026-06-19 08:13:24 -04:00
sithlord48
74440b9d7a fix: make QApp first in deskflow-core 2026-06-19 08:09:28 -04:00
sithlord48
ace44500d0 fix: do add existing aliases to the alias list, correctly remove items in the list before saving 2026-06-19 12:39:47 +01:00
sithlord48
e58c41ac5e refactor(Settings): Move clipboard size to the general config , store as a mb value convert to expected size on when adding the option 2026-06-19 12:25:28 +01:00
sithlord48
4fd0bf7e1e refactor(Settings): move clipboardSharing -> enableClipboard and to main config 2026-06-19 12:25:28 +01:00
sithlord48
df3746777b chore: remove unused wl-clipboard support 2026-06-18 22:06:37 +01:00
sithlord48
16cd4695cc refactor: do not save empty xdgtokens 2026-06-18 22:06:37 +01: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
Nick Bolton
66cb367473 fix: skip clipboard selection transfer if clipboard is active 2026-06-18 22:06:37 +01:00
Nick Bolton
67f6f893fa refactor: drop redundant clipboard read on selection owner change 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
f2a3fc6596 fix: resend only the grabbed clipboard, not all clipboards
fixes assert fail in `src/lib/server/Server.cpp` `onClipboardChanged`:
`assert(sender == m_clients.find(clipboard.m_clipboardOwner)->second);`
2026-06-18 22:06:37 +01:00
Nick Bolton
1b27a5405d fix: simplify clipboard size limit logging 2026-06-18 22:06:37 +01:00
sithlord48
8a68513261 fix(win32): Do not need to set manifest scaling anymore Qt uses this as default 2026-06-18 09:58:58 +01:00
sithlord48
c26717f38a fix(win32): Create QApp Early as possible 2026-06-18 09:58:58 +01:00
Charles Le (cle-air-m3)
13f98475a2 fix: remove ClipboardSending handler in proxy destructors (UAF)
fixes: #9842
2026-06-17 12:28:51 +01:00
sithlord48
750fdbeb34 refactor: rename the defaultLockToScreenState checkbox to defaultLockToComputerState 2026-06-17 10:59:37 +01:00
sithlord48
eb6930a062 refactor(Settings): move defaultLockToScreenState to general settings 2026-06-16 09:59:51 +01:00
sithlord48
b665c730b7 refactor(Settings): move disableLockToComputer to general settings 2026-06-16 09:59:51 +01:00
sithlord48
69b9baaaeb refactor(Settings): move win32keepForeground to general settings 2026-06-16 09:59:51 +01:00
sithlord48
46e90e12ff refactor(Settings): move relative Mouse movement setting to general settings 2026-06-16 09:59:51 +01:00
sithlord48
ba37ff854f chore: remove unused clientAddress var in ServerConfig 2026-06-16 09:59:51 +01:00
sithlord48
261335d6c3 refactor(Settings): move switchDoubleTap to general settings 2026-06-16 09:59:51 +01:00
sithlord48
ea8f3881fe refactor(Settings): move switchDelay to general settings 2026-06-16 09:59:51 +01:00
sithlord48
488d620b3b refactor(Settings): Move heartbeat to general settings 2026-06-16 09:59:51 +01:00
sithlord48
f51fb4affb refactor: move hasSwitchDoubleTap to general settings 2026-06-12 17:51:41 +01:00
sithlord48
f686e3c503 refactor: mv hasSwitchDelay to general settings 2026-06-12 17:51:41 +01:00
sithlord48
d665b55111 refactor: move hasHeartbeat to general settings 2026-06-12 17:51:41 +01:00
sithlord48
c66c356665 refactor(ServerConfigDialog): add new init connections method to centeralize all connections 2026-06-12 17:51:41 +01:00
sithlord48
493e2f374c refactor(ServerConfigDialog): Add a loadFromConfig method to centeralize loading 2026-06-12 17:51:41 +01:00
sithlord48
76673b8cc3 refactor(ServerSettingsDialog): Always allow configuration of server protocol 2026-06-10 17:37:56 +01:00
sithlord48
516f24a0ba refactor(Settings): add helper method to get network protocol as NetworkProtocol directly 2026-06-10 17:37:56 +01:00
sithlord48
b91a39492f refactor(settings): exclusively read proto from the general settings 2026-06-10 17:37:56 +01:00
sithlord48
c4f65c04a3 refactor: remove public access to serverConfig row and column info 2026-06-10 15:52:17 +01:00
sithlord48
6105e4025a refactor: move numRows to general configuation server/gridHeight 2026-06-10 15:52:17 +01:00
sithlord48
cd1ceccda5 refactor: move numColumns to general configuation server/gridWidth 2026-06-10 15:52:17 +01:00
Momoyama
16141d7156 fix(client): restore relative cursor positions locally
Avoid stale server enter coordinates in relative mouse mode by saving and reusing the client's local cursor position around leave and enter.

Store Windows restore positions per desktop so UAC and secure desktop transitions do not reuse normal desktop coordinates. This affects relative mouse movement restore behavior while preserving the existing center-on-leave path.
2026-06-10 15:34:27 +01:00
Nick Bolton
4e121dac30 chore: update 'Synergy App Ltd' copyright (company renamed) 2026-06-09 00:06:11 -04:00
Kentaro Hayashi
faf83d7824 fix: drop misleading SSL_set1_host for OpenSSL 4.0.0
It will fix the following warning:

  In member function 'int SecureSocket::secureConnect(int)':
  /build/deskflow.work/src/lib/net/SecureSocket.cpp:479:16: warning: 'int SSL_set1_host(SSL*, const char*)' is deprecated: Since OpenSSL 4.0 [
  -Wdeprecated-declarations]
    479 |   SSL_set1_host(m_ssl->m_ssl, name.c_str());
        |   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /build/deskflow.work/src/lib/net/SslLogger.h:8,
                   from /build/deskflow.work/src/lib/net/SecureSocket.cpp:20:
  /usr/include/openssl/ssl.h:1922:34: note: declared here
   1922 | OSSL_DEPRECATEDIN_4_0 __owur int SSL_set1_host(SSL *s, const char *host);
        |                                  ^~~~~~~~~~~~~

NOTE: It seems that SSL_set1_host setup params for hostname verification, but
it will not be used correctly afterward (See
SSL_CTX_set_cert_verify_callback
in SecureSocket::initContext). This implicit behavior cause misleading
and harmful.

Signed-off-by: Kentaro Hayashi <kenhys@xdump.org>
2026-06-05 10:59:58 +01:00
Kentaro Hayashi
fdb100649b fix: invalid type conversion for OpenSSL 4.0.0
Since OpenSSL 4.0.0, X509_get_subject_name returns const X509_NAME
pointer, thus X509_NAME_add_entry_by_txt does not accept it anymore.

See /usr/include/openssl/x509.h.

Instead, explicitly operates it via mutable X509_NAME object.

It is safe operation without using X509_get_subject_name() because
subject name was not modified after cert = X509_new() assignment.

It will fix the following error.

  error: invalid conversion from 'const X509_name_st*' to 'X509_NAME*' {aka 'X509_name
  _st*'} [-fpermissive]
     87 |   X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, reinterpret_cast<const unsigned char *>("Deskflow"), -1, -1, 0);
        |                              ^~~~
        |                              |
        |                              const X509_name_st*

Signed-off-by: Kentaro Hayashi <kenhys@xdump.org>
2026-06-05 10:59:58 +01:00
sithlord48
19a7dc622c refactor(FingerprintDialog): Adjust header to span the dialog 2026-06-05 10:32:06 +01:00
sithlord48
8ed7a3efe1 refactor(FingerprintPreview): Adjust width so hash is not longer slighty cutoff in some cases 2026-06-05 10:32:06 +01:00
sithlord48
8d1b33b9f1 refactor: move fixed font to styleUtils, use this where fixed fonts are used 2026-06-05 10:32:06 +01:00
sithlord48
6bbf5338ef refactor(FingerprintPreview): remove unneeded innsersha256layout 2026-06-05 10:32:06 +01:00
extra-salad
5e79e49966 fix(wayland): map portal activations by barrier id
Track InputCapture pointer barrier metadata so activation callbacks can identify the fired edge. Portal activations may report cursor positions on zone boundaries, while Deskflow switches using aggregate screen coordinates. Clamp the activation position to the portal zone, then project the fired edge onto Deskflow's aggregate screen before dispatching primary motion.

Keep barrier metadata in sync when zones are rebuilt or when the compositor rejects a requested barrier.
2026-06-02 13:17:01 +01:00
extra-salad
be3cc0ff7a refactor(wayland): factor portal barrier creation
Move repeated InputCapture pointer barrier construction into a helper and add a small side-to-name utility for logging. This keeps the existing barrier geometry and activation handling unchanged while making later barrier metadata changes easier to review.
2026-06-02 13:17:01 +01:00
sithlord48
babef9c307 fix: crash on windows if fixed font is missing 2026-06-01 14:36:12 +01:00
sithlord48
80cc64c238 fix: use Qt localized path for open cert
fixes: #9764
2026-06-01 13:21:20 +01:00
Momoyama
e8a474ba7d fix(macos): warp cursor to center on leave to fix first-move jump
When macOS is the primary screen, hotkey switching to a secondary screen can leave the local cursor baseline away from the hidden-cursor center. The first physical mouse movement is then interpreted as a large secondary-screen delta.

Align macOS primary leave behavior with the Windows and X11 implementations by logging and warping the cursor to the primary-screen center before marking the screen off screen. OSXScreen::warpCursor also updates m_xCursor and m_yCursor, so the next motion delta starts from the expected center baseline.

Impact is limited to macOS primary/server leave handling; macOS secondary/client leave behavior and non-macOS builds are unchanged.
2026-06-01 11:35:39 +01:00
Nick Bolton
bf65080b8b fix: change QString to QByteArray for exception message handling 2026-05-26 12:25:56 -04:00
alfredo1491
6212f9bec6 refactor(win32): update MSWindowsSession and MsWindowsWatchdog to use MsWindowsHandle 2026-05-26 16:58:02 +01:00
alfredo1491
d372462378 build(win32): make sure openssl dir is added to search path for depends always 2026-05-26 16:58:02 +01:00
Nick Bolton
62a8ee749f fix(macos): update BMP handling to support extended headers and improve pixel offset calculation 2026-05-19 17:48:58 +01:00
SASANO Takayoshi
53903016b1 fix: remove unneeded EVP_PKEY_new() (causes memory leak) 2026-05-19 11:56:14 -04:00
SASANO Takayoshi
051464e7fd fix(openbsd): add #include <stdarg> to avoid 'unknown type name' error 2026-05-19 07:43:55 -04:00
SASANO Takayoshi
67f1f41819 chore: remove old OpenSSL support 2026-05-19 11:06:45 +01:00
64JohnLee
5a1a190edd feat: add AltGr modifier override to Screen Settings Dialog 2026-05-19 10:50:47 +01:00
alizane
3d52de0478 feat: display client IP info when manual IP is configured 2026-05-19 09:43:30 +01:00
alizane
5035dc843d fix: prevent client network fallback on strict IP bind failure
fixes: #9552
2026-05-19 09:43:30 +01:00
sithlord48
9c45402552 refactor: include if in portable mode in about copy info 2026-05-15 13:15:57 +01:00
SASANO Takayoshi
958c3f5a2e feat: add search evdev.xml path for NetBSD/OpenBSD 2026-05-15 07:44:27 -04:00
sithlord48
a006681843 fix: settings dialog show log level is above Info without the user changing the combo value 2026-05-15 11:47:10 +01:00
sithlord48
7c7aea47c7 refactor(settingsDialog): populate log level combo using known levels and option data 2026-05-15 11:47:10 +01:00
sithlord48
81262ac9f0 refactor(log): remove g_numPriority 2026-05-15 11:47:10 +01:00
sithlord48
eb97b7641e refactor(log): remove use of g_priority array 2026-05-15 11:47:10 +01:00
sithlord48
a3f97e55e0 chore(log): remove un needed getFilterName methods 2026-05-15 11:47:10 +01:00
sithlord48
acf865fa11 refactor(log): Convert LogLevel into a class using LogLevel::Level as its enum, store values as the Option string display as localized string' 2026-05-15 11:47:10 +01:00
sithlord48
b0413ed4ff refactor: move base/LogLevel -> common/LogLevel 2026-05-15 11:47:10 +01: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
b198681311 refactor(log): Remove LOG_NOTE, use LOG_INFO for all previous notes
BREAKING_CHANGE: LOG Levels maybe wrong when starting the app
2026-05-15 11:47:10 +01:00