Commit graph

2283 commits

Author SHA1 Message Date
sithlord48
db67550db3 refactor: server: use contains when possible 2025-08-11 12:32:50 -04:00
sithlord48
85e7d95188 refactor: server/Config use contains 2025-08-11 12:32:50 -04:00
sithlord48
651e093e04 refactor: clientProxy1_4 do not create pointless override that just call the baseclass 2025-08-11 12:32:50 -04:00
sithlord48
02fb9915bf refactor: Arch, only define init override on windows, where its ambiguious 2025-08-11 12:32:50 -04:00
sithlord48
6153f64fb7 chore: remove uneeded casts 2025-08-11 12:32:50 -04:00
sithlord48
f91df1639b refactor: make sure to state type of access to base class 2025-08-11 12:32:50 -04:00
sithlord48
63bd2e71b0 refactor: CoreProcess fully qualify enums used in signals 2025-08-11 12:32:50 -04:00
sithlord48
e1d00d59a4 refactor: ScreenSetupModel::isFull compaire same type of iterator 2025-08-11 12:32:50 -04:00
sithlord48
5def3f1f6a refactor: DaemonApp add context object for lambda starting the thread
chore: DaemonApp, remove unnessary QObject:: for connect calls
2025-08-11 12:32:50 -04:00
sithlord48
6840e1e7eb fix: Better description for InvalidProtocolException
fixes: #8830
2025-08-11 17:14:45 +01:00
sithlord48
85d89f9846 refactor: XArch Classes => Arch Exception Classes 2025-08-11 17:14:45 +01:00
sithlord48
8929f85bf7 refactor: XConfigRead => ServerConfigReadException 2025-08-11 17:14:45 +01:00
sithlord48
9601180e1b refactor: XBase Classes => BaseException 2025-08-11 17:14:45 +01:00
sithlord48
64786ddcb7 refactor: XDeskflow Classes => DeskflowException Classes 2025-08-11 17:14:45 +01:00
sithlord48
e4a9d1eb78 refactor: XScreen Classes => ScreenException Classes 2025-08-11 17:14:45 +01:00
sithlord48
1b04b1137c refactor: XIO Classes => IOException Classes 2025-08-11 17:14:45 +01:00
sithlord48
813b0c3828 refactor: mt/XThread Classes => mt/ThreadException Classes 2025-08-11 17:14:45 +01:00
sithlord48
22a358fb49 refactor: XMT Classes => MTException Classes 2025-08-11 17:14:45 +01:00
sithlord48
ada2813f9f refactor: XSocket Classes => XSocketException Classes 2025-08-11 17:14:45 +01:00
sithlord48
906c07e4fd fix: MainWindow::setHostName only check if the screen is existing when in server mode, In severmode update the serverConfig serverName to prevent a case where the server screen is on the grid with the old name breaking the layout 2025-08-11 16:49:25 +01:00
Nick Bolton
a4c0e30bb8 fix: Ignore Mod2 and Mod3 to make log quieter 2025-08-07 15:31:52 -04:00
Peter Hutterer
a5c9744258 fix: Account for more modifiers in the EI keymap calculation
Some modifiers, notably LevelThree, were not accounted for in the
modifier mask calculation. This leads to an incorrect keymap where some
key symbols were listed for keys without (or insufficient) modifiers.
Emulating those keys can then produce the wrong keysyms.

Reproducible with server and client on English(UK) layout and typing
e.g. [. That key has its own key AD11 (right of P) but is also on
the third level of AE08 (the 8 key). When the server sends the keyid 91
(for [) the client looks it up in the pre-generated keymap. It is found
first on the 8 key with no modifiers (because LevelThree was previously
ignored), hence the client simulates a key 8 press without modifiers.
This erroneously produced an 8 instead of the wanted [.

Fix this by ensuring that all modifiers are accounted for in the key
map. This fix is likely incomplete as it does not account for the full
virtual modifier to real modifier mappings possible (e.g. Mod5 *may* be
something other than AltGr) but it does push the can a bit further down
the road, for someone else to release the worms.

Closes: #8168
2025-08-07 15:31:52 -04:00
sithlord48
2a84ef0ebf refactor: update log calls to LOG_... fixes #8819 2025-08-06 16:18:38 +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
James Le Cuirot
47bb33e065 fix: update inclusion of climits and cstdint headers
For INT_MAX and SIZE_MAX.
2025-08-06 13:03:52 +01:00
sithlord48
40423397e3 refactor: Config remove redundant != Operator in server/Config 2025-08-06 11:44:38 +01:00
sithlord48
4955e8c2ba refactor: Fingerprint, KeyMap, KeySequence and Action use default == operator 2025-08-06 11:44:38 +01:00
sithlord48
24480ce946 refactor: AppUtilUnix remove name from unused IEventQueue pointer 2025-08-06 11:44:38 +01:00
sithlord48
76d5ac0a34 refactor: KeyTypes::KeyModifierNameMapEntry, remove commented code 2025-08-06 11:44:38 +01:00
sithlord48
d20887f34a refactor: KeyState::updateModifierState, use std::ranges::set_difference in place of std::set_difference 2025-08-06 11:44:38 +01:00
sithlord48
0cbc922478 refactor: MSWindowsDesks::getCursorPos initialize pos to 0,0 2025-08-06 11:44:38 +01:00
sithlord48
38866cf2c1 refactor: remove unneeed constructors from DisplayInvalidExecption 2025-08-06 11:44:38 +01:00
sithlord48
32165f5b58 refactor: IKeyState remove need for malloc in alloc methods 2025-08-06 11:44:38 +01:00
sithlord48
1968669a39 refactor: App make m_bye private access it from the method bye 2025-08-06 11:44:38 +01:00
sithlord48
3b2b8a9ebe refactor: IKeyState: directly make string when spilting as arg to emplace 2025-08-06 11:44:38 +01:00
sithlord48
048ce47008 refactor: ServerConfig: used ranged loop to process neighbours 2025-08-06 11:44:38 +01:00
sithlord48
d321e2a874 refactor: TCPSocket Init m_socket before m_events 2025-08-06 11:44:38 +01:00
Nick Bolton
0352e1c6d6 chore: Improve logging in Server::onClipboardChanged 2025-08-05 14:41:50 -04:00
Nick Bolton
98d03fb098 chore: Improve logging in Server::handleClipboardGrabbed 2025-08-05 14:41:50 -04:00
Nick Bolton
739cdc1752 chore: Improve logging for DESKFLOW_MOUSE_ADJUSTMENT env var
We plan to move this elsewhere, but in the meantime, the DEBUG1 logging was too noisy. Also fixed some code style that was bugging me.
2025-08-05 14:41:50 -04:00
Nick Bolton
54a7ef24d9 refactor: Remove unused includes from KeyMap.cpp and use correct <algorithm> include 2025-08-05 08:56:53 -04:00
Nick Bolton
c4ff0b1832 refactor: Remove unnecessary debug log from KeyState::fakeKeys 2025-08-05 08:56:53 -04:00
sithlord48
80408b985e refactor: show display version for --version 2025-08-05 13:36:04 +01:00
sithlord48
ff1e7f3c9f refactor: ClientApp / ServerApp, remove do nothing updateStatus methods and calls 2025-08-04 13:46:27 +01:00
sithlord48
b2eb3a036d refactor: move ClientApp::handleScreenError / ServerApp::handleScreenError to base App Class 2025-08-04 13:46:27 +01:00
sithlord48
229fedf347 refactor: App::m_bye make protected 2025-08-04 13:46:27 +01:00
sithlord48
cfccee1592 refactor: TCPSocket, make m_events private access via getEvents method 2025-08-04 13:46:27 +01:00
sithlord48
0c728beb01 refactor: TCPListenSocket, replace make protected members private, use protected methods to acces them in the subclasses 2025-08-04 13:46:27 +01:00
sithlord48
4e01e3f337 refactor: make APP:m_events private access via exsisting getEvents method 2025-08-04 13:46:27 +01:00
sithlord48
92ae41852d chore: remove Unused Stopwatch::double operator 2025-08-04 13:46:27 +01:00
sithlord48
4f9b042f5a refactor: explicit constructor for PlatformScreen, FileTail, FunctionJob, FunctionEventJob, ServerConfig, ScreenSettingsDialog, KeySequenceWidget, NetworkAddress, AddClientDialog, ConfigReadContext, LockCursorToScreenAction, RestartServer And KeyboardBroadcastAction 2025-08-04 13:46:27 +01:00
Christian Schmidt
1236fa4cab fix: server: initialize the m_protocol member with a default value
It is likely random whether the server works or not without
a manually configured protocol option, which is neither documented
nor enforced to be set.
With a random uninitialized value in m_protocol, this can happen:
[2025-08-03T12:39:57] NOTE: accepted client connection
[2025-08-03T12:39:57] FATAL: a runtime error occurred: XInvalidProtocol

Reports of "it works with debug enabled" are likely due to having
parts of the memory space the server object is allocated into being
cleared, and thus having a 0 (Synergy) startup value.
2025-08-04 12:47:13 +01:00
sithlord48
e69be64773 refactor: remove redundant != operators c++20 std will generate the !=operator as long as the class has an ==operator 2025-08-01 13:03:51 -04:00
sithlord48
c2db28a624 refactor: ServerProxy::setActiveServerLanguage take std::string_view 2025-08-01 13:03:51 -04:00
sithlord48
1f92f2a2ed chore: XWindowsScreen declare vars on seperate lines 2025-08-01 13:03:51 -04:00
sithlord48
74bbd5af25 chore: Fingerprint, remove unneed private label in struct 2025-08-01 13:03:51 -04:00
sithlord48
023037f7ee refactor: XWindowsClipboard, user std::format_to_n in place of snprintf 2025-08-01 13:03:51 -04:00
sithlord48
fe19f4de66 refactor: ServerProxy::setActiveServerLanguage, use std::string size method to get string in place of strlen 2025-08-01 13:03:51 -04:00
sithlord48
d120cc853d refactor: InputFilter, user std::ranges::partial_sort in == operator 2025-08-01 13:03:51 -04:00
sithlord48
c78665dc35 refactor: XWindowsKeyState, updateKeysymMap use std::ranges::fill to fill modifier array 2025-08-01 13:03:51 -04:00
sithlord48
c4c4c09eb2 refactor: XwindowsClipboard , use std::ranges::for_each in sendReply 2025-08-01 13:03:51 -04:00
sithlord48
2cccc3d0c8 refactor: use std::ranges::find_if when possible 2025-08-01 13:03:51 -04:00
sithlord48
59c414ebad refactor: IKeyState: use emplace in place of insert for set addition 2025-08-01 13:03:51 -04:00
sithlord48
1e7143b85e refactor: IKeyState, remove name from unused IEventQueue in constructor 2025-08-01 13:03:51 -04:00
sithlord48
a6068ad6f6 refactor: Log use std::format in place of snprintf, when not running on macOS... 2025-08-01 13:03:51 -04:00
Corentin Rossignon
11caf55522 fix: Wrong m_buttons vector size in case of maxButton inferior to numButtons 2025-08-01 08:18:57 -04:00
sithlord48
f73d098b1f refactor: Unify ENetworkProtocol and ServerProtocol into new enum Class NetworkProtocol in new file base/NetworkProtocol.h 2025-07-31 13:41:29 +01:00
sithlord48
9673943556 refactor: OptionTypes, Remove corner related enums and uses static items for corner masks instead 2025-07-31 13:41:29 +01:00
sithlord48
7c06ae39ef refactor: AddResults => enum class ScreenAddResults 2025-07-31 13:41:29 +01:00
sithlord48
ffa5b88cdf refactor: ServerApp::EServerState => Enum class ServerApp::ServerState 2025-07-31 13:41:29 +01:00
sithlord48
8977d70dd9 refactor: IClipboard::EFormat => enum class Clipboard::Format 2025-07-31 13:41:29 +01:00
sithlord48
49e36cfdc6 refactor: Event, make non default constructors explicit 2025-07-29 13:41:34 +01:00
sithlord48
283e0c6367 refactor: KeyMap EType => enum class KeyType 2025-07-29 13:41:34 +01:00
sithlord48
902f5823f2 refactor: KeyMap::keysToRestoreModifiers, use ranged for loops 2025-07-29 13:41:34 +01:00
sithlord48
7785c954d5 refactor: KeyMap::mapCommandKey to use ranged loop 2025-07-29 13:41:34 +01:00
sithlord48
db841f71bd refactor: PriorityQueue, Use std::ranges version of heap methods 2025-07-29 13:41:34 +01:00
sithlord48
84c2234869 refactor: ActionDialog use proper ActionDialog::itemToggled in place of lambda 2025-07-29 13:41:34 +01:00
Nick Bolton
51e467d45e feat: Enable 'MouseKeys' on screen setup and never restore old settings
Previously we were toggling the 'MouseKeys' Windows accessibility feature on and off, but this was causing many bugs; cursor show delay while Windows brings up the mouse stack(?) and often forever lost mouse cursor when toggling off the 'MouseKeys' feature. After a few days of hacking away at this, it seems safest to just leave it on.
2025-07-28 21:45:05 +01:00
Nick Bolton
e184475a24 feat: Add logging in MSWindowsScreen for setup and cursor centering 2025-07-28 21:45:05 +01:00
Nick Bolton
1fb2789cb1 fix: Prevent flicker on desk leave with 30ms delay 2025-07-28 21:45:05 +01:00
Nick Bolton
8979d7f94f feat: Cursor visibility retry mechanism
The `ShowCursor` function does not directly show/hide the cursor; it increments or decrements the internal display counter. When that counter reaches a certain positive/negative number, then the cursor is shown or hidden at a particular threshold.
2025-07-28 21:45:05 +01:00
Nick Bolton
9033198aed refactor: Change mouse keys functions names to expose actual behavior 2025-07-28 21:45:05 +01:00
Nick Bolton
db55c3f0e7 build: remove unused includes from MSWindowsDesks.cpp|h 2025-07-28 21:45:05 +01:00
sithlord48
2c55f4fe06 refactor: windows write daemon log in ProgramData\Deskflow
remove old log file on update
2025-07-21 12:41:46 +01:00
sithlord48
a4c82869a6 fix: split version info in new header
a new file src/lib/VersionInfo.h.in now holds our version info vars
fixes #8657
2025-07-21 12:06:01 +01:00
sithlord48
f33848f9b8 fix: setWindowIcon explicitly, fixes #8756 2025-07-21 11:10:19 +01:00
sithlord48
e828563190 chore: MainWindow, use system correct monospace font for log 2025-07-18 10:51:50 -04:00
sithlord48
c7873f2f81 refactor: DisplayInvalidExecption pass const ref to string 2025-07-17 18:47:50 +01:00
sithlord48
9f72b44d2a refactor: ClientApp indicate msg is unused in update status 2025-07-17 18:47:50 +01:00
sithlord48
8dcd9b0c01 refactor: ArgParser::assemble command use const ref std::string_view for ingoreArg 2025-07-17 18:47:50 +01:00
sithlord48
e436b41ab0 refactor: ArgParser::parsePlatformArgs remove unused argument isServer 2025-07-17 18:47:50 +01:00
sithlord48
c2eae36650 refactor: ArgParser, simplify arg parsing by combining duplicate checks into one 2025-07-17 18:47:50 +01:00
sithlord48
1079c22736 refactor: Settings use Static methods where possible internally 2025-07-17 18:47:50 +01:00
sithlord48
d69febe2dc refactor: Unicode, declare vars on seperate line as untions, using string_view for UCS2ToUTF8 input, remove redundant parentheses 2025-07-17 18:47:50 +01:00
sithlord48
c6a97c24a2 refactor: String, use std::ranges::lexicogriphical_compare to simplify CaselessCpm::less 2025-07-17 18:47:50 +01:00
sithlord48
d9ec93e7ee refactor: String, pass stringToSizeType a const ref of the string we are to get the size of 2025-07-17 18:47:50 +01:00
sithlord48
9db11a90eb refactor: TCPSocket, new protected methods to access m_readable, m_writable and m_connected, use them in place of direct access and make the variables private
TCPSocket, remove duplicate private and protected sections in header
2025-07-17 18:47:50 +01:00
sithlord48
c327c80d63 refector: TCPListenSocket, remove duplicate public in header, make m_mutex private 2025-07-17 18:47:50 +01:00
sithlord48
0884a267d1 refactor: App move m_suspended to the subclasses where its is used 2025-07-17 18:47:50 +01:00
sithlord48
d1b810baa5 refactor: use std::size to get size of arrays 2025-07-17 18:47:50 +01: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
ae5ba4e51f chore: remove dev method PortalInputCapture::fakeEisFd 2025-07-14 10:31:50 +01:00
sithlord48
9413393057 refactor: anonymous enum in ServerConfig => ServerConfig::AddResults enum class 2025-07-11 03:06:24 -07:00
sithlord48
79b445373b refactor: FingerPrintDialog::FingerpringDialogMode now enum class 2025-07-11 03:06:24 -07:00
sithlord48
9beea1abfe refactor: anon enum in AddClientDialog to AddAction enum class 2025-07-11 03:06:24 -07:00
sithlord48
a88a67d47f refactor: ActionDialog::ActionType enum is now a struct 2025-07-11 03:06:24 -07:00
sithlord48
7fd9070a80 refactor: InputFilter::EFilterStatus => InputFilter::FilterStatus enum class 2025-07-11 03:06:24 -07:00
sithlord48
e37cea2d6b refactor: replace anon Enum in XWindowsKeyState with static vars 2025-07-11 03:06:24 -07:00
sithlord48
181d862838 refactor EiEventQueue remove anon enum for a few static members 2025-07-11 03:06:24 -07:00
sithlord48
6ca980e3e5 refactor: XSocket::EError => XSocket::SocketError enum class 2025-07-11 03:06:24 -07:00
sithlord48
94be5f7498 refactor: TCPSocket::EJobResult => enum class TCPSocket::JobResult 2025-07-11 03:06:24 -07:00
sithlord48
32e6a84a6f chore: remove unused anon enum in SecureSocket 2025-07-11 03:06:24 -07:00
sithlord48
b9964b5e90 refactor: remove anon enum in IKeyState and replace with static s_numButtons 2025-07-11 03:06:24 -07:00
sithlord48
422b4c3a23 refactor ClientArgs ClientScrollDirection to enum class use Members Normal and Inverted for names 2025-07-11 03:06:24 -07:00
sithlord48
05e32497d1 refactor: ArgsBase::Type => ArgsBase::ClassType class enum 2025-07-11 03:06:24 -07:00
sithlord48
9905f32738 refactor: Common.h replace anon enum with set constexpr exit codes 2025-07-11 03:06:24 -07:00
sithlord48
29e9b8ae3b refactor: ServerProxy::EResult => ServerProxy::ConnectionResult enum class 2025-07-11 03:06:24 -07:00
sithlord48
fe3c41f857 refactor: remove Unneed enum for LogOutputters and use a constexp instead 2025-07-11 03:06:24 -07:00
sithlord48
3ececbcfd9 refactor: Event anon enum => EventFlags struct 2025-07-11 03:06:24 -07:00
sithlord48
c12aa4c6e9 refactor: Make IEventQueueBuffer Types an enum class, use proper names rename kNone => Unknown to reflect its unknowns an unknown type of event 2025-07-11 03:06:24 -07:00
sithlord48
fc58688bb0 refactor: replace throw() with noexcept in cases where execeptions are not possible 2025-07-11 03:06:24 -07:00
sithlord48
77bdde5434 refactor: Elevel => LogLevel enum class, use proper names for items in the class 2025-07-11 03:06:24 -07:00
sithlord48
3472ff6ce5 chore: ArchNetworkBSD, use std::ignore in place of unused int 2025-07-11 03:06:24 -07:00
sithlord48
2d3105206d fix: save geometry not frameGeometry on exit
fixes #8741
2025-07-09 09:32:39 +01:00
sithlord48
c6778dc9be refactor: use more if and switch init-statements 2025-07-07 17:53:56 +01:00
sithlord48
36e985d8ab chore: add missing default for switches 2025-07-07 17:53:56 +01:00
sithlord48
865365b2fa chore: add noreturn to more methods 2025-07-07 17:53:56 +01:00
sithlord48
8a83f68ff0 chore: remove unused < operator for Timer class 2025-07-07 17:53:56 +01:00
sithlord48
245fa815d2 refactor: Server::onMouseMousePrimary, use std array for horizontal and vertical direction array 2025-07-07 17:53:56 +01:00
sithlord48
f12f312dab refactor: ProtocolTypes EDirection => enum class Direction 2025-07-07 17:53:56 +01:00
sithlord48
dded2e3711 refactor: ProtocolTypes EDirectionMask => enum class DirectionMask 2025-07-07 17:53:56 +01:00
sithlord48
d71d4eaf07 refactor: ProtocolTypes EDataTransfer => struct ProtocolTypes::ChunkType 2025-07-07 17:53:56 +01:00
sithlord48
bc9f47c957 refactor: ProtocolTypes EDataReceived => enum class ProtocolTypes::TransferState 2025-07-07 17:53:56 +01:00
sithlord48
0ea2576032 refactor: XWindowsEventQueueBuffer, use static const for timeoutd delay 2025-07-07 17:53:56 +01:00
sithlord48
0100cb796e chore: SecureSocket remove unused MAX_ERROR_SIZE define , rename MAX_INPUT_BUFFER_SIZE static to confirm to naming convention 2025-07-07 17:53:56 +01:00
sithlord48
8ec40dd74b refactor: ClipboardChunk Replace CLIPBOARD_CHUNK_META_SIZE define with constexpr 2025-07-07 17:53:56 +01:00
sithlord48
4034d15fb3 refactor: ClientApp Replace RETRY_TIME define with constexpr 2025-07-07 17:53:56 +01:00
sithlord48
1a9f8d5cdc refactor: app Replace options defines as constexpr use more sane names 2025-07-07 17:53:56 +01:00
sithlord48
66ddaca410 refactor: PriorityQueue::Swap make noexcept 2025-07-07 17:53:56 +01:00
sithlord48
2c2a5c0269 refactor: Make KeyMake::Swap noexcept 2025-07-07 17:53:56 +01:00
sithlord48
e42d3b45b6 refactor: SocketMultiplexer, do not create nested pointer in new Thread call 2025-07-07 17:53:56 +01:00
sithlord48
5aa9b1bfd4 refactor: PortalRemoteDesktop, do not create nested pointer in new Thread call 2025-07-07 17:53:56 +01:00
sithlord48
cfbfa88cdc refactor: PortalInputCapture: do not create nested pointer in new Thread call 2025-07-07 17:53:56 +01:00
sithlord48
4a92a3295b refactor: ScreenSettingsDialog, do not create nested validators in the Lines setValidator method 2025-07-07 17:53:56 +01:00
sithlord48
ede27975d7 chore: clean up remaing sonar warnings to use in class intializers where possible 2025-07-07 17:53:56 +01:00
sithlord48
a175c293f6 chore: comment empty methods that do nothing 2025-07-07 17:53:56 +01:00
sithlord48
7fe50748f3 refactor: ServerApp use if in places of multi ternary ops for readablitly 2025-07-03 03:24:16 +00:00
sithlord48
0474e10b03 chore: Arch::time explictly convert to double on return 2025-07-03 03:24:16 +00:00
sithlord48
2421a8b725 refactor: Make throwError and throwNameError members of IArchNetwork
make throwError and throwNameError noreturn
          remove unused extra private section in IArchNetwork subclasses
2025-07-03 03:24:16 +00:00
sithlord48
ab4fbd1c85 refactor: use using enum EventTypes when possible to reduce verbosity 2025-07-03 03:24:16 +00:00