Compare commits
422 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 56a1bd68dd | |||
| 2f2754ab97 | |||
| 9883fb988a | |||
| 38a74d7d0f | |||
| 949f1d6534 | |||
| de42f53d68 | |||
| 247d48d318 | |||
| c4c2f7f37f | |||
| 66a022a012 | |||
| 19eefd65c1 | |||
| ad383ad9d4 | |||
| 539ddcaf48 | |||
| b30f8d253c | |||
| c477d0fcc6 | |||
| bc63961e7e | |||
| 30ce0bdf45 | |||
| dd66dd21bb | |||
| 27075a0260 | |||
| 6cfd89af8c | |||
| 8e99700657 | |||
| e21c4cdd4d | |||
| 88efc14bc2 | |||
| a9d518fbc8 | |||
| 43b1014700 | |||
| 2e722bdfeb | |||
| aedbffa809 | |||
| dc0db9d192 | |||
| 9f3e724218 | |||
| f98f8b10d1 | |||
| b788d63044 | |||
| d5936a9e08 | |||
| 81c53d3690 | |||
| 89003082d7 | |||
| fe1a48fa28 | |||
| c4b2f91424 | |||
| f16c13fa54 | |||
| 43ce3c50e5 | |||
| 204a6b5a44 | |||
| a6dc455477 | |||
| 138ede0536 | |||
| eae089d3ec | |||
| 340df69ca2 | |||
| 507c98adff | |||
| 0501f2892d | |||
| 104d2facdb | |||
| 398c9726f3 | |||
| eb2f885983 | |||
| 4a16931c5d | |||
| 78b83c5639 | |||
| 9cf25c4caf | |||
| f0e02724ee | |||
| 60e71aad38 | |||
| d1897efa8b | |||
| 490dac5048 | |||
| 549133e619 | |||
| 323d011476 | |||
| 4e8a67925f | |||
| cba3881f41 | |||
| 78eb353985 | |||
| e7880b72f1 | |||
| d864361085 | |||
| 66366dd95b | |||
| 2c6c65f71e | |||
| 9eede5470c | |||
| 07edccb469 | |||
| 927075688c | |||
| ddadd4ad83 | |||
| b18c3b588f | |||
| fb144a5e66 | |||
| 34c439b3de | |||
| 934ddf1499 | |||
| 4302d50a42 | |||
| 3e96c4d0aa | |||
| 53f787d6ea | |||
| d368b92165 | |||
| 97e3524a24 | |||
| 299ebea0e2 | |||
| 7e12c5b76d | |||
| 3a66969dec | |||
| 65c5d3673d | |||
| e2b4bc45bd | |||
| d3c0ce8895 | |||
| 2b3e7adc0b | |||
| 26983dc0e4 | |||
| a0d75b28ba | |||
| e9cec877f2 | |||
| 0bb8ff646a | |||
| 9268fef89d | |||
| 6f8b3f481d | |||
| 3b2d7fc0b3 | |||
| 7cac145500 | |||
| b2aa638b1f | |||
| 2990a1f686 | |||
| c3f2c04a28 | |||
| 347cb46f15 | |||
| bcb6c368b1 | |||
| a9e87d5ef5 | |||
| 4eec183598 | |||
| 6c6e5fc4d2 | |||
| 0d7d21aeb2 | |||
| ea6f4ce221 | |||
| 1c7d5de01b | |||
| d2d28f5ad6 | |||
| 04ca52b94e | |||
| e369e1ed80 | |||
| 0dfd4ebc4a | |||
| a7048f76f9 | |||
| 8d92a8df68 | |||
| d6b53ea718 | |||
| 64dc2299da | |||
| 2e193c6a78 | |||
| f95230549a | |||
| a13803df94 | |||
| 2ba7fb2f05 | |||
| 9442295227 | |||
| 8d87f3250d | |||
| e700867a32 | |||
| a21d48defb | |||
| 3770e2c39e | |||
| 8d90515446 | |||
| db67550db3 | |||
| 85e7d95188 | |||
| 651e093e04 | |||
| 02fb9915bf | |||
| 6153f64fb7 | |||
| f91df1639b | |||
| 63bd2e71b0 | |||
| e1d00d59a4 | |||
| 5def3f1f6a | |||
| 6840e1e7eb | |||
| 85d89f9846 | |||
| 8929f85bf7 | |||
| 9601180e1b | |||
| 64786ddcb7 | |||
| e4a9d1eb78 | |||
| 1b04b1137c | |||
| 813b0c3828 | |||
| 22a358fb49 | |||
| ada2813f9f | |||
| 906c07e4fd | |||
| a4c0e30bb8 | |||
| a5c9744258 | |||
| a8bf217e62 | |||
| fff25b4144 | |||
| 82ba5a4b97 | |||
| 436f5b7f0a | |||
| cf1789545a | |||
| d7f882f0c4 | |||
| 2a84ef0ebf | |||
| 4f644acbca | |||
| 9a9bd7e262 | |||
| 47bb33e065 | |||
| 40423397e3 | |||
| 4955e8c2ba | |||
| 24480ce946 | |||
| 76d5ac0a34 | |||
| d20887f34a | |||
| 0cbc922478 | |||
| 38866cf2c1 | |||
| 32165f5b58 | |||
| 1968669a39 | |||
| 3b2b8a9ebe | |||
| 048ce47008 | |||
| d321e2a874 | |||
| 21f47de36c | |||
| 0352e1c6d6 | |||
| 98d03fb098 | |||
| 739cdc1752 | |||
| 54a7ef24d9 | |||
| c4ff0b1832 | |||
| b70c6556c9 | |||
| 80408b985e | |||
| ff1e7f3c9f | |||
| b2eb3a036d | |||
| 229fedf347 | |||
| cfccee1592 | |||
| 0c728beb01 | |||
| 4e01e3f337 | |||
| 92ae41852d | |||
| 4f9b042f5a | |||
| 1236fa4cab | |||
| e69be64773 | |||
| c2db28a624 | |||
| 1f92f2a2ed | |||
| 74bbd5af25 | |||
| 023037f7ee | |||
| fe19f4de66 | |||
| d120cc853d | |||
| c78665dc35 | |||
| c4c4c09eb2 | |||
| 2cccc3d0c8 | |||
| 59c414ebad | |||
| 1e7143b85e | |||
| a6068ad6f6 | |||
| 11caf55522 | |||
| f73d098b1f | |||
| 9673943556 | |||
| 7c06ae39ef | |||
| ffa5b88cdf | |||
| 8977d70dd9 | |||
| 943141d65c | |||
| 49e36cfdc6 | |||
| 283e0c6367 | |||
| 902f5823f2 | |||
| 7785c954d5 | |||
| db841f71bd | |||
| 84c2234869 | |||
| 51e467d45e | |||
| e184475a24 | |||
| 1fb2789cb1 | |||
| 8979d7f94f | |||
| 9033198aed | |||
| db55c3f0e7 | |||
| ba4375a28b | |||
| 56f7a0d7b5 | |||
| 3b27fa5771 | |||
| 72ddcdb7f5 | |||
| 4a7d031bc6 | |||
| 45fcdde636 | |||
| 9a799294f7 | |||
| 46db468ede | |||
| 28957a3fa8 | |||
| 2c55f4fe06 | |||
| a4c82869a6 | |||
| f33848f9b8 | |||
| f497b6886a | |||
| 21d38ff444 | |||
| e828563190 | |||
| c7873f2f81 | |||
| 9f72b44d2a | |||
| 8dcd9b0c01 | |||
| e436b41ab0 | |||
| c2eae36650 | |||
| 1079c22736 | |||
| d69febe2dc | |||
| c6a97c24a2 | |||
| d9ec93e7ee | |||
| 9db11a90eb | |||
| c327c80d63 | |||
| 0884a267d1 | |||
| d1b810baa5 | |||
| 6bf25c0089 | |||
| f4b561ac64 | |||
| 28c690074c | |||
| 97c5a17e9d | |||
| f51abad8cc | |||
| ae5ba4e51f | |||
| 9413393057 | |||
| 79b445373b | |||
| 9beea1abfe | |||
| a88a67d47f | |||
| 7fd9070a80 | |||
| e37cea2d6b | |||
| 181d862838 | |||
| 6ca980e3e5 | |||
| 94be5f7498 | |||
| 32e6a84a6f | |||
| b9964b5e90 | |||
| 422b4c3a23 | |||
| 05e32497d1 | |||
| 9905f32738 | |||
| 29e9b8ae3b | |||
| fe3c41f857 | |||
| 3ececbcfd9 | |||
| c12aa4c6e9 | |||
| fc58688bb0 | |||
| 77bdde5434 | |||
| 3472ff6ce5 | |||
| 082d27a88c | |||
| 2d3105206d | |||
| c6778dc9be | |||
| 36e985d8ab | |||
| 865365b2fa | |||
| 8a83f68ff0 | |||
| 245fa815d2 | |||
| f12f312dab | |||
| dded2e3711 | |||
| d71d4eaf07 | |||
| bc9f47c957 | |||
| 0ea2576032 | |||
| 0100cb796e | |||
| 8ec40dd74b | |||
| 4034d15fb3 | |||
| 1a9f8d5cdc | |||
| 66ddaca410 | |||
| 2c2a5c0269 | |||
| e42d3b45b6 | |||
| 5aa9b1bfd4 | |||
| cfbfa88cdc | |||
| 4a92a3295b | |||
| ede27975d7 | |||
| a175c293f6 | |||
| b39b133c9d | |||
| 5976da7e5b | |||
| 7fe50748f3 | |||
| 0474e10b03 | |||
| 2421a8b725 | |||
| ab4fbd1c85 | |||
| 8f6f014bcd | |||
| 47d44db497 | |||
| 879283f46f | |||
| cbbfd495e3 | |||
| 1692bec7e6 | |||
| f9f12a9500 | |||
| 2b38fe6f91 | |||
| 1479a50af5 | |||
| 4c2b9eb9e4 | |||
| 872db8910e | |||
| e06b6b0be4 | |||
| a04572a8c2 | |||
| 5d434d9857 | |||
| 958e14cb13 | |||
| 7116ddac86 | |||
| 5d594dd6be | |||
| f784705a7e | |||
| 22b1e8e543 | |||
| cf9e2ecf49 | |||
| cb508f5c3a | |||
| 26cc85e878 | |||
| 776b02aafc | |||
| 42cd01efd7 | |||
| a7a54ad8a7 | |||
| 20bc88eb1f | |||
| 969b642e0b | |||
| a89f3b6892 | |||
| a973d4277c | |||
| b8124107aa | |||
| 0691d586e7 | |||
| e8c85611a0 | |||
| 0321b2d36e | |||
| f4a49749c7 | |||
| 59ed15628e | |||
| dddb6aadf1 | |||
| 2110411c6d | |||
| b29c5b1bb2 | |||
| 07a217f54f | |||
| aacf922319 | |||
| a80e255bb0 | |||
| 6299f04b59 | |||
| 97006889bd | |||
| f0bb4e5cb3 | |||
| dcb047b6c5 | |||
| 551368a2d2 | |||
| 4d738b4784 | |||
| 06a616ef42 | |||
| 90a651b409 | |||
| dbc7aebfbc | |||
| 024436d82f | |||
| b6bc469744 | |||
| c4e47c0f2c | |||
| 3d712d5621 | |||
| 4e2ad25fc1 | |||
| 66e201c8ef | |||
| 3a35b183d3 | |||
| c15214aee7 | |||
| 5fd4d93f7f | |||
| 84e289bc30 | |||
| 04943fad79 | |||
| a7c1dc4520 | |||
| a73e8df01e | |||
| 0d6837a948 | |||
| ed99306417 | |||
| 782702fe74 | |||
| 5686d24626 | |||
| 818d588b65 | |||
| 86e109baf5 | |||
| fa1ee0690e | |||
| d535593d1d | |||
| f89168d00a | |||
| fb3c8eb965 | |||
| e247f3813a | |||
| f4618ee085 | |||
| 5430625a7e | |||
| eac59768ea | |||
| cb05ece6b6 | |||
| 044c9b24f3 | |||
| a3fe66f213 | |||
| 60a148ce68 | |||
| da5a2088c8 | |||
| 89abcfb238 | |||
| 87704fedb1 | |||
| 3eef21c8df | |||
| 6fbb60a3c2 | |||
| a5522729aa | |||
| 36b4bb09bc | |||
| 8170dd4e99 | |||
| c2a658256e | |||
| bc350852e7 | |||
| 898629f824 | |||
| 7b437b8d35 | |||
| 03b062c96e | |||
| 6c5d08ba7f | |||
| b77d722577 | |||
| bd8e2c5335 | |||
| 13c993c798 | |||
| 7e568121ee | |||
| 115ee2b8af | |||
| 3e4a085bc1 | |||
| 0ce5c2de9a | |||
| ffce22f5a9 | |||
| e40cc11fd5 | |||
| ebec6331cd | |||
| 197b9ed886 | |||
| 8f7fbc0a21 | |||
| 0f5a04825a | |||
| b8835a8a5a | |||
| 8bb6056469 | |||
| 3adcb64f57 | |||
| bc9b1d1178 | |||
| e038dd2b0b | |||
| 1286c18e1d | |||
| 5d94dd0dbf | |||
| b3e03f2856 | |||
| b62e82e792 | |||
| 7837bf416e | |||
| d4d6cbb7fb | |||
| d5910d77ec | |||
| d01a023a8b | |||
| d246d9527a | |||
| a31cff0225 | |||
| da06e97521 | |||
| 7e4d43f1cc |
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -4,24 +4,24 @@ type: "Triage [bug]"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: Thanks for taking the time to help us improve Deskflow.
|
||||
value: |
|
||||
Thanks for taking the time to help us improve Deskflow.
|
||||
|
||||
- type: dropdown
|
||||
id: project
|
||||
- type: checkboxes
|
||||
id: sanity-checks
|
||||
attributes:
|
||||
label: Project
|
||||
description: Are you using Deskflow or a fork/derivative?
|
||||
label: Sanity checks
|
||||
description: |
|
||||
Before reporting a bug, please first:
|
||||
1. Try the latest [continuous build](https://github.com/deskflow/deskflow/releases).
|
||||
2. Wayland users, please review the [known issues](https://github.com/deskflow/deskflow/discussions/7499).
|
||||
3. macOS users, if the app crashes, try [Apple's solution](https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unknown-developer-mh40616/mac).
|
||||
options:
|
||||
# Empty option to force selection
|
||||
-
|
||||
- Deskflow
|
||||
- Barrier
|
||||
- Input Leap
|
||||
- Synergy
|
||||
default: 0
|
||||
- label: I have done the sanity checks, and my issue persists
|
||||
- label: These sanity checks are not relevant to the bug
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: textarea
|
||||
id: version
|
||||
attributes:
|
||||
@ -66,60 +66,21 @@ body:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: linux-wayland
|
||||
attributes:
|
||||
label: Wayland on Linux
|
||||
description: If using Wayland on Linux, please review the [known issues](https://github.com/deskflow/deskflow/discussions/7499) before reporting.
|
||||
options:
|
||||
- label: I have reviewed the Wayland [known issues](https://github.com/deskflow/deskflow/discussions/7499) and my issue is new
|
||||
- label: I am not using Wayland on Linux
|
||||
|
||||
- type: checkboxes
|
||||
id: mac-signing
|
||||
attributes:
|
||||
label: Signing on macOS
|
||||
description: If using macOS and the app crashes, try [Apple's solution](https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unknown-developer-mh40616/mac) before reporting.
|
||||
options:
|
||||
- label: I have authorized the app to run on my Mac
|
||||
- label: I am not using macOS
|
||||
|
||||
- type: checkboxes
|
||||
id: continuous-build
|
||||
attributes:
|
||||
label: Continuous build
|
||||
description: Please try the latest [continuous build](https://github.com/deskflow/deskflow/releases) of Deskflow. It may have a fix for your issue.
|
||||
options:
|
||||
- label: I have tried the latest continuous build and the issue persists
|
||||
- label: I am unable to try the latest continuous build
|
||||
|
||||
- type: textarea
|
||||
id: os-version
|
||||
attributes:
|
||||
label: OS versions/distros
|
||||
description: |
|
||||
Please provide the version number of your operating system (OS).
|
||||
If you're using Linux, please provide the name of the distribution.
|
||||
placeholder: |
|
||||
- Windows 11
|
||||
- macOS 15
|
||||
- Ubuntu 24.04
|
||||
- FreeBSD 14.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: config
|
||||
attributes:
|
||||
label: Deskflow configuration
|
||||
description: |
|
||||
Please provide a very brief description of your configuration.
|
||||
Let us know what OS your server and client are running.
|
||||
Let us know what OS your server and client are running, including all OS versions.
|
||||
If you're using Linux, please provide the name of the distribution.
|
||||
placeholder: |
|
||||
- Windows 11 server, macOS 15 client
|
||||
- Each computer has a single monitor
|
||||
- Windows is on the left, macOS is on the right
|
||||
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: repro-steps
|
||||
attributes:
|
||||
|
||||
13
.github/actions/install-dependencies/action.yml
vendored
@ -13,8 +13,8 @@ inputs:
|
||||
description: "The version of Qt to install (Windows & macOS)"
|
||||
required: false
|
||||
|
||||
qt-install-dir:
|
||||
description: "The path to install Qt into (Windows & macOS)"
|
||||
vcpkg-triplet:
|
||||
description: "vcpkg triplet to use (Windows)"
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
@ -57,7 +57,7 @@ runs:
|
||||
elif [ ${{ inputs.like }} == "arch" ]; then
|
||||
pacman -Syu --noconfirm base-devel cmake ninja \
|
||||
gcc openssl glib2 libxtst libxkbfile gtest libei libportal \
|
||||
qt6-base qt6-tools qt6-svg gtk3 tomlplusplus cli11 help2man
|
||||
qt6-base qt6-tools qt6-svg gtk3 tomlplusplus cli11 help2man doxygen graphviz rsync
|
||||
else
|
||||
echo "Unknown like"
|
||||
fi
|
||||
@ -72,7 +72,6 @@ runs:
|
||||
env:
|
||||
AQT_CONFIG: ${{ github.workspace }}/.github/actions/install-dependencies/aqt.ini
|
||||
with:
|
||||
dir: ${{inputs.qt-install-dir}}
|
||||
version: ${{inputs.qt-version}}
|
||||
cache: true
|
||||
cache-key-prefix: ${{matrix.target.os}}-${{inputs.qt-version}}
|
||||
@ -80,11 +79,11 @@ runs:
|
||||
- name: Build and cache vcpkg
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
id: vcpkg
|
||||
uses: sithlord48/vcpkg-action@v7
|
||||
uses: johnwason/vcpkg-action@v7
|
||||
with:
|
||||
pkgs: gtest openssl
|
||||
extra-args: --classic
|
||||
triplet: x64-windows-release
|
||||
extra-args: --classic --host-triplet=${{inputs.vcpkg-triplet}}
|
||||
triplet: ${{inputs.vcpkg-triplet}}
|
||||
token: ${{ github.token }}
|
||||
|
||||
- name: Install Wix
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: "Lint Check"
|
||||
description: "Checks for lint errors and posts a helpful comment"
|
||||
name: "Lint Clang"
|
||||
description: "Checks for Clang lint errors and posts a helpful comment"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@ -48,8 +48,10 @@ runs:
|
||||
run: |
|
||||
code_block="\`\`\`"
|
||||
|
||||
summary=$(cat<<EOF
|
||||
❌ \`clang-format\`: It looks like your changes don't match our code style.
|
||||
clang_version=$(clang-format --version | sed -n 's/^.*version //p')
|
||||
|
||||
summary=$(cat <<EOF
|
||||
❌ \`clang-format\` \`v${clang_version}\`: It looks like your changes don't match our code style.
|
||||
|
||||
🛠️ Please either run \`clang-format -i\` on the file or apply this patch with \`git apply\`:
|
||||
|
||||
@ -57,12 +59,21 @@ runs:
|
||||
$code_block diff
|
||||
${{ steps.changes.outputs.diff }}
|
||||
$code_block
|
||||
|
||||
Hint: Install the right version of \`clang-format\`, e.g.: \`pipx install --global clang-format==${clang_version}\`
|
||||
EOF
|
||||
)
|
||||
echo "$summary" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
file="ci_summary.md"
|
||||
echo "❌🛠️ \`clang-format\`: Lint errors, fix available." >> $file
|
||||
pr_comment=$(cat <<EOF
|
||||
### Lint result
|
||||
|
||||
$summary
|
||||
EOF
|
||||
)
|
||||
|
||||
file="ci-summary.md"
|
||||
echo "$pr_comment" | tee $file
|
||||
echo "file=$file" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
24
.github/actions/run-tests/action.yml
vendored
@ -16,7 +16,7 @@ runs:
|
||||
|
||||
steps:
|
||||
- name: Unit Tests
|
||||
id: unittests
|
||||
id: unit-tests
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: |
|
||||
@ -30,7 +30,7 @@ runs:
|
||||
continue-on-error: true
|
||||
|
||||
- name: Legacy Tests
|
||||
id: legacytests
|
||||
id: legacy-tests
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: |
|
||||
@ -48,12 +48,12 @@ runs:
|
||||
run: |
|
||||
pass="✅ Pass"
|
||||
fail="❌ Fail"
|
||||
unittests_outcome="${{ steps.unittests.outcome }}"
|
||||
legacytests_outcome="${{ steps.legacytests.outcome }}"
|
||||
unittests=$( [ "$unittests_outcome" = "success" ] && echo $pass || echo $fail )
|
||||
legacytests=$( [ "$legacytests_outcome" = "success" ] && echo $pass || echo $fail )
|
||||
echo "unittests=$unittests" >> $GITHUB_OUTPUT
|
||||
echo "legacytests=$legacytests" >> $GITHUB_OUTPUT
|
||||
unit_tests_outcome="${{ steps.unit-tests.outcome }}"
|
||||
legacy_tests_outcome="${{ steps.legacy-tests.outcome }}"
|
||||
unit_tests=$( [ "$unit_tests_outcome" = "success" ] && echo $pass || echo $fail )
|
||||
legacy_tests=$( [ "$legacy_tests_outcome" = "success" ] && echo $pass || echo $fail )
|
||||
echo "unit-tests=$unit_tests" >> $GITHUB_OUTPUT
|
||||
echo "legacy-tests=$legacy_tests" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- name: Summary row
|
||||
@ -63,8 +63,8 @@ runs:
|
||||
|
||||
row=""
|
||||
row+="| ${{ inputs.job }} "
|
||||
row+="| ${{ steps.results.outputs.unittests }} "
|
||||
row+="| ${{ steps.results.outputs.legacytests }} "
|
||||
row+="| ${{ steps.results.outputs.unit-tests }} "
|
||||
row+="| ${{ steps.results.outputs.legacy-tests }} "
|
||||
echo "$row" > $file
|
||||
|
||||
echo "file=$file" > $GITHUB_OUTPUT
|
||||
@ -77,8 +77,8 @@ runs:
|
||||
path: ${{ steps.row.outputs.file }}
|
||||
|
||||
- name: Check test outcome
|
||||
if: steps.unittests.outcome == 'failure'
|
||||
if: (steps.unit-tests.outcome != 'success' || steps.legacy-tests.outcome != 'success')
|
||||
run: |
|
||||
echo "Unit tests failed"
|
||||
echo "Tests failed"
|
||||
exit 1
|
||||
shell: bash
|
||||
|
||||
23
.github/actions/test-summary/action.yml
vendored
@ -28,8 +28,7 @@ runs:
|
||||
# Builds a markdown table from the row artifacts.
|
||||
|
||||
header=$(cat <<EOF
|
||||
# Test results
|
||||
| Job name | Unit tests | Integration tests |
|
||||
| OS | Unit tests | Legacy tests |
|
||||
| --- | --- | --- |
|
||||
EOF
|
||||
)
|
||||
@ -57,15 +56,25 @@ runs:
|
||||
if [ -z "$table" ]; then
|
||||
echo "No test results found" | tee $GITHUB_STEP_SUMMARY >&2
|
||||
exit 1
|
||||
else
|
||||
echo "$table" > $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
count=$(echo "$table" | awk -v RS='' '{gsub(/[^❌]/, ""); print length}')
|
||||
file="ci-summary.md"
|
||||
echo "$table" > $GITHUB_STEP_SUMMARY
|
||||
|
||||
count=$(echo "$table" | awk -v RS='' '{gsub(/[^❌]/, ""); print length}')
|
||||
|
||||
# Keep at this indentation level for heredoc.
|
||||
fail_summary=$(cat <<EOF
|
||||
### Test result
|
||||
|
||||
❌🔬 Tests failed: $count
|
||||
|
||||
$table
|
||||
EOF
|
||||
)
|
||||
|
||||
file="ci-summary.md"
|
||||
if [ $count -gt 0 ]; then
|
||||
echo "❌🔬 Tests failed: $count" | tee $file
|
||||
echo "$fail_summary" | tee $file
|
||||
echo "file=$file" >> $GITHUB_OUTPUT
|
||||
else
|
||||
# For debugging; don't send success to CI summary (reduce noise).
|
||||
|
||||
5
.github/actions/winget-publish/action.yaml
vendored
@ -21,12 +21,13 @@ runs:
|
||||
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
||||
|
||||
$packageId = "Deskflow.Deskflow"
|
||||
$installerUrl = "https://github.com/deskflow/deskflow/releases/download/v${{ inputs.release-version }}/deskflow-${{ inputs.release-version }}-win-x64.msi"
|
||||
$x64Url = "https://github.com/deskflow/deskflow/releases/download/v${{ inputs.release-version }}/deskflow-${{ inputs.release-version }}-win-x64.msi"
|
||||
$arm64Url = "https://github.com/deskflow/deskflow/releases/download/v${{ inputs.release-version }}/deskflow-${{ inputs.release-version }}-win-arm64.msi"
|
||||
|
||||
# Submit package update
|
||||
.\wingetcreate.exe update "$packageId" `
|
||||
--version "${{ inputs.release-version }}" `
|
||||
--urls "$installerUrl" `
|
||||
--urls "$x64Url|x64" "$arm64Url|arm64"`
|
||||
--submit `
|
||||
--token "${{ inputs.token }}"
|
||||
shell: pwsh
|
||||
|
||||
2
.github/workflows/ci-comment.yml
vendored
@ -76,7 +76,7 @@ jobs:
|
||||
echo "## CI Summary"
|
||||
|
||||
for file in $files; do
|
||||
echo $(cat $file)
|
||||
cat $file
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
74
.github/workflows/continuous-integration.yml
vendored
@ -34,14 +34,14 @@ jobs:
|
||||
# Always run this job, even if not on PR, since other jobs need it.
|
||||
pr-comment-flags:
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint-check
|
||||
needs: lint-clang
|
||||
|
||||
outputs:
|
||||
no-sonar: ${{ steps.check.outputs.no-sonar }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Check PR comment for flags
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
@ -77,35 +77,35 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Test summary
|
||||
uses: ./.github/actions/test-summary
|
||||
|
||||
reuse-lint:
|
||||
lint-reuse:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@v4
|
||||
uses: fsfe/reuse-action@v5
|
||||
|
||||
lint-check:
|
||||
needs: [reuse-lint]
|
||||
lint-clang:
|
||||
needs: [lint-reuse]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Lint Checker
|
||||
uses: ./.github/actions/lint-check
|
||||
uses: ./.github/actions/lint-clang
|
||||
|
||||
analyse-valgrind:
|
||||
needs: lint-check
|
||||
needs: lint-clang
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
uses: ./.github/workflows/valgrind-analysis.yml
|
||||
|
||||
@ -117,7 +117,7 @@ jobs:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
||||
main-build:
|
||||
needs: lint-check
|
||||
needs: lint-clang
|
||||
name: ${{ matrix.target.name }}
|
||||
runs-on: ${{ matrix.target.runs-on }}
|
||||
container: ${{ matrix.target.container }}
|
||||
@ -133,19 +133,29 @@ jobs:
|
||||
runs-on: "windows-2022"
|
||||
timeout: 30
|
||||
config-args: "-G Ninja"
|
||||
qt-install-dir: "C:"
|
||||
qt-version: 6.9.0
|
||||
vcpkg-triplet: x64-windows-release
|
||||
arch: "amd64"
|
||||
|
||||
- name: "windows-2022-arm64"
|
||||
runs-on: "windows-11-arm"
|
||||
timeout: 30
|
||||
config-args: "-G Ninja"
|
||||
qt-version: 6.9.1
|
||||
vcpkg-triplet: arm64-windows
|
||||
arch: "arm64"
|
||||
|
||||
- name: "macos-14-arm64"
|
||||
runs-on: "macos-14"
|
||||
timeout: 10
|
||||
config-args: "-DCMAKE_OSX_ARCHITECTURES=\"arm64\" -DCMAKE_OSX_SYSROOT=/Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
||||
qt-install-dir: "/Users/runner"
|
||||
qt-version: 6.9.1
|
||||
|
||||
- name: "macos-13-x64"
|
||||
runs-on: macos-13
|
||||
timeout: 20
|
||||
config-args: "-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" -DCMAKE_OSX_SYSROOT=/Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
||||
qt-install-dir: "/Users/runner"
|
||||
qt-version: 6.9.1
|
||||
|
||||
- name: "debian-13-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
@ -189,20 +199,6 @@ jobs:
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-40-x86_84"
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:40
|
||||
like: "fedora"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-40-arm64"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container: fedora:40
|
||||
like: "fedora"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "opensuse-x86_84"
|
||||
runs-on: ubuntu-latest
|
||||
container: opensuse/tumbleweed:latest
|
||||
@ -222,7 +218,7 @@ jobs:
|
||||
container: archlinux:latest
|
||||
like: "arch"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DEV_DOCS=ON"
|
||||
|
||||
- name: "ubuntu-25.04-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
@ -266,13 +262,16 @@ jobs:
|
||||
- name: Setup VC++ environment
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{matrix.target.arch}}
|
||||
|
||||
|
||||
- name: Install dependencies
|
||||
id: get-deps
|
||||
uses: ./.github/actions/install-dependencies
|
||||
with:
|
||||
qt-version: 6.9.0
|
||||
qt-install-dir: ${{matrix.target.qt-install-dir}}
|
||||
qt-version: ${{ matrix.target.qt-version }}
|
||||
vcpkg-triplet: ${{matrix.target.vcpkg-triplet}}
|
||||
like: ${{ matrix.target.like }}
|
||||
|
||||
- name: Get version
|
||||
@ -304,6 +303,13 @@ jobs:
|
||||
with:
|
||||
job: ${{ matrix.target.name }}
|
||||
|
||||
- name: Update Development Documentation
|
||||
if: matrix.target.like == 'arch' && github.ref == 'refs/heads/master'
|
||||
uses: JamesIves/github-pages-deploy-action@v4.7.3
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: build/doc/dev/html
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@ -312,7 +318,7 @@ jobs:
|
||||
|
||||
# Technically, "unix" is a misnomer, but we use it here to mean "Unix-like BSD-derived".
|
||||
unix:
|
||||
needs: lint-check
|
||||
needs: lint-clang
|
||||
name: unix-${{ matrix.distro.name }}
|
||||
runs-on: ${{ vars.CI_UNIX_RUNNER || 'ubuntu-24.04' }}
|
||||
timeout-minutes: 20
|
||||
@ -344,7 +350,7 @@ jobs:
|
||||
export QT_QPA_PLATFORM=offscreen
|
||||
./build/bin/unittests || true
|
||||
flatpak:
|
||||
needs: lint-check
|
||||
needs: lint-clang
|
||||
name: flatpak-${{matrix.flatpak.arch}}
|
||||
runs-on: ${{matrix.flatpak.runs-on}}
|
||||
timeout-minutes: 60
|
||||
|
||||
3
.gitignore
vendored
@ -25,6 +25,9 @@ deskflow-config.toml
|
||||
/*.user
|
||||
*.ui.autosave
|
||||
|
||||
# generated vcpkg file
|
||||
vcpkg.json
|
||||
|
||||
#Generic linux files
|
||||
**/*.directory
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2024 Deskflow Developers
|
||||
# SPDX-FileCopyrightText: 2024 - 2025 Deskflow Developers
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
@ -18,7 +18,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Fallback for when git can not be found
|
||||
set(DESKFLOW_VERSION_MAJOR 1)
|
||||
set(DESKFLOW_VERSION_MINOR 22)
|
||||
set(DESKFLOW_VERSION_MINOR 24)
|
||||
set(DESKFLOW_VERSION_PATCH 0)
|
||||
set(DESKFLOW_VERSION_TWEAK 0)
|
||||
|
||||
@ -39,7 +39,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if(GIT_TAG_COUNT EQUAL 0)
|
||||
if(${GIT_TAG_COUNT} EQUAL 0)
|
||||
set(DESKFLOW_VERSION_TWEAK "9999")
|
||||
else()
|
||||
execute_process(
|
||||
@ -48,8 +48,8 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
OUTPUT_VARIABLE GITREV
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
string(FIND ${GITREV} "v" isRev)
|
||||
if(NOT ifRev EQUAL -1)
|
||||
string(FIND "${GITREV}" "v" isRev)
|
||||
if(NOT ${isRev} EQUAL -1)
|
||||
string(REGEX MATCH [0-9]+ MAJOR ${GITREV})
|
||||
string(REGEX MATCH \\.[0-9]+ MINOR ${GITREV})
|
||||
string(REPLACE "." "" MINOR "${MINOR}")
|
||||
@ -68,6 +68,15 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#generate vcpkg file if needed
|
||||
if(WIN32)
|
||||
option (VCPKG_QT "Use Qt from VCPKG" OFF)
|
||||
if(VCPKG_QT)
|
||||
set(QT_LIBS ", \"qttranslations\", \"qtsvg\"")
|
||||
endif()
|
||||
configure_file(cmake/vcpkg.json.in ${CMAKE_SOURCE_DIR}/vcpkg.json @ONLY)
|
||||
endif()
|
||||
|
||||
#Define our project
|
||||
project(
|
||||
deskflow
|
||||
@ -144,6 +153,10 @@ endif()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||
|
||||
# disables the use of signals,slots and emit
|
||||
# Instead use Q_SIGNAL, Q_SLOT and Q_EMIT
|
||||
# prevents issues when used with glib for libportal
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
include(cmake/Libraries.cmake)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
16
README.md
@ -1,4 +1,8 @@
|
||||

|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/deskflow/deskflow-artwork/blob/main/logo/deskflow-logo-dark-200px.png?raw=true">
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://github.com/deskflow/deskflow-artwork/blob/main/logo/deskflow-logo-light-200px.png?raw=true">
|
||||
<img alt="Deskflow" src="https://github.com/user-attachments/assets/f005b958-24df-4f4a-9bfd-4f834dae59d6">
|
||||
</picture>
|
||||
|
||||
**Deskflow** is a free and open source keyboard and mouse sharing app.
|
||||
Use the keyboard, mouse, or trackpad of one computer to control nearby computers,
|
||||
@ -6,6 +10,14 @@ and work seamlessly between them.
|
||||
It's like a software KVM (but without the video).
|
||||
TLS encryption is enabled by default. Wayland is supported. Clipboard sharing is supported.
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> **Chat with us**
|
||||
>
|
||||
> - Main discussion on Matrix: [`#deskflow:matrix.org`](https://matrix.to/#/#deskflow:matrix.org) ([Matrix clients](https://matrix.org/ecosystem/clients/))
|
||||
> - Discussion also happens on IRC: `#deskflow` or `#deskflow-dev` on [Libera Chat](https://libera.chat/)
|
||||
> - Start a [new discussion](https://github.com/deskflow/deskflow/discussions) on our GitHub project.
|
||||
|
||||
## Download
|
||||
|
||||
[](https://github.com/deskflow/deskflow/releases/latest) [](https://github.com/deskflow/deskflow/releases/continuous) [](https://flathub.org/apps/org.deskflow.deskflow)
|
||||
@ -50,7 +62,7 @@ We support all major operating systems, including Windows, macOS, Linux, and Uni
|
||||
> [!NOTE]
|
||||
> On Windows, you will need to install the
|
||||
> [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version).
|
||||
> Download latest: [`vc_redist.x64.exe`](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
> Download latest: [`vc_redist.x64.exe`](https://aka.ms/vs/17/release/vc_redist.x64.exe) [`vc_redist.arm64.exe`](https://aka.ms/vs/17/release/vc_redist.arm64.exe)
|
||||
|
||||
Windows 10 or higher is required.
|
||||
|
||||
|
||||
213
REUSE.toml
@ -7,200 +7,59 @@ SPDX-PackageSupplier = "Deskflow Devs"
|
||||
SPDX-PackageDownloadLocation = "https://github.com/deskflow/deskflow"
|
||||
|
||||
[[annotations]]
|
||||
path = ".github/**"
|
||||
precedence = "override"
|
||||
path = [
|
||||
".github/**"
|
||||
, ".clang-format"
|
||||
, ".editorconfig"
|
||||
, ".gitattributes"
|
||||
, ".gitignore"
|
||||
, "cspell.json"
|
||||
, "sonar-project.properties"
|
||||
, "cmake/vcpkg.json.in"
|
||||
, "**/*.md"
|
||||
, "doc/**"
|
||||
, "deploy/linux/flatpak/**"
|
||||
, "deploy/linux/org.deskflow.deskflow.metainfo.xml"
|
||||
, "deploy/windows/wix-patch.xml.in"
|
||||
, "src/apps/deskflow-client/deskflow-client.exe.manifest"
|
||||
, "src/apps/deskflow-core/deskflow-core.exe.manifest"
|
||||
, "src/apps/deskflow-server/deskflow-server.exe.manifest"
|
||||
, "src/apps/res/manpage.txt"
|
||||
, "src/apps/res/deskflow.plist.in"
|
||||
]
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".clang-format"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".editorconfig"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".gitattributes"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".gitignore"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "cspell.json"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "**/*.md"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "sonar-project.properties"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "vcpkg.json"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "vcpkg-configuration.json"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "doc/**"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/mac/dmg-background.tiff"
|
||||
precedence = "override"
|
||||
path = [
|
||||
"deploy/mac/dmg-background.tiff"
|
||||
, "deploy/mac/dmg-volume.icns"
|
||||
, "deploy/linux/deskflow.png"
|
||||
, "deploy/windows/wix-banner.png"
|
||||
, "deploy/windows/wix-dialog.png"
|
||||
, "src/apps/res/icons/deskflow-**/apps/64/deskflow*.svg"
|
||||
, "src/apps/res/image/welcome.png"
|
||||
, "src/apps/res/Deskflow.icns"
|
||||
, "src/apps/res/deskflow.ico"
|
||||
, "src/apps/res/deskflow.qrc"
|
||||
]
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/mac/dmg-volume.icns"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/linux/deskflow.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/linux/flatpak/**"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/linux/org.deskflow.deskflow.metainfo.xml"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/windows/wix-banner.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/windows/wix-dialog.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/windows/wix-patch.xml.in"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-client/deskflow-client.exe.manifest"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-core/deskflow-core.exe.manifest"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-server/deskflow-server.exe.manifest"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/manpage.txt"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/icons/deskflow-**/**/**/**.svg"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Kde Breeze Icons"
|
||||
SPDX-License-Identifier = "LGPL-2.1-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/icons/deskflow-**/apps/64/deskflow*.svg"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/image/welcome.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/Deskflow.icns"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/deskflow.ico"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/deskflow.plist.in"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/deskflow.qrc"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/icons/deskflow-**/index.theme"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Chris Rizzitello <sithlord48@gmail.com>"
|
||||
SPDX-License-Identifier = "LGPL-2.1-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/lib/gui/MainWindow.ui"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only WITH LicenseRef-OpenSSL-Exception"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/lib/gui/dialogs/*.ui"
|
||||
precedence = "override"
|
||||
path = [
|
||||
"src/lib/gui/MainWindow.ui"
|
||||
, "src/lib/gui/dialogs/*.ui"
|
||||
]
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only WITH LicenseRef-OpenSSL-Exception"
|
||||
|
||||
@ -26,13 +26,21 @@ macro(configure_libs)
|
||||
|
||||
# Define the location of Qt deployment tool
|
||||
if(WIN32)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT VCPKG_INSTALL_DIR STREQUAL "")
|
||||
find_program(DEPLOYQT windeployqt.debug.bat)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND VCPKG_QT)
|
||||
set(DEPLOY_TOOL windeployqt.debug.bat)
|
||||
else()
|
||||
find_program(DEPLOYQT windeployqt)
|
||||
set(DEPLOY_TOOL windeployqt)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
find_program(DEPLOYQT macdeployqt)
|
||||
set(DEPLOY_TOOL macdeployqt)
|
||||
endif()
|
||||
|
||||
if (WIN32 OR APPLE)
|
||||
find_program(DEPLOYQT ${DEPLOY_TOOL})
|
||||
if(DEPLOYQT STREQUAL "DEPLOYQT-NOTFOUND")
|
||||
message(FATAL_ERROR "Unable to locate the Qt Deploy Tool: \"${DEPLOY_TOOL}\"")
|
||||
endif()
|
||||
unset(DEPLOY_TOOL)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
@ -82,12 +90,17 @@ macro(configure_unix_libs)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
|
||||
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
|
||||
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
if (NOT HAVE_SYS_SOCKET_H)
|
||||
message(FATAL_ERROR "Missing header: sys/socket.h")
|
||||
endif()
|
||||
|
||||
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
if (NOT HAVE_UNISTD_H)
|
||||
message(FATAL_ERROR "Missing unistd.h")
|
||||
endif()
|
||||
|
||||
check_function_exists(nanosleep HAVE_NANOSLEEP)
|
||||
check_function_exists(sigwait HAVE_POSIX_SIGWAIT)
|
||||
check_function_exists(inet_aton HAVE_INET_ATON)
|
||||
|
||||
@ -149,20 +162,13 @@ macro(configure_unix_libs)
|
||||
find_library(LIBM m)
|
||||
include_directories(${LIBXKBCOMMON_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS}
|
||||
${LIBM_INCLUDE_DIRS})
|
||||
|
||||
message(STATUS "xkbcommon version: ${LIBXKBCOMMON_VERSION}")
|
||||
else()
|
||||
message(WARNING "pkg-config not found, skipping wayland libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For config.h, set some static values; it may be a good idea to make these
|
||||
# values dynamic for non-standard UNIX compilers.
|
||||
set(HAVE_PTHREAD_SIGNAL 1)
|
||||
set(SELECT_TYPE_ARG1 int)
|
||||
set(SELECT_TYPE_ARG234 " (fd_set *)")
|
||||
set(SELECT_TYPE_ARG5 " (struct timeval *)")
|
||||
set(TIME_WITH_SYS_TIME 1)
|
||||
set(HAVE_SOCKLEN_T 1)
|
||||
|
||||
# Unix only: For config.h, save the results based on a template (config.h.in).
|
||||
# Note that this won't work on Windows because filenames are not case sensitive,
|
||||
# and we have header files named "Config.h" (upper case 'C').
|
||||
@ -196,11 +202,6 @@ macro(configure_xorg_libs)
|
||||
check_include_files("${XKBlib}" HAVE_X11_XKBLIB_H)
|
||||
check_include_files("X11/extensions/XInput2.h" HAVE_XI2)
|
||||
|
||||
if(HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
# Assume that function prototypes declared, when include exists.
|
||||
set(HAVE_DPMS_PROTOTYPES 1)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_X11_XKBLIB_H)
|
||||
message(FATAL_ERROR "Missing header: " ${XKBlib})
|
||||
endif()
|
||||
|
||||
12
cmake/vcpkg.json.in
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"$comment": "Generated file do not hand edit",
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
||||
"name": "deskflow",
|
||||
"version": "@DESKFLOW_VERSION_MAJOR@.@DESKFLOW_VERSION_MINOR@.@DESKFLOW_VERSION_PATCH@.@DESKFLOW_VERSION_TWEAK@",
|
||||
"builtin-baseline": "d5ec528843d29e3a52d745a64b469f810b2cedbf",
|
||||
"dependencies": [
|
||||
"gtest",
|
||||
"openssl"
|
||||
@QT_LIBS@
|
||||
]
|
||||
}
|
||||
@ -38,6 +38,7 @@
|
||||
"Kitware",
|
||||
"Kutytska",
|
||||
"Lanz",
|
||||
"legacytests",
|
||||
"libei",
|
||||
"Libera",
|
||||
"libportal",
|
||||
@ -45,6 +46,7 @@
|
||||
"logonui",
|
||||
"Lysytsia",
|
||||
"macdeployqt",
|
||||
"mojibake",
|
||||
"msvc",
|
||||
"noquote",
|
||||
"NOSONAR",
|
||||
@ -91,7 +93,9 @@
|
||||
"Volker",
|
||||
"whot",
|
||||
"winget",
|
||||
"wismill",
|
||||
"writef",
|
||||
"xkbcommon",
|
||||
"XWINDOWS"
|
||||
],
|
||||
"ignoreWords": [],
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<component type="desktop-application">
|
||||
<id>org.deskflow.deskflow</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0+</project_license>
|
||||
<project_license>GPL-2.0-only</project_license>
|
||||
<name>Deskflow</name>
|
||||
<developer id="org.deskflow">
|
||||
<name>Deskflow Developers</name>
|
||||
@ -16,14 +16,34 @@
|
||||
<launchable type="desktop-id">org.deskflow.deskflow.desktop</launchable>
|
||||
<url type="homepage">https://deskflow.org</url>
|
||||
<url type="bugtracker">https://github.com/deskflow/deskflow/issues</url>
|
||||
<url type="faq">https://github.com/deskflow/deskflow/wiki/Project-FAQ</url>
|
||||
<url type="help">https://github.com/deskflow/deskflow/wiki#user-guides</url>
|
||||
<url type="vcs-browser">https://github.com/deskflow/deskflow</url>
|
||||
<url type="contribute">https://github.com/deskflow/deskflow/wiki/Contributing</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://deskflow.org/screenshots/deskflow.png</image>
|
||||
<caption>Deskflow's mainwindow on KDE</caption>
|
||||
<image>https://deskflow.org/screenshots/deskflow-client.png</image>
|
||||
<caption>Deskflow in client mode on KDE</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://deskflow.org/screenshots/deskflow-dark.png</image>
|
||||
<caption>Deskflow's mainwindow on KDE (dark mode)</caption>
|
||||
<image>https://deskflow.org/screenshots/deskflow-server.png</image>
|
||||
<caption>Deskflow in server mode on KDE</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://deskflow.org/screenshots/deskflow-log.png</image>
|
||||
<caption>Deskflow with the log visible on KDE</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://deskflow.org/screenshots/deskflow-client-dark.png</image>
|
||||
<caption>Deskflow in client mode on KDE (dark mode)</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://deskflow.org/screenshots/deskflow-server-dark.png</image>
|
||||
<caption>Deskflow in server mode on KDE (dark mode)</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://deskflow.org/screenshots/deskflow-log-dark.png</image>
|
||||
<caption>Deskflow with the log visible on KDE (dark mode)</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<provides> <id>org.deskflow.deskflow.desktop</id> </provides>
|
||||
@ -42,6 +62,48 @@
|
||||
</branding>
|
||||
<content_rating type="oars-1.0" />
|
||||
<releases>
|
||||
<release version="1.24.0" date="2025-09-11" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes issues found in the previous version and adds a few new features. This release also uses more C++20 features. For the full changelog, see the release page.</p>
|
||||
<ul>
|
||||
<li>Fix: Less confusing fingerprint comparision dialog.</li>
|
||||
<li>Fix: AltGr and other modifiers are generally detected better.</li>
|
||||
<li>Fix: Big Endian test failures</li>
|
||||
<li>Fix: Client scroll direction being ignored on wayland clients.</li>
|
||||
<li>Feat: Unify deskflow-client and deskflow-server into one binary deskflow-core.</li>
|
||||
<li>Feat: Prevent more than one instance of deskflow-core starting.</li>
|
||||
<li>Feat: Remove defunct --no-xinitthreads option.</li>
|
||||
<li>Feat: Ability to persist remote desktop access</li>
|
||||
<li>Feat: Gui can show all log levels, upgrading users will want to reset their log level as the values have changed</li>
|
||||
<li>Feat: Log can be detached or docked in the window</li>
|
||||
<li>Refactor: Use more icons in places</li>
|
||||
<li>Refactor: Update the Server Config Dialog's GUI</li>
|
||||
<li>Chore: Continue to update codebase to use C++20 features.</li>
|
||||
<li>Chore: Clean more sonar smells</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.24.0</url>
|
||||
</release>
|
||||
<release version="1.23.0" date="2025-07-23" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes issues found in the previous version and adds a few new features. This release also uses more C++20 features. For the full changelog, see the release page.</p>
|
||||
<ul>
|
||||
<li>Fix: Core app not running when app starts minimized.</li>
|
||||
<li>Fix: Several items in the server configuration dialog being enabled at the wrong time.</li>
|
||||
<li>Fix: Use the correct license in our appstream data (GPL2.0 only).</li>
|
||||
<li>Fix: Apps saved size could grow over time on desktops using client side decorations.</li>
|
||||
<li>Fix: Use the system monospace font in the log area, instead of forcing one that may not be on the system.</li>
|
||||
<li>Fix: Issue with incorrect borders being set for libEI, causing issues on edges without neighbors.</li>
|
||||
<li>Feat: Add Restart action for the core process.</li>
|
||||
<li>Feat: Remove defunct --no-xinitthreads option.</li>
|
||||
<li>Feat: Make 2048 the minimum encryption key size.</li>
|
||||
<li>Feat: Provide additional connection information in the status area.</li>
|
||||
<li>Chore: Continue to update codebase to use C++20 features.</li>
|
||||
<li>Chore: Clean more sonar smells</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.23.0</url>
|
||||
</release>
|
||||
<release version="1.22.0" date="2025-05-28" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes a issues found in the previous version. For the full changelog see the release page.</p>
|
||||
@ -65,7 +127,7 @@
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.22.0</url>
|
||||
</release>/
|
||||
</release>
|
||||
<release version="1.21.2" date="2025-04-07" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes a few critical bugs in 1.21.1. For the full changelog see the release page.</p>
|
||||
|
||||
@ -9,10 +9,6 @@ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
install(CODE "execute_process(
|
||||
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\"
|
||||
)")
|
||||
|
||||
configure_file(${MY_DIR}/pre-cpack.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pre-cpack.cmake @ONLY)
|
||||
set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/pre-cpack.cmake)
|
||||
|
||||
@ -27,6 +23,7 @@ list(APPEND CPACK_GENERATOR "7Z")
|
||||
find_program(WIX_APP wix)
|
||||
if (NOT "${WIX_APP}" STREQUAL "")
|
||||
set(CPACK_WIX_VERSION 4)
|
||||
set(CPACK_WIX_ARCHITECTURE ${BUILD_ARCHITECTURE})
|
||||
list(APPEND CPACK_GENERATOR "WIX")
|
||||
endif()
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 47 KiB |
@ -17,14 +17,12 @@
|
||||
/>
|
||||
</ServiceInstall>
|
||||
<ServiceControl Id="ServiceControl" Name="Deskflow" Remove="uninstall" Start="install" Stop="both"/>
|
||||
<RemoveFile Id="RmOldLog" On="install" Name="deskflow-daemon.log"/>
|
||||
</CPackWiXFragment>
|
||||
|
||||
<CPackWiXFragment Id="CM_CP_deskflow_server.exe">
|
||||
<firewall:FirewallException Id="ServerFirewallException" Name="Deskflow Server" Program="[INSTALL_ROOT]deskflow-server.exe" Scope="any"/>
|
||||
</CPackWiXFragment>
|
||||
|
||||
<CPackWiXFragment Id="CM_CP_deskflow_client.exe">
|
||||
<firewall:FirewallException Id="ClientFirewallException" Name="Deskflow Client" Program="[INSTALL_ROOT]deskflow-client.exe" Scope="any"/>
|
||||
<CPackWiXFragment Id="CM_CP_deskflow_core.exe">
|
||||
<firewall:FirewallException Id="ServerFirewallException" Name="Deskflow Server" Program="[INSTALL_ROOT]deskflow-core.exe" Scope="any"/>
|
||||
<firewall:FirewallException Id="ClientFirewallException" Name="Deskflow Client" Program="[INSTALL_ROOT]deskflow-core.exe" Scope="any"/>
|
||||
</CPackWiXFragment>
|
||||
|
||||
<CPackWiXFragment Id="#PRODUCT">
|
||||
@ -44,7 +42,9 @@
|
||||
Control="Finish"
|
||||
Event="DoAction"
|
||||
Value="RunDeskflow"
|
||||
Condition= "NOT Installed" />
|
||||
Condition= "WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed" />
|
||||
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
|
||||
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Run Deskflow when finished" />
|
||||
</UI>
|
||||
<CustomAction
|
||||
Id="CheckVCRedist"
|
||||
|
||||
@ -1,31 +1,24 @@
|
||||
# SPDX-FileCopyrightText: 2019 - 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2019 - 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
find_package(Doxygen QUIET)
|
||||
option(BUILD_DOCS "Build and install documents" ${DOXYGEN_FOUND})
|
||||
|
||||
if (BUILD_DOCS AND DOXYGEN_FOUND)
|
||||
option(BUILD_USER_DOCS "Build and install user documentation" ${DOXYGEN_FOUND})
|
||||
option(BUILD_DEV_DOCS "Build and install developer documentation" OFF)
|
||||
|
||||
if (DOXYGEN_FOUND)
|
||||
# Generic Doxygen options
|
||||
set(DOXYGEN_EXTRACT_ALL YES)
|
||||
set(DOXYGEN_EXTRACT_STATIC YES)
|
||||
set(DOXYGEN_STRIP_FROM_PATH ${CMAKE_SOURCE_DIR})
|
||||
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE mainpage.md)
|
||||
set(DOXYGEN_QUIET YES)
|
||||
set(DOXYGEN_PROJECT_NAME ${CMAKE_PROJECT_PROPER_NAME})
|
||||
|
||||
# Files used to make our documents
|
||||
# User facing documents will not include doxy comments in source code
|
||||
doxygen_add_docs(user-docs ${CMAKE_SOURCE_DIR}/doc COMMENT "Generating user documentation" ALL)
|
||||
|
||||
# HACK Only these will show in your IDE
|
||||
target_sources(user-docs PRIVATE
|
||||
mainpage.md
|
||||
configuration.md
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html"
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
COMPONENT deskflow_docs)
|
||||
|
||||
if (BUILD_USER_DOCS)
|
||||
add_subdirectory(user)
|
||||
endif()
|
||||
if (BUILD_DEV_DOCS)
|
||||
add_subdirectory(dev)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Doxygen not found, skipping docs build")
|
||||
endif()
|
||||
|
||||
@ -1,201 +0,0 @@
|
||||
# GUI Config
|
||||
|
||||
Deskflow will automaticlly figure out where to save settings and other files.
|
||||
|
||||
|
||||
## Unix Systems
|
||||
The search order for a setting file is:
|
||||
1. `<XDG_CONFIG_HOME>/Deskflow/Deskflow.conf`
|
||||
1. A user settings file
|
||||
1. A system settings file
|
||||
|
||||
A new settings file will be created in the user path if no settings file is found.
|
||||
The path of the settings file will be used as the base for all other config files.
|
||||
|
||||
### Linux
|
||||
- System: `/etc/Deskflow/Deskflow.conf`
|
||||
- User: `~/.config/Deskflow/Deskflow.conf`
|
||||
|
||||
### macOS
|
||||
- System: `/Library/Deskflow/Deskflow.conf`
|
||||
- User: `~/Library/Deskflow/Deskflow.conf`
|
||||
|
||||
|
||||
## Windows
|
||||
|
||||
The search order for a setting file is:
|
||||
1. `<install-path>/settings/Deskflow.conf`
|
||||
1. Windows Registry `HKCU\Software\Deskflow\Deskflow`
|
||||
|
||||
Windows will save to the install dir if settings are loaded from there. If not, it saves any other config files in: `C:\ProgramData\Deskflow\`
|
||||
|
||||
When using settings from the install dir, the service mode will not be available.
|
||||
|
||||
# Server Config Examples
|
||||
|
||||
The `deskflow-server` command accepts the `-c` or `--config` option, which takes one argument,
|
||||
the path to a server configuration file. The format is non-standard but similar to YAML.
|
||||
|
||||
Comments begin with the `#` character and continue to the end of line.
|
||||
Comments may appear anywhere the syntax permits.
|
||||
|
||||
Each `section` element must have a matching `end` element.
|
||||
|
||||
## Stacked Example
|
||||
|
||||
Stack one computer's screen on top of another's.
|
||||
|
||||
```
|
||||
# +-------+
|
||||
# | curly |
|
||||
# | |
|
||||
# +-------+
|
||||
# +-------+ +-------+
|
||||
# | moe | | larry |
|
||||
# | | | |
|
||||
# +-------+ +-------+
|
||||
|
||||
section: screens
|
||||
# three hosts named: moe, larry, and curly
|
||||
moe:
|
||||
larry:
|
||||
curly:
|
||||
end
|
||||
|
||||
section: links
|
||||
# larry is to the right of moe and curly is above moe.
|
||||
moe:
|
||||
right = larry
|
||||
up = curly
|
||||
|
||||
# moe is to the left of larry and curly is above larry.
|
||||
larry:
|
||||
left = moe
|
||||
up = curly
|
||||
|
||||
# larry is below curly.
|
||||
curly:
|
||||
down = larry
|
||||
end
|
||||
|
||||
section: aliases
|
||||
# curly is also known as shemp
|
||||
curly:
|
||||
shemp
|
||||
end
|
||||
```
|
||||
|
||||
## Horizontal Example
|
||||
|
||||
Align all screens horizontally.
|
||||
|
||||
```
|
||||
# +-------+ +-------+ +-------+
|
||||
# | moe | | larry | | curly |
|
||||
# | | | | | |
|
||||
# +-------+ +-------+ +-------+
|
||||
|
||||
section: screens
|
||||
# three hosts named: moe, larry, and curly
|
||||
moe:
|
||||
larry:
|
||||
curly:
|
||||
end
|
||||
|
||||
section: links
|
||||
# curly is to the right of larry and moe is to the left of larry.
|
||||
larry:
|
||||
right = curly
|
||||
left = moe
|
||||
|
||||
# larry is to the right of moe.
|
||||
moe:
|
||||
right = larry
|
||||
|
||||
# larry is to the left of curly.
|
||||
curly:
|
||||
left = larry
|
||||
end
|
||||
|
||||
```
|
||||
|
||||
## Span Example
|
||||
|
||||
Span two screens on one computer across the screens of two computers.
|
||||
|
||||
```
|
||||
# +-------+ +-------+
|
||||
# | curly | | curly |
|
||||
# | | | |
|
||||
# +-------+ +-------+
|
||||
# +-------+ +-------+
|
||||
# | moe | | larry |
|
||||
# | | | |
|
||||
# +-------+ +-------+
|
||||
|
||||
section: screens
|
||||
# three hosts named: moe, larry, and curly
|
||||
moe:
|
||||
larry:
|
||||
curly:
|
||||
end
|
||||
|
||||
section: links
|
||||
# larry is to the right of moe and curly is above moe.
|
||||
moe:
|
||||
right = larry
|
||||
up = curly
|
||||
|
||||
# moe is to the left of larry and curly is above larry.
|
||||
larry:
|
||||
left = moe
|
||||
up = curly
|
||||
|
||||
# larry is below curly.
|
||||
curly:
|
||||
down = larry
|
||||
end
|
||||
```
|
||||
|
||||
# Example file for `--config-toml` arg
|
||||
|
||||
```
|
||||
[server.args]
|
||||
no-daemon = true
|
||||
no-tray = true
|
||||
debug = "DEBUG"
|
||||
name = "moe"
|
||||
address = ":24800"
|
||||
|
||||
[client.args]
|
||||
no-daemon = true
|
||||
no-tray = true
|
||||
debug = "DEBUG2"
|
||||
name = "larry"
|
||||
_last = "moe:24800"
|
||||
```
|
||||
|
||||
|
||||
# Example `.env` file
|
||||
|
||||
|
||||
```
|
||||
#
|
||||
# App
|
||||
#
|
||||
|
||||
# Shows the test menu in the GUI (on by default in debug mode)
|
||||
# DESKFLOW_TEST_MENU=true
|
||||
|
||||
# Version checker URL to use (useful for testing)
|
||||
# DESKFLOW_VERSION_URL="https://api.deskflow.org/version?fake=1.100.0"
|
||||
|
||||
# Enable debug logging in the GUI (on by default in debug mode)
|
||||
# DESKFLOW_GUI_DEBUG=true
|
||||
|
||||
# Enable verbose logging in the GUI (always off by default)
|
||||
# DESKFLOW_GUI_VERBOSE=true
|
||||
|
||||
# Reset all settings and delete all data on startup
|
||||
# DESKFLOW_RESET_ALL=true
|
||||
```
|
||||
22
doc/dev/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
||||
# SPDX-FileCopyrightText: 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE mainpage.md)
|
||||
set(DOXYGEN_EXCLUDE_PATTERNS "*unittests/*")
|
||||
set(DOXYGEN_DOT_GRAPH_MAX_NODES 100)
|
||||
|
||||
# Files used to make our documents
|
||||
doxygen_add_docs(dev-docs
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
COMMENT "Generating developer documentation" ALL)
|
||||
|
||||
# HACK Only these will show in your IDE
|
||||
target_sources(dev-docs PRIVATE
|
||||
mainpage.md
|
||||
contributing.md
|
||||
build.md
|
||||
protocol_reference.md
|
||||
)
|
||||
|
||||
# missing install target is intended generate a local copy
|
||||
82
doc/dev/build.md
Normal file
@ -0,0 +1,82 @@
|
||||
# Building Deskflow
|
||||
|
||||
To build Deskflow you will a minimum of:
|
||||
- [cmake] 3.24+
|
||||
- [Qt] 6.7.0+
|
||||
- [openssl] 3.0+
|
||||
- [libportal] 0.8+ (linux, bsd)
|
||||
- [libei] 1.3+ (linux, bsd)
|
||||
- [google_test] ^
|
||||
- [tomlplusplus] ^
|
||||
- [cli11] ^
|
||||
|
||||
> ^ Will be fetched if not found on the host system.
|
||||
|
||||
By default a build of Deskflow will:
|
||||
- The GUI application deskflow
|
||||
- The Core application deskflow-core
|
||||
- Documentation if [doxygen] was found on your system
|
||||
- Tests that will be run as part of the build process.
|
||||
|
||||
## Configuration
|
||||
Deskflow supports the following build options
|
||||
|
||||
CMake options:
|
||||
| Option | Description | Default Value | Additional requirements |
|
||||
:-------------------------:|:---------------------------------------:|:------------------:|:-----------------------:|
|
||||
| BUILD_GUI | Build GUI | ON | |
|
||||
| BUILD_USER_DOCS | Build user documentation | DOXYGEN_FOUND | `Doxygen` |
|
||||
| BUILD_DEV_DOCS | Build development documentation | OFF | `Doxygen` |
|
||||
| BUILD_INSTALLER | Build installers/packages | ON | |
|
||||
| BUILD_TESTS | Build unit tests and legacy tests | ON | `gtest`|
|
||||
| ENABLE_COVERAGE | Enable test coverage | OFF | `gcov` |
|
||||
| SKIP_BUILD_TESTS | Skip running of tests at build time | OFF | |
|
||||
| VCPKG_QT | Build Qt w/ vcpkg (windows only) | OFF | |
|
||||
|
||||
Example cmake configuration.
|
||||
`cmake -S. -Bbuild -DCMAKE_INSTALL_PREFIX=<INSTALLPREFIX>`
|
||||
|
||||
### Windows Configuration
|
||||
It is recommended to use vcpkg to install the dependencies. The first time you configure Deskflow, all dependencies other than Qt will be built. If you don't want to use vcpkg, you must manually setup the dependencies. However, that will not be covered by this document.
|
||||
|
||||
#### Windows and Qt
|
||||
There are two ways you can install [Qt] on Windows (vcpkg or Qt online installer). The default configuration expects you to use the Qt online installer. You should not install Qt in both ways, as having both can cause some weird things to happen, like Qt getting libs from one install and plugins from the other. When switching between them, remove the previous install first.
|
||||
|
||||
##### System Qt
|
||||
|
||||
1. Download and install the [Qt] online installer from their website.
|
||||
2. Add the path of Qt's cmake files to your system path. (Skipping this may require you provide this path to cmake via `Qt6_DIR` at configure time)
|
||||
- Often `C:\Qt\<version>\<msvcinfo>\lib\cmake`
|
||||
3. Add the path of Qt's binary tools to your system path.
|
||||
- Often `C:\Qt\<version>\<msvcinfo>\bin`
|
||||
|
||||
##### Vcpkg managed Qt
|
||||
1. Add the option `-DVCPKG_QT=ON` to your cmake configuration command (i.e `cmake -S. -Bbuild -DVCPKG_QT=ON ...`) or if using an IDE, look for the option where you configure the project, have the IDE run cmake again.
|
||||
2. Once the configuration starts, you should see a lot more packages vcpkg will build. Building Qt takes a long time (potentially hours), so go find something else to do for a while.
|
||||
3. If you want to use the system Qt again, you must delete the `vcpkg.json` generated in the project root and the `build` folder and reconfigure the project from scratch.
|
||||
|
||||
## Build
|
||||
After configuring you should be able to run make to build all targets.
|
||||
|
||||
`cmake --build build`
|
||||
|
||||
## Install
|
||||
To test installation run `DESTDIR=<installDIR> cmake --install build` to install into `<installDir>/<CMAKE_INSTALL_PREFIX>` <br>
|
||||
Running `cmake --install build` will install to the `CMAKE_INSTALL_PREFIX`
|
||||
|
||||
## Making Deskflow packages
|
||||
Deskflow can generate several packages using cpack.
|
||||
To generate packages build the `package` or `package_source` target.
|
||||
Example: ` cmake --build build --target package package_source` would generate both package and package source packages.
|
||||
Deskflow can generate several package types depending on the system. Archive-based packages should work on all platforms. On Linux deb and rpm info is set up, flatpaks can be generated from the included file in deploy/linux and a PKGBUILD for Arch linux is generated in the build folder. On macos a dmg file will be created and signed. For windows wix can be used to create an installer.
|
||||
|
||||
|
||||
[Qt]:https://www.qt.io
|
||||
[doxygen]:http://www.stack.nl/~dimitri/doxygen/
|
||||
[cmake]:https://cmake.org/
|
||||
[openssl]:https://www.openssl.org/
|
||||
[google_test]:https://github.com/google/googletest
|
||||
[tomlplusplus]:https://github.com/marzer/tomlplusplus
|
||||
[cli11]:https://github.com/CLIUtils/CLI11
|
||||
[libei]:https://gitlab.freedesktop.org/libinput/libei
|
||||
[libportal]:https://github.com/flatpak/libportal
|
||||
13
doc/dev/contributing.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Contributing to Deskflow {#contributing_guide}
|
||||
|
||||
Thanks for your interest in contributing to Deskflow! We welcome all kinds of contributions — bug reports, feature suggestions, documentation improvements, and code.
|
||||
|
||||
## Read the Full Guidelines
|
||||
|
||||
To keep this repository clean and contribution-friendly, we've outlined our full contributing guidelines on the Deskflow Wiki:
|
||||
|
||||
👉 [How to Contribute to Deskflow](https://github.com/deskflow/deskflow/wiki/Contributing)
|
||||
|
||||
Please take a moment to read through the page before opening an issue or submitting a pull request.
|
||||
|
||||
Thanks again for helping make Deskflow better!
|
||||
55
doc/dev/mainpage.md
Normal file
@ -0,0 +1,55 @@
|
||||
**Deskflow** is a free and open source keyboard and mouse sharing app.
|
||||
Use the keyboard, mouse, or trackpad of one computer to control nearby computers,
|
||||
and work seamlessly between them.
|
||||
|
||||
Deskflow acts as a software KVM (without video) that allows you to:
|
||||
- Share keyboard and mouse input across multiple computers
|
||||
- Synchronize clipboard content between machines
|
||||
- Work seamlessly across different operating systems (Windows, macOS, Linux, BSD)
|
||||
|
||||
Deskflow software consists of a **server** (primary computer) that shares its input devices and **clients** (secondary computers) that receive and execute the input commands over a TCP network connection.
|
||||
|
||||
### Architecture Overview
|
||||
|
||||
Deskflow is built with a modular, cross-platform architecture:
|
||||
|
||||
```
|
||||
┌─────────────────┐ Network Protocol ┌─────────────────┐
|
||||
│ Server App │◄──────────────────────►│ Client App │
|
||||
│ │ (Port 24800) │ (Windows) │
|
||||
│ ┌─────────────┐ │ │ ┌─────────────┐ │
|
||||
│ │ Screen │ │ │ │ Screen │ │
|
||||
│ │ Platform │ │ │ │ Platform │ │
|
||||
│ │ Layer │ │ │ │ Layer │ │
|
||||
│ └─────────────┘ │ │ └─────────────┘ │
|
||||
└─────────────────┘ └─────────────────┘
|
||||
┌───────┐ ┌───────┐
|
||||
│ Keyb. │ │ Mouse │
|
||||
└───────┘ └───────┘
|
||||
|
||||
┌─────────────────┐
|
||||
│ Client App │
|
||||
│ (macOS) │
|
||||
│ ┌─────────────┐ │
|
||||
│ │ Screen │ │
|
||||
│ │ Platform │ │
|
||||
│ │ Layer │ │
|
||||
│ └─────────────┘ │
|
||||
└─────────────────┘
|
||||
|
||||
┌─────────────────┐
|
||||
│ Client App │
|
||||
│ (Custom) │
|
||||
│ ┌─────────────┐ │
|
||||
│ │ Screen │ │
|
||||
│ │ Platform │ │
|
||||
│ │ Layer │ │
|
||||
│ └─────────────┘ │
|
||||
└─────────────────┘
|
||||
```
|
||||
|
||||
### More info
|
||||
|
||||
For more info, see our [Wiki](https://github.com/deskflow/deskflow/wiki).
|
||||
|
||||
Check out our [Building guide](build.md) or our general @ref contributing_guide "Contributing section". We also have a detailed [Protocol Reference](protocol_reference.md).
|
||||
532
doc/dev/protocol_reference.md
Normal file
@ -0,0 +1,532 @@
|
||||
# Protocol Reference {#protocol_reference}
|
||||
|
||||
This document provides a comprehensive reference for the Deskflow network protocol. It is the primary source of information for developers implementing Deskflow clients or extending the protocol.
|
||||
|
||||
## Protocol Overview
|
||||
|
||||
The Deskflow protocol enables keyboard and mouse sharing between multiple computers over a TCP network connection. The protocol uses two distinct sets of terminology to describe the roles of the computers involved:
|
||||
|
||||
- **Network Role (Client/Server)**: This describes the connection architecture.
|
||||
- **Server**: The machine that listens for incoming TCP connections.
|
||||
- **Client**: The machine that initiates the TCP connection to the server.
|
||||
|
||||
- **Input Control Role (Primary/Secondary)**: This describes the flow of keyboard and mouse events.
|
||||
- **Primary**: The computer whose keyboard and mouse are currently being used to control other computers.
|
||||
- **Secondary**: A computer that is being controlled by the Primary's keyboard and mouse.
|
||||
|
||||
In a typical setup, the Primary computer (the one whose keyboard and mouse are shared) also acts as the Server. However, the protocol is flexible and allows these roles to be separate. For example, a Primary machine can act as a Client to connect to a Secondary machine that is configured as a Server. This can be useful for navigating restrictive network environments like firewalls.
|
||||
|
||||
Throughout the documentation, message direction is often described using the Primary/Secondary roles to clarify the input control flow, while Client/Server roles are used when discussing the underlying network connection.
|
||||
|
||||
### Key Implementation Files
|
||||
|
||||
- **[ProtocolTypes.h](@ref ProtocolTypes.h)** – Complete protocol specification
|
||||
- **[ProtocolUtil.h](@ref ProtocolUtil.h)** – Message formatting utilities
|
||||
- **[ClientInfo](@ref ClientInfo)** – Screen information structure
|
||||
|
||||
The protocol is designed to be:
|
||||
- Lightweight and efficient
|
||||
- Cross-platform compatible
|
||||
- Extensible for new features
|
||||
- Backward compatible with older versions
|
||||
|
||||
## Protocol Architecture
|
||||
|
||||
|
||||
```
|
||||
┌─────────────────┐ TCP/IP Network ┌─────────────────┐
|
||||
│ Primary │◄────────────────────►│ Secondary │
|
||||
│ (Server) │ Port 24800 │ (Client) │
|
||||
│ │ │ │
|
||||
│ • Shares input │ │ • Receives input│
|
||||
│ • Manages layout│ │ • Reports info │
|
||||
│ • Coordinates │ │ • Executes cmds │
|
||||
└─────────────────┘ └─────────────────┘
|
||||
```
|
||||
|
||||
The protocol operates over a standard TCP connection on port 24800. In protocol versions 1.4 and later, TLS encryption is supported for secure communications.
|
||||
|
||||
## Protocol State Machine
|
||||
|
||||
The client's connection lifecycle is defined by five primary states:
|
||||
|
||||
|
||||
```
|
||||
┌──────────────────┐
|
||||
│ START │
|
||||
└────────┬─────────┘
|
||||
│
|
||||
▼
|
||||
┌────────┴─────────┐
|
||||
│ DISCONNECTED │
|
||||
│ (Initial & │◄───────────────────┐
|
||||
│ Final State) │ │
|
||||
└────────┬─────────┘ │
|
||||
│ │
|
||||
▼ │
|
||||
┌──────────────────┐ │
|
||||
│ CONNECTING │ TCP Failure │
|
||||
│ (TCP handshake) ├───────────────────►┤
|
||||
└────────┬─────────┘ │
|
||||
│ │
|
||||
TCP Success │ │
|
||||
│ │
|
||||
▼ │
|
||||
┌──────────────────┐ │
|
||||
│ HANDSHAKE │ Version Mismatch │
|
||||
│ (Hello/HelloBk) ├───────────────────►┤
|
||||
└────────┬─────────┘ │
|
||||
│ │
|
||||
OK │ │
|
||||
│ │
|
||||
▼ │
|
||||
┌──────────────────┐ │
|
||||
│ CONNECTED │ CCLOSE (close) │
|
||||
┌───►│ (Authenticated ├───────────────────►┤
|
||||
│ │ but inactive) │ │
|
||||
│ └────────┬─────────┘ │
|
||||
│ │ │
|
||||
COUT │ CINN │ │
|
||||
(Leave) │ (Enter)│ │
|
||||
│ ▼ │
|
||||
│ ┌──────────────────┐ │
|
||||
└────┤ ACTIVE │ CCLOSE (close) │
|
||||
│ (Receiving all ├───────────────────►┘
|
||||
┌───►│ input events) │
|
||||
│ └────────┬─────────┘
|
||||
│ │
|
||||
│ ▼
|
||||
│ ┌──────────────────┐
|
||||
└────┤ PROCESS EVENT │
|
||||
└──────────────────┘
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
### State Descriptions
|
||||
|
||||
1. **Disconnected**: Initial and final state. No connection to @ref Server.
|
||||
2. **Connecting**: @ref TCPSocket connection attempt in progress.
|
||||
- Initiating @ref TCPSocket connection.
|
||||
- On successful TCP connection, moves to the `Handshake` state.
|
||||
- If TCP connection fails (timeout, RST packet), returns to `Disconnected`.
|
||||
3. **Handshake**: Protocol version negotiation and authentication.
|
||||
- @ref Server sends @ref kMsgHello with protocol version information.
|
||||
- @ref Client responds with @ref kMsgHelloBack including version and screen name.
|
||||
- @ref Server validates the client's message.
|
||||
- Success transitions to `Connected`, failure sends @ref kMsgEIncompatible error.
|
||||
4. **Connected**: Authenticated but not receiving input events.
|
||||
- @ref Client must respond to @ref kMsgCKeepAlive messages from the @ref Server.
|
||||
- Receiving @ref kMsgCEnter message transitions to `Active`.
|
||||
5. **Active**: Receiving and processing input events from @ref Server.
|
||||
- Receiving @ref kMsgCLeave message transitions back to `Connected`.
|
||||
- Receiving @ref kMsgCClose message transitions to `Disconnected`.
|
||||
|
||||
|
||||
## Message Categories
|
||||
|
||||
The protocol organizes messages into logical categories:
|
||||
|
||||
| Category | Prefix | Purpose | Examples |
|
||||
|----------|---------|----------|-----------|
|
||||
| **[Handshake](@ref protocol_handshake)** | None | Connection setup | @ref kMsgHello, @ref kMsgHelloBack |
|
||||
| **[Commands](@ref protocol_commands)** | `C` | Screen control | @ref kMsgCEnter, @ref kMsgCLeave, @ref kMsgCKeepAlive |
|
||||
| **[Data](@ref protocol_data)** | `D` | Input events | @ref kMsgDKeyDown, @ref kMsgDMouseMove, @ref kMsgCClipboard, @ref kMsgDClipboard |
|
||||
| **[Queries](@ref protocol_queries)** | `Q` | Information requests | @ref kMsgQInfo |
|
||||
| **[Errors](@ref protocol_errors)** | `E` | Error notifications | @ref kMsgEIncompatible, @ref kMsgEBusy |
|
||||
|
||||
## Message Reference Table
|
||||
|
||||
This table lists all protocol messages in alphabetical order. For a typical sequence of messages, see the [Typical Control Flow](#typical-control-flow) section.
|
||||
|
||||
| Message | Constant | Category | Direction | Purpose | Constraints | Protocol Version |
|
||||
|---|---|---|---|---|---|---|
|
||||
| [**CALV**](@ref kMsgCKeepAlive) | @ref kMsgCKeepAlive | Command | Both | Keep-alive | [MsgSize](#constraint-protocol-max-message-length), [KeepAlive](#constraint-keep-alive) | 1.3+ |
|
||||
| [**CBYE**](@ref kMsgCClose) | @ref kMsgCClose | Command | Server→Client | Close connection | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**CCLP**](@ref kMsgCClipboard) | @ref kMsgCClipboard | Command | Both | Clipboard ownership notification | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**CIAK**](@ref kMsgCInfoAck) | @ref kMsgCInfoAck | Command | Server→Client | Acknowledge info message | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**CINN**](@ref kMsgCEnter) | @ref kMsgCEnter | Command | Server→Client | Enter screen | [MsgSize](#constraint-protocol-max-message-length), [ScreenEntrySync](#constraint-screen-entry-sync) | 1.0+ |
|
||||
| [**CNOP**](@ref kMsgCNoop) | @ref kMsgCNoop | Command | Both | No operation | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**COUT**](@ref kMsgCLeave) | @ref kMsgCLeave | Command | Server→Client | Leave screen | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**CROP**](@ref kMsgCResetOptions) | @ref kMsgCResetOptions | Command | Server→Client | Reset options to defaults | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**CSEC**](@ref kMsgCScreenSaver) | @ref kMsgCScreenSaver | Command | Server→Client | Screen saver control | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**DCLP**](@ref kMsgDClipboard) | @ref kMsgDClipboard | Data | Both | Clipboard data | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**DDRG**](@ref kMsgDDragInfo) | @ref kMsgDDragInfo | Data | Server→Client | Drag file info | [MsgSize](#constraint-protocol-max-message-length), [ListSize](#constraint-max-list) | 1.5+ |
|
||||
| [**DFTR**](@ref kMsgDFileTransfer) | @ref kMsgDFileTransfer | Data | Both | File transfer data | [MsgSize](#constraint-protocol-max-message-length) | 1.5+ |
|
||||
| [**DINF**](@ref kMsgDInfo) | @ref kMsgDInfo | Data | Client→Server | Screen information | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**DKDL**](@ref kMsgDKeyDownLang) | @ref kMsgDKeyDownLang | Data | Server→Client | Key down with language | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.8+ |
|
||||
| [**DKDN**](@ref kMsgDKeyDown) | @ref kMsgDKeyDown | Data | Server→Client | Key down | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.1+ |
|
||||
| [**DKDN**](@ref kMsgDKeyDown1_0) | @ref kMsgDKeyDown1_0 | Data | Server→Client | Key down (legacy) | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.0 |
|
||||
| [**DKRP**](@ref kMsgDKeyRepeat) | @ref kMsgDKeyRepeat | Data | Server→Client | Key repeat | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.1+ |
|
||||
| [**DKRP**](@ref kMsgDKeyRepeat1_0) | @ref kMsgDKeyRepeat1_0 | Data | Server→Client | Key repeat (legacy) | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.0 |
|
||||
| [**DKUP**](@ref kMsgDKeyUp) | @ref kMsgDKeyUp | Data | Server→Client | Key up | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.1+ |
|
||||
| [**DKUP**](@ref kMsgDKeyUp1_0) | @ref kMsgDKeyUp1_0 | Data | Server→Client | Key up (legacy) | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.0 |
|
||||
| [**DMDN**](@ref kMsgDMouseDown) | @ref kMsgDMouseDown | Data | Server→Client | Mouse down | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**DMMV**](@ref kMsgDMouseMove) | @ref kMsgDMouseMove | Data | Server→Client | Mouse move (absolute) | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**DMRM**](@ref kMsgDMouseRelMove) | @ref kMsgDMouseRelMove | Data | Server→Client | Mouse move (relative) | [MsgSize](#constraint-protocol-max-message-length) | 1.2+ |
|
||||
| [**DMUP**](@ref kMsgDMouseUp) | @ref kMsgDMouseUp | Data | Server→Client | Mouse up | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**DMWM**](@ref kMsgDMouseWheel) | @ref kMsgDMouseWheel | Data | Server→Client | Mouse wheel | [MsgSize](#constraint-protocol-max-message-length) | 1.3+ |
|
||||
| [**DMWM**](@ref kMsgDMouseWheel1_0) | @ref kMsgDMouseWheel1_0 | Data | Server→Client | Mouse wheel (legacy) | [MsgSize](#constraint-protocol-max-message-length) | 1.0-1.2 |
|
||||
| [**DSOP**](@ref kMsgDSetOptions) | @ref kMsgDSetOptions | Data | Server→Client | Set options | [MsgSize](#constraint-protocol-max-message-length), [ListSize](#constraint-max-list) | 1.0+ |
|
||||
| [**EBAD**](@ref kMsgEBad) | @ref kMsgEBad | Error | Server→Client | Protocol violation | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**EBSY**](@ref kMsgEBusy) | @ref kMsgEBusy | Error | Server→Client | Server busy | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**EICV**](@ref kMsgEIncompatible) | @ref kMsgEIncompatible | Error | Server→Client | Incompatible version | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**EUNK**](@ref kMsgEUnknown) | @ref kMsgEUnknown | Error | Server→Client | Unknown client | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**Hello**](@ref kMsgHello) | @ref kMsgHello | Handshake | Server→Client | Protocol identification | [HelloSize](#constraint-max-hello), [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**HelloArgs**](@ref kMsgHelloArgs) | @ref kMsgHelloArgs | Handshake | Internal | Hello message construction | [HelloSize](#constraint-max-hello), [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**HelloBack**](@ref kMsgHelloBack) | @ref kMsgHelloBack | Handshake | Client→Server | Client identification | [HelloSize](#constraint-max-hello), [MsgSize](#constraint-protocol-max-message-length), [HandshakeTimeout](#constraint-handshake-timeout) | 1.0+ |
|
||||
| [**HelloBackArgs**](@ref kMsgHelloBackArgs) | @ref kMsgHelloBackArgs | Handshake | Internal | HelloBack message construction | [HelloSize](#constraint-max-hello), [MsgSize](#constraint-protocol-max-message-length), [HandshakeTimeout](#constraint-handshake-timeout) | 1.0+ |
|
||||
| [**LSYN**](@ref kMsgDLanguageSynchronisation) | @ref kMsgDLanguageSynchronisation | Data | Server→Client | Language synchronization | [MsgSize](#constraint-protocol-max-message-length) | 1.8+ |
|
||||
| [**QINF**](@ref kMsgQInfo) | @ref kMsgQInfo | Query | Server→Client | Request screen info | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
|
||||
| [**SECN**](@ref kMsgDSecureInputNotification) | @ref kMsgDSecureInputNotification | Data | Server→Client | Secure input notification | [MsgSize](#constraint-protocol-max-message-length) | 1.7+ |
|
||||
|
||||
## Typical Control Flow
|
||||
<a id="typical-control-flow"></a>
|
||||
|
||||
A typical control flow is as follows:
|
||||
1. **Handshake**: The server and client exchange `Hello` and `HelloBack` messages to agree on a protocol version.
|
||||
2. **Information Exchange**: The server requests client information with `QINF`, and the client responds with `DINF`.
|
||||
3. **Options**: The server sends `DSOP` to configure client options.
|
||||
4. **Keep-Alive**: The server and client periodically exchange `CALV` messages to maintain the connection.
|
||||
5. **Screen Entry**: The server sends `CINN` to grant control to the client.
|
||||
6. **Input Events**: The server sends a stream of input event messages (e.g., `DMMV`, `DMDN`, `DKDN`).
|
||||
7. **Screen Leave**: The server sends `COUT` to revoke control from the client.
|
||||
8. **Connection Close**: The server sends `CCLOSE` to terminate the connection.
|
||||
|
||||
## Protocol Constraints
|
||||
|
||||
To ensure security, stability, and compatibility, the protocol enforces strict constraints:
|
||||
|
||||
<a id="constraint-max-msg"></a>
|
||||
|
||||
### Message and Data Size Limits
|
||||
|
||||
**Maximum Message Size:**
|
||||
<a id="constraint-protocol-max-message-length"></a>**4,194,304 bytes (4 MB)** — @ref PROTOCOL_MAX_MESSAGE_LENGTH
|
||||
Maximum total size of any single, length-prefixed data packet
|
||||
Defined in Protocol Limits
|
||||
|
||||
**Maximum List Size:**
|
||||
<a id="constraint-max-list"></a>**1,048,576 elements** — @ref PROTOCOL_MAX_LIST_LENGTH
|
||||
Maximum number of items in a list/vector within a message
|
||||
Defined in Protocol Limits
|
||||
|
||||
**Maximum Hello Size:**
|
||||
<a id="constraint-max-hello"></a>**1,024 bytes** — @ref kMaxHelloLength
|
||||
Maximum size of the initial Connection Handshake message
|
||||
Defined in Protocol Limits
|
||||
|
||||
<a id="constraint-tls"></a>
|
||||
|
||||
### TLS Handshake and Security (Protocol v1.4+)
|
||||
|
||||
When encryption is enabled, the protocol follows this sequence:
|
||||
|
||||
1. Standard TCP connection established
|
||||
2. TLS handshake performed over TCP socket
|
||||
3. Protocol handshake begins only after TLS session is established
|
||||
|
||||
- **Implementation Details**:
|
||||
- The client initiates a standard TCP connection, then the (private) SecureSocket::handleTCPConnected method is called, which begins the TLS handshake
|
||||
|
||||
- **Certificate Validation**:
|
||||
- Client implementations **must** validate the server's certificate
|
||||
- The reference implementation checks that the public key is RSA or DSA and that the key length is at least 2048 bits
|
||||
|
||||
### Key Code and Modifier Mapping
|
||||
|
||||
A modifier (modifier mask) represents the state of modifier keys (like Shift, Control, Alt, and Command) on a keyboard. It is a binary code (like 0000 0110) where each bit corresponds to a specific modifier key.
|
||||
|
||||
**Key-Up/Key-Down Strategy:**
|
||||
- <a id="constraint-keymap"></a>Client must use the @ref KeyButton (physical key) to track pressed keys, as the @ref KeyID (virtual key) can change based on modifier state
|
||||
- This strategy is described in the documentation for @ref kMsgDKeyDown
|
||||
|
||||
**Modifier Remapping:**
|
||||
- The server can command clients to remap modifier keys via the @ref kMsgDSetOptions message
|
||||
- The client processes the @ref kMsgDSetOptions message and updates the modifier translation table accordingly
|
||||
|
||||
## Timing and Synchronization
|
||||
|
||||
<a id="constraint-keep-alive"></a>
|
||||
|
||||
### Keep-Alive Mechanism (Protocol v1.3+)
|
||||
|
||||
**Server-Side Behavior:**
|
||||
- The server sends kMsgCKeepAlive messages every 3.0 seconds (defined by @ref kKeepAliveRate)
|
||||
- This timer is implemented in @ref ClientProxy1_3::addHeartbeatTimer in the @ref ClientProxy1_3 class
|
||||
|
||||
**Client-Side Behavior:**
|
||||
- Upon receiving a kMsgCKeepAlive message, the client must immediately send a kMsgCKeepAlive message back
|
||||
- The client maintains a timeout that is reset each time any message is received
|
||||
- If no message is received for 9.0 seconds (3 × @ref kKeepAliveRate), client must disconnect
|
||||
- This is handled by the (private) ServerProxy::handleKeepAliveAlarm method
|
||||
|
||||
<a id="constraint-screen-entry-sync"></a>
|
||||
### Synchronization on Screen Entry
|
||||
|
||||
- The @ref kMsgCEnter (Enter Screen) message includes the current modifier state
|
||||
- Client must synchronize their local modifier state with this mask
|
||||
|
||||
<a id="constraint-handshake-timeout"></a>
|
||||
### Handshake Timeout
|
||||
|
||||
- Server allows **30 seconds** for handshake completion
|
||||
- If client fails to send valid @ref kMsgHelloBack within this time, connection is closed
|
||||
- When a new client connects, the server creates a temporary @ref ClientProxyUnknown to handle the version handshake
|
||||
- A one-shot timer is started for 30 seconds
|
||||
- If the client fails to respond in time, the @ref protocol_errors function is triggered, the connection is logged as unresponsive, and the socket is closed
|
||||
|
||||
## Version Compatibility
|
||||
|
||||
| Version | Release Date | Project | Features | Compatibility |
|
||||
|---------|----------|---------------|----------|---------------|
|
||||
| **1.0** | May 2001 | Synergy | Basic keyboard/mouse sharing (@ref kMsgDKeyDown, @ref kMsgDMouseMove) | All versions |
|
||||
| **1.1** | Apr 2002 | Synergy | Physical key codes (@ref KeyButton) | 1.1+ |
|
||||
| **1.2** | Jan 2006 | Synergy | Relative mouse movement | 1.2+ |
|
||||
| **1.3** | May 2006 | Synergy | Keep-alive (@ref kMsgCKeepAlive), horizontal scroll (@ref kMsgDMouseWheel) | 1.3+ |
|
||||
| **1.4** | Nov 2012 | Synergy | Encryption support (@ref SecureSocket) | 1.4+ |
|
||||
| **1.5** | Sep 2013 | Synergy | File transfer | 1.5+ |
|
||||
| **1.6** | Jan 2014 | Synergy | Clipboard streaming | 1.6+ |
|
||||
| **1.7** | Nov 2021 | Synergy | Secure input notifications | 1.7+ |
|
||||
| **1.8** | Jun 2025 | Synergy | Language synchronization | 1.8+ |
|
||||
|
||||
### Version Migration Guide
|
||||
|
||||
When implementing a client that supports multiple protocol versions:
|
||||
|
||||
1. **Version Negotiation**: During handshake, client should advertise highest supported version
|
||||
2. **Feature Detection**: Check server's version in `Hello` message before using version-specific features
|
||||
3. **Fallback Mechanism**: Be prepared to operate with only features available in the negotiated version
|
||||
4. **Graceful Degradation**: If server supports a lower version than client's minimum, handle `EIncompatible` error gracefully
|
||||
|
||||
## Implementation Examples
|
||||
|
||||
### Connection Lifecycle
|
||||
|
||||
```cpp
|
||||
// 1. Connect to server
|
||||
std::string server_ip = "192.168.1.100";
|
||||
connect(server_ip, 24800);
|
||||
|
||||
// 2. Receive Hello from server
|
||||
auto hello = receive_message();
|
||||
std::string server_version, server_name;
|
||||
parse_hello(hello, &server_version, &server_name);
|
||||
|
||||
// 3. Send HelloBack to server
|
||||
std::string client_version = "1.8";
|
||||
std::string client_name = "MyClient";
|
||||
send_hello_back(client_version, client_name);
|
||||
|
||||
// 4. Enter main message loop
|
||||
bool connected = true;
|
||||
while (connected) {
|
||||
auto message = receive_message();
|
||||
handle_message(message);
|
||||
}
|
||||
```
|
||||
|
||||
### Message Handling
|
||||
|
||||
```cpp
|
||||
void handle_message(const Message& msg) {
|
||||
switch (msg.type) {
|
||||
case "CINN": // Enter screen
|
||||
handle_enter(msg.x, msg.y, msg.sequence, msg.modifiers);
|
||||
break;
|
||||
case "DKDN": // Key down
|
||||
handle_key_down(msg.key_id, msg.modifiers, msg.key_button);
|
||||
break;
|
||||
case "DMMV": // Mouse move
|
||||
handle_mouse_move(msg.x, msg.y);
|
||||
break;
|
||||
// ... handle other message types
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Complete Message Exchange Sequence
|
||||
|
||||
Below is a typical message exchange sequence for a client connecting to a server:
|
||||
|
||||
|
||||
|
||||
```
|
||||
Client Server
|
||||
| |
|
||||
| | Server starts listening on port 24800
|
||||
| |
|
||||
| TCP SYN |
|
||||
| ───────────────────────────────────► |
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| TCP SYN+ACK |
|
||||
| |
|
||||
| TCP ACK |
|
||||
| ───────────────────────────────────► |
|
||||
| | TCP connection established
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "Deskflow" + version (1.8) | Hello message
|
||||
| |
|
||||
| "Deskflow" + version + name |
|
||||
| ───────────────────────────────────► | HelloBack message
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "QINF" | Query screen info
|
||||
| |
|
||||
| "DINF" + screen dimensions |
|
||||
| ───────────────────────────────────► | Report screen info
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "DSOP" + options | Set options
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "CALV" | Keep-alive
|
||||
| |
|
||||
| "CALV" |
|
||||
| ───────────────────────────────────► | Keep-alive response
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "CINN" + x + y + seq + mask | Enter screen
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "DMMV" + x + y | Mouse move
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "DMDN" + button | Mouse down
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "DMUP" + button | Mouse up
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "DKDN" + key + mask + button | Key down
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "DKUP" + key + mask + button | Key up
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "COUT" | Leave screen
|
||||
| |
|
||||
| ◄─────────────────────────────────── |
|
||||
| "CCLOSE" | Close connection
|
||||
| |
|
||||
| TCP FIN |
|
||||
| ◄─────────────────────────────────── |
|
||||
| |
|
||||
| TCP FIN+ACK |
|
||||
| ───────────────────────────────────► |
|
||||
| | Connection closed
|
||||
```
|
||||
|
||||
**Legend:**
|
||||
|
||||
- Hello message: @ref kMsgHello
|
||||
- HelloBack message: @ref kMsgHelloBack
|
||||
- Query screen info: @ref kMsgQInfo
|
||||
- Report screen info: @ref kMsgDInfo
|
||||
- Set options: @ref kMsgDSetOptions
|
||||
- Keep-alive: @ref kMsgCKeepAlive
|
||||
- Enter screen: @ref kMsgCEnter
|
||||
- Mouse move: @ref kMsgDMouseMove
|
||||
- Mouse down: @ref kMsgDMouseDown
|
||||
- Mouse up: @ref kMsgDMouseUp
|
||||
- Key down: @ref kMsgDKeyDown
|
||||
- Key up: @ref kMsgDKeyUp
|
||||
- Leave screen: @ref kMsgCLeave
|
||||
- Close connection: @ref kMsgCClose
|
||||
|
||||
## Debugging and Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Version Mismatch**: Check protocol version negotiation
|
||||
2. **Message Format**: Validate message structure and parameters
|
||||
3. **Byte Order**: Ensure network byte order for multi-byte integers
|
||||
4. **Keep-Alive**: Implement proper keep-alive response
|
||||
5. **Screen Info**: Send accurate screen dimensions and mouse position
|
||||
|
||||
### Debug Tools
|
||||
|
||||
- **Wireshark**: Capture and analyze network traffic
|
||||
- **Protocol Logs**: Enable verbose logging in Deskflow
|
||||
- **Message Validation**: Check message format against specification
|
||||
|
||||
## Platform-Specific Implementations
|
||||
|
||||
For platform-specific implementation details, refer to:
|
||||
- @ref ProtocolTypes.h – Complete protocol specification
|
||||
- @ref ProtocolUtil.h – Message formatting utilities
|
||||
|
||||
## Implementation Checklist
|
||||
|
||||
### Basic Client Implementation
|
||||
|
||||
- **Connection Management**
|
||||
- TCP connection to server port 24800
|
||||
- Protocol handshake (Hello/HelloBack)
|
||||
- Version negotiation
|
||||
- Keep-alive handling
|
||||
|
||||
- **Message Processing**
|
||||
- Message parsing and validation
|
||||
- Command message handling (Enter/Leave)
|
||||
- Input event processing (keyboard/mouse)
|
||||
- Error handling and recovery
|
||||
|
||||
- **Screen Management**
|
||||
- Screen information reporting (DINF)
|
||||
- Resolution change detection
|
||||
- Mouse cursor positioning
|
||||
|
||||
- **Input Synthesis**
|
||||
- Keyboard event injection
|
||||
- Mouse event injection
|
||||
- Modifier key synchronization
|
||||
|
||||
### Advanced Features
|
||||
|
||||
- **Clipboard Synchronization**
|
||||
- Clipboard grab notifications
|
||||
- Data transfer (@ref kMsgDClipboard - text, images, HTML)
|
||||
- Streaming for large data (v1.6+)
|
||||
|
||||
- **File Transfer** (v1.5+)
|
||||
- Drag-and-drop initiation
|
||||
- Chunked file transfer
|
||||
- Progress tracking
|
||||
|
||||
- **Security Features**
|
||||
- TLS/SSL encryption (v1.4+)
|
||||
- Secure input notifications (v1.7+)
|
||||
- Input validation and limits
|
||||
|
||||
## Reference Implementation
|
||||
|
||||
The @ref ServerProxy class provides a reference implementation demonstrating:
|
||||
|
||||
- Basic protocol handling
|
||||
- Message parsing and generation
|
||||
- Connection management
|
||||
- Input event processing
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
When extending the protocol:
|
||||
|
||||
1. **Maintain Compatibility**: New features should be backward compatible
|
||||
2. **Update Documentation**: Document new messages and parameters
|
||||
3. **Version Increment**: Bump minor version for new features
|
||||
4. **Test Thoroughly**: Verify with existing clients and servers
|
||||
|
||||
## Support and Resources
|
||||
|
||||
|
||||
- @ref ProtocolTypes.h – Complete protocol specification
|
||||
- @ref ProtocolUtil.h – Message formatting utilities
|
||||
|
||||
---
|
||||
|
||||
*This documentation is generated from the source code and is always up-to-date with the latest protocol implementation.*
|
||||
20
doc/user/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# SPDX-FileCopyrightText: 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE mainpage.md)
|
||||
|
||||
# Files used to make our documents
|
||||
# User facing documents will not include doxy comments in source code
|
||||
doxygen_add_docs(user-docs ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating user documentation" ALL)
|
||||
|
||||
# HACK Only these will show in your IDE
|
||||
target_sources(user-docs PRIVATE
|
||||
mainpage.md
|
||||
configuration.md
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html"
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
COMPONENT deskflow_user_docs
|
||||
)
|
||||
844
doc/user/configuration.md
Normal file
@ -0,0 +1,844 @@
|
||||
# GUI Config
|
||||
|
||||
Deskflow will automatically figure out where to save settings and other files.
|
||||
|
||||
|
||||
## Search paths
|
||||
|
||||
Deskflow will look for settings in several places depending on your operating system.
|
||||
The search order for a setting file depends on your operating system
|
||||
|
||||
### Linux
|
||||
|
||||
1. `<XDG_CONFIG_HOME>/Deskflow/Deskflow.conf`
|
||||
2. `~/.config/Deskflow/Deskflow.conf`
|
||||
3. `/etc/Deskflow/Deskflow.conf`
|
||||
|
||||
A new settings file will be created in the user path if no settings file is found.
|
||||
The path of the settings file will be used as the base for all other config files.
|
||||
|
||||
### macOS
|
||||
|
||||
1. `~/Library/Deskflow/Deskflow.conf`
|
||||
2. `/Library/Deskflow/Deskflow.conf`
|
||||
|
||||
A new settings file will be created in the user path if no settings file is found.
|
||||
The path of the settings file will be used as the base for all other config files.
|
||||
|
||||
### Windows
|
||||
|
||||
1. `<install-path>/settings/Deskflow.conf`
|
||||
2. Windows Registry `HKCU\Software\Deskflow\Deskflow`
|
||||
|
||||
Windows will save to the install dir if settings are loaded from there. If not, it saves any other config files in: `C:\ProgramData\Deskflow\`
|
||||
|
||||
When using settings from the install dir, the service mode will not be available.
|
||||
|
||||
## Valid GUI Keys
|
||||
|
||||
The GUI config file contains several sections.
|
||||
Each section is formatted the same.
|
||||
Option-value pairs are only written if the value is not the default value.
|
||||
|
||||
```
|
||||
[section]
|
||||
option=value
|
||||
```
|
||||
|
||||
### Client
|
||||
|
||||
This section contains options used when in client mode.
|
||||
It will begin with `[client]`
|
||||
|
||||
|
||||
| Option | Valid Values | Description |
|
||||
|:----------------------|:------------------:|:-----------|
|
||||
| binary | Filename | The filename of the binary to call for client mode. This binary exists in the same path as the GUI |
|
||||
| invertScrollDirection | `true` or `false` | Invert scroll on this client [default: false] |
|
||||
| languageSync | `true` or `false` | Sync to server language [default: true] |
|
||||
| remoteHost | `IP` or `hostname` | The remote host last connected to |
|
||||
| xdpRestoreToken | UUID | Restore token provided by XDG portals |
|
||||
|
||||
|
||||
### Core
|
||||
This section contains general options it will begin with `[core]`
|
||||
|
||||
|Option | Valid Values|Description|
|
||||
|:--------------|:-----------:|:-----------|
|
||||
| coreMode | `0` or `1` or `2` | The mode to start in 0: None, 1: Client, 2: Server [default: 0]|
|
||||
| interface | IP Address | Preferred IP to use for network communication. By default the server board casts on any available address |
|
||||
| lastVersion | M.m.p.t | The version last run used for checking for updates |
|
||||
| port | port # | Port to use when connecting [default: 24800 |
|
||||
| preventSleep | `true` or `false` | Prevent sleep when Deskflow is active [default: false] |
|
||||
| processMode | `1` or `0` | The mode we use to start the process Service or Desktop |
|
||||
| screenName | string | Name used to identify the screen [default: machine's hostname] |
|
||||
| startedBefore | `true` or `false `| Have we started client or server before. Used in logic when deciding to show some dialogs.
|
||||
| updateUrl | URL | The URL to use when checking for a new version number, it should return a version [default: https://api.deskflow.org/version]|
|
||||
|
||||
### Daemon
|
||||
|
||||
This section contains options used by the daemon on windows it will begin with `[daemon]`
|
||||
|
||||
|Option | Valid Values|Description|
|
||||
|:----------|:-----------:|:-----------|
|
||||
| command | Filename | The filename of the binary the daemon. This binary exists in the same path as the deskflow GUI |
|
||||
| elevate | `true` or `false` | Elevate the daemon app [default: true unless portable mode ] |
|
||||
| logFile | Filepath | Filepath of the daemon log |
|
||||
| logLevel | valid log Level, | Log Level |
|
||||
|
||||
### GUI
|
||||
|
||||
This section contains options used by the GUI it will begin with `[gui]`
|
||||
|
||||
|Option | Valid Values |Description|
|
||||
|:------------------|:-----------------:|:-----------|
|
||||
| autoHide | `true` or `false` | When true the app will hide itself on start up [default: false] |
|
||||
| enableUpdateCheck | `true` or `false` | When true check the update URL to see if a new version was released on start up [default: false] |
|
||||
| closeReminder | `true` or `false` | Used to track if we have shown the reminder that when you close the app it remain running in the background [default: true]|
|
||||
| logExpanded | `true` or `false` | Should the log section of the GUI be opened [default: false] |
|
||||
| symbolicTrayIcon | `true` or `false` | When true use the monocolor (symbolic) icon false uses a colorful icon for the tray |
|
||||
| windowGeometry | QRect | Geometry of the window used to restore the window geometry after exiting the app |
|
||||
|
||||
### Log
|
||||
|
||||
This section contains options used by the application logging it will begin with `[log]`
|
||||
|
||||
|Option | Valid Values |Description|
|
||||
|:------|:-----------------:|:-----------|
|
||||
| file | Filepath | The file to write the log into |
|
||||
| level | Valid log level | Log level to use |
|
||||
| toFile | `true` or `false` | When true the log will be written to the value of the `file` option |
|
||||
|
||||
|
||||
### Security
|
||||
|
||||
This section contains options used by the application security it will begin with `[security]`
|
||||
|
||||
|Option | Valid Values |Description|
|
||||
|:----------------------|:-----------------:|:-----------|
|
||||
| checkPeerFingerprints | `true` or `false` | When true peers will have their fingerprints confirmed by the user and stored [default: true] |
|
||||
| certificate | Filepath | Path to the certificate to use to encrypt messages.|
|
||||
| keySize | `2048` OR `4096` | Size of the TLS key to use [default: 2048]|
|
||||
| tlsEnabled | `true` or `false` | Are we using TLS encryption when communicating [default: true].|
|
||||
|
||||
### Server
|
||||
|
||||
This section contains options used when in server mode it will begin with `[server]`
|
||||
|
||||
|Option | Valid Values |Description|
|
||||
|:-------------------|:-----------------:|:-----------|
|
||||
| binary | Filename | The name of the binary to call for client mode. This binary exists in same path as the Deskflow GUI |
|
||||
| configVisible | `true` or `false` | Used internally to track when the severs has a configuration dialog showing.|
|
||||
| externalConfig | `true` or `false` | When true use the external config path |
|
||||
| externalConfigFile | Filepath | Path the server config file if it does not exist the GUI will it generated based on the `internalConfig` section.|
|
||||
|
||||
### InternalConfig
|
||||
|
||||
This section contains options used when in server mode it will begin with `[internalConfig]`
|
||||
block of a server config file as seen below. This section is used by the GUI to generate a server configuration
|
||||
|
||||
```
|
||||
[internalConfig]
|
||||
clipboardSharing=true
|
||||
clipboardSharingSize=@Variant(\0\0\0\x84\0\0\0\0\0\0<\0)
|
||||
disableLockToScreen=false
|
||||
hasHeartbeat=false
|
||||
hasSwitchDelay=false
|
||||
hasSwitchDoubleTap=false
|
||||
heartbeat=5000
|
||||
hotkeys\1\actions\1\activeOnRelease=false
|
||||
hotkeys\1\actions\1\hasScreens=true
|
||||
hotkeys\1\actions\1\keys\1\key=83
|
||||
hotkeys\1\actions\1\keys\size=1
|
||||
hotkeys\1\actions\1\lockCursorToScreen=0
|
||||
hotkeys\1\actions\1\restartServer=false
|
||||
hotkeys\1\actions\1\switchInDirection=0
|
||||
hotkeys\1\actions\1\switchScreenName=void
|
||||
hotkeys\1\actions\1\type=0
|
||||
hotkeys\1\actions\1\typeScreenNames\size=0
|
||||
hotkeys\1\actions\size=1
|
||||
hotkeys\1\keys\1\key=83
|
||||
hotkeys\1\keys\size=1
|
||||
hotkeys\size=1
|
||||
numColumns=5
|
||||
numRows=3
|
||||
protocol=1
|
||||
relativeMouseMoves=false
|
||||
screens\1\name=
|
||||
screens\10\aliasArray\size=0
|
||||
screens\10\fixArray\1\fix=false
|
||||
screens\10\fixArray\2\fix=false
|
||||
screens\10\fixArray\3\fix=false
|
||||
screens\10\fixArray\4\fix=false
|
||||
screens\10\fixArray\size=4
|
||||
screens\10\modifierArray\1\modifier=0
|
||||
screens\10\modifierArray\2\modifier=1
|
||||
screens\10\modifierArray\3\modifier=2
|
||||
screens\10\modifierArray\4\modifier=3
|
||||
screens\10\modifierArray\5\modifier=4
|
||||
screens\10\modifierArray\6\modifier=5
|
||||
screens\10\modifierArray\size=6
|
||||
screens\10\name=null
|
||||
screens\10\switchCornerArray\1\switchCorner=false
|
||||
screens\10\switchCornerArray\2\switchCorner=false
|
||||
screens\10\switchCornerArray\3\switchCorner=false
|
||||
screens\10\switchCornerArray\4\switchCorner=false
|
||||
screens\10\switchCornerArray\size=4
|
||||
screens\10\switchCornerSize=0
|
||||
screens\11\name=
|
||||
screens\12\name=
|
||||
screens\13\name=
|
||||
screens\14\name=
|
||||
screens\15\name=
|
||||
screens\2\name=
|
||||
screens\3\name=
|
||||
screens\4\name=
|
||||
screens\5\name=
|
||||
screens\6\name=
|
||||
screens\7\aliasArray\size=0
|
||||
screens\7\fixArray\1\fix=false
|
||||
screens\7\fixArray\2\fix=false
|
||||
screens\7\fixArray\3\fix=false
|
||||
screens\7\fixArray\4\fix=false
|
||||
screens\7\fixArray\size=4
|
||||
screens\7\modifierArray\1\modifier=0
|
||||
screens\7\modifierArray\2\modifier=1
|
||||
screens\7\modifierArray\3\modifier=2
|
||||
screens\7\modifierArray\4\modifier=3
|
||||
screens\7\modifierArray\5\modifier=4
|
||||
screens\7\modifierArray\6\modifier=5
|
||||
screens\7\modifierArray\size=6
|
||||
screens\7\name=void
|
||||
screens\7\switchCornerArray\1\switchCorner=false
|
||||
screens\7\switchCornerArray\2\switchCorner=false
|
||||
screens\7\switchCornerArray\3\switchCorner=false
|
||||
screens\7\switchCornerArray\4\switchCorner=false
|
||||
screens\7\switchCornerArray\size=4
|
||||
screens\7\switchCornerSize=0
|
||||
screens\8\aliasArray\size=0
|
||||
screens\8\fixArray\1\fix=false
|
||||
screens\8\fixArray\2\fix=false
|
||||
screens\8\fixArray\3\fix=false
|
||||
screens\8\fixArray\4\fix=false
|
||||
screens\8\fixArray\size=4
|
||||
screens\8\modifierArray\1\modifier=0
|
||||
screens\8\modifierArray\2\modifier=1
|
||||
screens\8\modifierArray\3\modifier=2
|
||||
screens\8\modifierArray\4\modifier=3
|
||||
screens\8\modifierArray\5\modifier=4
|
||||
screens\8\modifierArray\6\modifier=5
|
||||
screens\8\modifierArray\size=6
|
||||
screens\8\name=chris-Precision-5570
|
||||
screens\8\switchCornerArray\1\switchCorner=false
|
||||
screens\8\switchCornerArray\2\switchCorner=false
|
||||
screens\8\switchCornerArray\3\switchCorner=false
|
||||
screens\8\switchCornerArray\4\switchCorner=false
|
||||
screens\8\switchCornerArray\size=4
|
||||
screens\8\switchCornerSize=0
|
||||
screens\9\aliasArray\size=0
|
||||
screens\9\fixArray\1\fix=false
|
||||
screens\9\fixArray\2\fix=false
|
||||
screens\9\fixArray\3\fix=false
|
||||
screens\9\fixArray\4\fix=false
|
||||
screens\9\fixArray\size=4
|
||||
screens\9\modifierArray\1\modifier=0
|
||||
screens\9\modifierArray\2\modifier=1
|
||||
screens\9\modifierArray\3\modifier=2
|
||||
screens\9\modifierArray\4\modifier=3
|
||||
screens\9\modifierArray\5\modifier=4
|
||||
screens\9\modifierArray\6\modifier=5
|
||||
screens\9\modifierArray\size=6
|
||||
screens\9\name=abyss.lan
|
||||
screens\9\switchCornerArray\1\switchCorner=false
|
||||
screens\9\switchCornerArray\2\switchCorner=false
|
||||
screens\9\switchCornerArray\3\switchCorner=false
|
||||
screens\9\switchCornerArray\4\switchCorner=false
|
||||
screens\9\switchCornerArray\size=4
|
||||
screens\9\switchCornerSize=0
|
||||
screens\size=15
|
||||
switchCornerArray\1\switchCorner=false
|
||||
switchCornerArray\2\switchCorner=false
|
||||
switchCornerArray\3\switchCorner=false
|
||||
switchCornerArray\4\switchCorner=false
|
||||
switchCornerArray\size=4
|
||||
switchCornerSize=0
|
||||
switchDelay=250
|
||||
switchDoubleTap=250
|
||||
win32KeepForeground=false
|
||||
```
|
||||
|
||||
|
||||
# Server Config
|
||||
|
||||
The `deskflow-server` command accepts the `-c` or `--config` option, which takes one argument,
|
||||
the path to a server configuration file. When using the GUI the `internalConfig` section of the GUI settings will be exported as the server configuration.
|
||||
The configuration file is plain text and case-sensitive. The file is broken into sections, and each section has the form:
|
||||
```
|
||||
section: ''name''
|
||||
''arg'' = ''value''
|
||||
end
|
||||
```
|
||||
|
||||
Comments are introduced by ''#'' and continue to the end of the line. ''name'' must be one of the following:
|
||||
|
||||
* ''screens''
|
||||
* ''aliases''
|
||||
* ''links''
|
||||
* ''options''
|
||||
|
||||
The file is parsed top to bottom and names cannot be used before they've been defined in the <code>screens</code> or <code>aliases</code> sections. So the <code>links</code> and <code>aliases</code> must appear after the <code>screens</code> and <code>links</code> cannot refer to aliases unless the <code>aliases</code> appear before the <code>links</code>.
|
||||
|
||||
### The screens section
|
||||
|
||||
''args'' is a list of screen names, one name per line, each followed by a colon. Names are arbitrary strings but they must be unique. The hostname of each computer is recommended. (This is the computer's network name on win32 and the name reported by the program hostname on Unix and OS X. Note that OS X may append .local to the name you gave your computer; e.g. somehost.local.) There must be a screen name for the server and each client. Each screen can specify a number of options. Options have the form name = value and are listed one per line after the screen name.
|
||||
|
||||
```
|
||||
section: screens
|
||||
moe:
|
||||
larry:
|
||||
halfDuplexCapsLock = true
|
||||
halfDuplexNumLock = true
|
||||
curly:
|
||||
meta = alt
|
||||
end
|
||||
```
|
||||
|
||||
This declares three screens named ''moe'', ''larry'', and ''curly''. Screen ''larry'' has half-duplex ''Caps Lock'' and ''Num Lock'' keys (see below) and screen ''curly'' converts the ''Meta'' modifier key to the ''Alt'' modifier key.
|
||||
|
||||
#### screen options
|
||||
|
||||
A screen can have the following options:
|
||||
|Option | Valid Values| Description|
|
||||
|:----------|:-----------:|:-----------|
|
||||
|halfDuplexCapsLock| `true` or `false` | This computer has a ''Caps Lock'' key that doesn't report a press and a release event when the user presses it but instead reports a press event when it's turned on and a release event when it's turned off. If ''Caps Lock'' acts strangely on all screens then you may need to set this option to true on the server screen. If it acts strangely on one screen then that screen may need the option set to true.|
|
||||
|halfDuplexNumLock | `true` or `false` | This computer has a ''Num Lock'' key that doesn't report a press and a release event when the user presses it but instead reports a press event when it's turned on and a release event when it's turned off. If ''Num Lock'' acts strangely on all screens then you may need to set this option to true on the server screen. If it acts strangely on one screen then that screen may need the option set to true.|
|
||||
|halfDuplexScrollLock| `true` or `false`| This computer has a ''Scroll Lock'' key that doesn't report a press and a release event when the user presses it but instead reports a press event when it's turned on and a release event when it's turned off. If ''Scroll Lock'' acts strangely on all screens then you may need to set this option to true on the server screen. If it acts strangely on one screen then that screen may need the option set to true.|
|
||||
|xtestIsXineramaUnaware| `true` or `false`| This option works around a bug in the XTest extension when used in combination with Xinerama. It affects X11 clients only. Not all versions of the XTest extension are aware of the Xinerama extension. As a result, they do not move the mouse correctly when using multiple Xinerama screens. This option is currently ''true'' by default. If you know your XTest extension is Xinerama aware then set this option to ''false''.|
|
||||
|preserveFocus| `true` or `false` | When true don't drop focus when switching screens
|
||||
|switchCorners| corners |See <a href="#switch-corners">switchCorners</a> below.|
|
||||
|switchCornerSize | integer | see switchCornerSize below.|
|
||||
|shift | shift ctrl alt meta super none | Map the server's shift modifer to different key on a client screen|
|
||||
|ctrl | shift ctrl alt meta super none | Map the server's ctrl modifer to different key on a client screen|
|
||||
|alt | shift ctrl alt meta super none | Map the server's alt modifer to different key on a client screen|
|
||||
|meta| shift ctrl alt meta super none | Map the server's meta modifer to different key on a client screen|
|
||||
|super| shift ctrl alt meta super none | Map the server's super modifer to different key on a client screen|
|
||||
|
||||
### aliases section
|
||||
|
||||
''args'' is a list of screen names just like in the ''screens'' section except each screen is followed by a list of aliases, one per line, not followed by a colon. An ''alias'' is a screen name and must be unique. During screen name lookup each alias is equivalent to the screen name it aliases. So a client can connect using its canonical screen name or any of its aliases.
|
||||
|
||||
```
|
||||
section: aliases
|
||||
larry:
|
||||
larry.stooges.com
|
||||
curly:
|
||||
shemp
|
||||
end
|
||||
```
|
||||
|
||||
Screen ''larry'' is also known as ''larry.stooges.com'' and can connect as either name. Screen ''curly'' is also known as ''shemp'' (hey, it's just an example).
|
||||
|
||||
### links secion
|
||||
|
||||
''args'' is a list of screen names just like in the ''screens'' section except each screen is followed by a list of links, one per line. Each link has the form:
|
||||
```
|
||||
{left|right|up|down}[<range>] = name[<range>]
|
||||
```
|
||||
|
||||
A link indicates which screen is adjacent in the given direction.
|
||||
|
||||
Each side of a link can specify a range which defines a portion of an edge. A range on the direction is the portion of edge you can leave from while a range on the screen is the portion of edge you'll enter into. Ranges are optional and default to the entire edge. All ranges on a particular direction of a particular screen must not overlap.
|
||||
|
||||
A ''range'' is written as <code>(start,end)</code>. Both ''start'' and ''end'' are percentages in the range 0 to 100, inclusive. The start must be less than the end. 0 is the left or top of an edge and 100 is the right or bottom.
|
||||
|
||||
```
|
||||
section: links
|
||||
moe:
|
||||
right = larry
|
||||
up(50,100) = curly(0,50)
|
||||
larry:
|
||||
left = moe
|
||||
up(0,50) = curly(50,100)
|
||||
curly:
|
||||
down(0,50) = moe
|
||||
down(50,100) = larry(0,50)
|
||||
end
|
||||
```
|
||||
|
||||
This indicates that screen ''larry'' is to the right of screen ''moe'' (so moving the cursor off the right edge of ''moe'' would make it appear at the left edge of ''larry''), the left half of curly is above the right half of ''moe'', ''moe'' is to the left of ''larry'' (edges are not necessarily symmetric so you have to provide both directions), the right half of curly is above the left half of ''larry'', all of ''moe'' is below the left half of ''curly'', and the left half of ''larry'' is below the right half of ''curly''.
|
||||
|
||||
Note that links do not have to be symmetrical; for instance, here the edge between ''moe'' and ''curly'' maps to different ranges depending on if you're going up or down. In fact links don't have to be bidirectional. You can configure the right of ''moe'' to go to ''larry'' without a link from the left of ''larry'' to ''moe''. It's possible to configure a screen with no outgoing links; the cursor will get stuck on that screen unless you have a hot key configured to switch off of that screen.
|
||||
|
||||
### options section
|
||||
|
||||
''args'' is a list of lines of the form <code>name = value</code>. These set the global options.
|
||||
|
||||
```
|
||||
section: options
|
||||
protocol = barrier
|
||||
heartbeat = 5000
|
||||
switchDelay = 500
|
||||
end
|
||||
```
|
||||
|
||||
#### List of options allowed in options section
|
||||
|
||||
| Options | Value Values| Description|
|
||||
|:--------|:-----------:|:-----------|
|
||||
|protocol | barrier or synergy| The protocol to use when saying hello to clients. Can be set to barrier or synergy. If not set barrier is used as the default |
|
||||
|heartbeat| integer (N) | The server will expect each client to send a message no less than every `N` milliseconds. If no message arrives from a client within `3N` seconds the server forces that client to disconnect. If deskflow fails to detect clients disconnecting while the server is sleeping or vice versa, try using this option. |
|
||||
|switchCorners | none top-left top-right bottom-left bottom-right left right top bottom all | Deskflow won't switch screens when the mouse reaches the edge of the screen if it's in a listed corner. The size of all corners is given by the `switchCornerSize` option. The first name in the list is one of the above names and defines the initial set of corners. Subsequent names are prefixed with + or - to add the corner to or remove the corner from the set, respectively. For example: `all -left +top-left` starts will all corners, removes the left corners (top and bottom) then adds the top-left back in, resulting in the top-left, bottom-left and bottom-right corners.|
|
||||
|switchCornerSize | integer (N) | Sets the size of all corners in pixels. The cursor must be within `N` pixels of the corner to be considered to be in the corner.|
|
||||
|switchDelay | integer| Deskflow won't switch screens when the mouse reaches the edge of a screen unless it stays on the edge for `N` milliseconds. This helps prevent unintentional switching when working near the edge of a screen.|
|
||||
|switchDoubleTap| integer(N) | Deskflow won't switch screens when the mouse reaches the edge of a screen unless it's moved away from the edge and then back to the edge within `N` milliseconds. With the option you have to quickly tap the edge twice to switch. This helps prevent unintentional switching when working near the edge of a screen.|
|
||||
|screenSaverSync| `true` or `false`| ''Note: Removed in v1.14.1'' If set to ''false'' then Deskflow won't synchronize screen savers. Client screen savers will start according to their individual configurations. The server screen saver won't start if there is input, even if that input is directed toward a client screen.|
|
||||
|relativeMouseMoves| `true` or `false`| If set to ''true'' then secondary screens move the mouse using relative rather than absolute mouse moves when and only when the cursor is locked to the screen (by ''Scroll Lock'' or a configured hot key). This is intended to make Deskflow work better with certain games. If set to ''false'' or not set then all mouse moves are absolute.|
|
||||
|clipboardSharing| `true` or `false`|If set to ''true'' then clipboard sharing will be enabled and the ''clipboardSharingSize'' setting will be used. If set to false, then clipboard sharing will be disabled and the the ''clipboardSharingSize'' setting will be ignored.|
|
||||
|clipboardSharingSize| integer (N)| Deskflow will send a maximum of `N` kilobytes of clipboard data to another computer when the mouse transitions to that computer.|
|
||||
|win32KeepForeground | `true` or `false`| If set to ''true'' (the default), Deskflow will grab the foreground focus on a Windows server (thereby putting all other windows in the background) upon switching to a client. If set to ''false'', it will leave the currently foreground window in the foreground. Deskflow grabs the focus to avoid issues with other apps interfering with Deskflow's ability to read the hardware inputs. |
|
||||
|keystroke(key) | actions | Binds the ''key'' combination key to the given ''actions''. ''key'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') optionally followed by a character or a key name, all separated by + (plus signs). You must have either modifiers or a character/key name or both. See below for `valid key names` and `actions`. Keyboard hot keys are handled while the cursor is on the primary screen and secondary screens. Separate actions can be assigned to press and release.|
|
||||
|mousebutton(button) | actions| Binds the modifier and mouse button combination ''button'' to the given ''actions''. ''button'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') followed by a button number. The primary button (the left button for right handed users) is button 1, the middle button is 2, etc. Actions can be found below. Mouse button actions are not handled while the cursor is on the primary screen. You cannot use these to perform an action while on the primary screen. Separate actions can be assigned to press and release.|
|
||||
|
||||
|
||||
You can use both the ''switchDelay'' and ''switchDoubleTap'' options at the same time. Deskflow will switch when either requirement is satisfied.
|
||||
|
||||
##### Actions
|
||||
|
||||
Actions are two lists of individual actions separated by commas. The two lists are separated by a '';'' (semicolon). Either list can be empty and if the second list is empty then the semicolon is optional. The first list lists actions to take when the condition becomes true (e.g. the hot key or mouse button is pressed) and the second lists actions to take when the condition becomes false (e.g. the hot key or button is released). The condition becoming true is called activation and becoming false is called deactivation. Allowed individual actions are:
|
||||
|
||||
* `keystroke(key[,screens])`
|
||||
|
||||
* `keyDown(key[,screens])`
|
||||
|
||||
* `keyUp(key[,screens])`
|
||||
|
||||
|
||||
: Synthesizes the modifiers and key given in ''key'' which has the same form as described in the ''keystroke'' option. If given, ''screens'' lists the screen or screens to direct the event to, regardless of the active screen. If not given then the event is directed to the active screen only.
|
||||
: ''keyDown'' synthesizes a key press and ''keyUp'' synthesizes a key release. ''keystroke'' synthesizes a key press on activation and a release on deactivation and is equivalent to a ''keyDown'' on activation and ''keyUp'' on deactivation.
|
||||
: ''screens'' is either ''*'' (asterisk) to indicate all screens or a '':'' (colon) separated list of screen names. (Note that the screen name must have already been encountered in the configuration file so you'll probably want to put ''actions'' at the bottom of the file.)
|
||||
|
||||
* `mousebutton(button)`
|
||||
* `mouseDown(button)`
|
||||
* `mouseUp(button)`
|
||||
: Synthesizes the modifiers and mouse button given in ''button'' which has the same form as described in the ''mousebutton'' option.
|
||||
: ''mouseDown'' synthesizes a mouse press and ''mouseUp'' synthesizes a mouse release. ''mousebutton'' synthesizes a mouse press on activation and a release on deactivation and is equivalent to a ''mouseDown'' on activation and ''mouseUp'' on deactivation.
|
||||
|
||||
* `lockCursorToScreen(mode)`
|
||||
: Locks the cursor to or unlocks the cursor from the active screen. ''mode'' can be ''off'' to unlock the cursor, ''on'' to lock the cursor, or ''toggle'' to toggle the current state. The default is ''toggle''. If the configuration has no ''lockCursorToScreen'' action and ''Scroll Lock'' is not used as a hot key then ''Scroll Lock'' toggles cursor locking.
|
||||
|
||||
* `switchToScreen(screen)`
|
||||
: Jump to screen with name or alias ''screen''.
|
||||
|
||||
* `switchInDirection(dir)`
|
||||
: Switch to the screen in the direction ''dir'', which may be one of ''left'', ''right'', ''up'' or ''down''.
|
||||
|
||||
* `switchToNextScreen()`
|
||||
: Cycle to the next screen in the configuration order. If at the last screen, cycles back to the first screen.
|
||||
|
||||
##### Keynames
|
||||
Valid key names are:
|
||||
|
||||
<details><summary>Valid Key Names</summary>
|
||||
* AppMail
|
||||
* AppMedia
|
||||
* AppUser1
|
||||
* AppUser2
|
||||
* AudioDown
|
||||
* AudioMute
|
||||
* AudioNext
|
||||
* AudioPlay
|
||||
* AudioPrev
|
||||
* AudioStop
|
||||
* AudioUp
|
||||
* BackSpace
|
||||
* Begin
|
||||
* Break
|
||||
* Cancel
|
||||
* CapsLock
|
||||
* Clear
|
||||
* Delete
|
||||
* Down
|
||||
* Eject
|
||||
* End
|
||||
* Escape
|
||||
* Execute
|
||||
* F1
|
||||
* F2
|
||||
* F3
|
||||
* F4
|
||||
* F5
|
||||
* F6
|
||||
* F7
|
||||
* F8
|
||||
* F9
|
||||
* F10
|
||||
* F11
|
||||
* F12
|
||||
* F13
|
||||
* F14
|
||||
* F15
|
||||
* F16
|
||||
* F17
|
||||
* F18
|
||||
* F19
|
||||
* F20
|
||||
* F21
|
||||
* F22
|
||||
* F23
|
||||
* F24
|
||||
* F25
|
||||
* F26
|
||||
* F27
|
||||
* F28
|
||||
* F29
|
||||
* F30
|
||||
* F31
|
||||
* F32
|
||||
* F33
|
||||
* F34
|
||||
* F35
|
||||
* Find
|
||||
* Help
|
||||
* Home
|
||||
* Insert
|
||||
* KP_0
|
||||
* KP_1
|
||||
* KP_2
|
||||
* KP_3
|
||||
* KP_4
|
||||
* KP_5
|
||||
* KP_6
|
||||
* KP_7
|
||||
* KP_8
|
||||
* KP_9
|
||||
* KP_Add
|
||||
* KP_Begin
|
||||
* KP_Decimal
|
||||
* KP_Delete
|
||||
* KP_Divide
|
||||
* KP_Down
|
||||
* KP_End
|
||||
* KP_Enter
|
||||
* KP_Equal
|
||||
* KP_F1
|
||||
* KP_F2
|
||||
* KP_F3
|
||||
* KP_F4
|
||||
* KP_Home
|
||||
* KP_Insert
|
||||
* KP_Left
|
||||
* KP_Multiply
|
||||
* KP_PageDown
|
||||
* KP_PageUp
|
||||
* KP_Right
|
||||
* KP_Separator
|
||||
* KP_Space
|
||||
* KP_Subtract
|
||||
* KP_Tab
|
||||
* KP_Up
|
||||
* Left
|
||||
* LeftTab
|
||||
* Linefeed
|
||||
* Menu
|
||||
* NumLock
|
||||
* PageDown
|
||||
* PageUp
|
||||
* Pause
|
||||
* Print
|
||||
* Redo
|
||||
* Return
|
||||
* Right
|
||||
* ScrollLock
|
||||
* Select
|
||||
* Sleep
|
||||
* Space
|
||||
* SysReq
|
||||
* Tab
|
||||
* Undo
|
||||
* Up
|
||||
* WWWBack
|
||||
* WWWFavorites
|
||||
* WWWForward
|
||||
* WWWHome
|
||||
* WWWRefresh
|
||||
* WWWSearch
|
||||
* WWWStop
|
||||
* Space
|
||||
* Exclaim
|
||||
* DoubleQuote
|
||||
* Number
|
||||
* Dollar
|
||||
* Percent
|
||||
* Ampersand
|
||||
* Apostrophe
|
||||
* ParenthesisL
|
||||
* ParenthesisR
|
||||
* Asterisk
|
||||
* Plus
|
||||
* Comma
|
||||
* Minus
|
||||
* Period
|
||||
* Slash
|
||||
* Colon
|
||||
* Semicolon
|
||||
* Less
|
||||
* Equal
|
||||
* Greater
|
||||
* Question
|
||||
* At
|
||||
* BracketL
|
||||
* Backslash
|
||||
* BracketR
|
||||
* Circumflex
|
||||
* Underscore
|
||||
* Grave
|
||||
* BraceL
|
||||
* Bar
|
||||
* BraceR
|
||||
* Tilde
|
||||
</details>
|
||||
|
||||
Additionally, a name of the form `\uXXXX` where ''XXXX'' is a hexadecimal number is interpreted as a unicode character code. Key and modifier names are case-insensitive. Keys that don't exist on the keyboard or in the default keyboard layout will not work.
|
||||
|
||||
### Example textual configuration file
|
||||
|
||||
This example comes from doc/deskflow-basic.conf
|
||||
|
||||
```
|
||||
# sample deskflow configuration file
|
||||
#
|
||||
# comments begin with the # character and continue to the end of
|
||||
# line. comments may appear anywhere the syntax permits.
|
||||
# +-------+ +--------+ +---------+
|
||||
# |Laptop | |Desktop1| |iMac |
|
||||
# | | | | | |
|
||||
# +-------+ +--------+ +---------+
|
||||
|
||||
section: screens
|
||||
# three hosts named: Laptop, Desktop1, and iMac
|
||||
# These are the nice names of the hosts to make it easy to write the config file
|
||||
# The aliases section below contain the "actual" names of the hosts (their hostnames)
|
||||
Laptop:
|
||||
Desktop1:
|
||||
iMac:
|
||||
end
|
||||
|
||||
section: links
|
||||
# iMac is to the right of Desktop1
|
||||
# Laptop is to the left of Desktop1
|
||||
Desktop1:
|
||||
right(0,100) = iMac # the numbers in parentheses indicate the percentage of the screen's edge to be considered active for switching)
|
||||
left = Laptop
|
||||
shift = shift (shift, alt, super, meta can be mapped to any of the others)
|
||||
# Desktop1 is to the right of Laptop
|
||||
Laptop:
|
||||
right = Desktop1
|
||||
# Desktop1 is to the left of iMac
|
||||
iMac:
|
||||
left = Desktop1
|
||||
end
|
||||
section: aliases
|
||||
# The "real" name of iMac is John-Smiths-iMac-3.local.
|
||||
# If we wanted we could remove this alias and instead use John-Smiths-iMac-3.local everywhere iMac is above.
|
||||
# Hopefully it should be easy to see why using an alias is nicer
|
||||
iMac:
|
||||
John-Smiths-iMac-3.local
|
||||
end
|
||||
```
|
||||
|
||||
#### Cursor Wrapping
|
||||
|
||||
The text config allows screens to be wrapped around. For example, with two machines (a server and a client), the mouse can go off the right of the server onto the left side of the client, then off the right side of the client back onto the left side of server. This config also uses ''Ctrl''+''Super''+(''left arrow''/''right arrow'') to switch between machines on keypress.
|
||||
|
||||
```
|
||||
# Physical monitor arrangement, with machine names as used by Deskflow.
|
||||
# +----------+----------+
|
||||
# | syn-serv | syn-cli |
|
||||
# | | |
|
||||
# +----------+----------+
|
||||
|
||||
section: screens
|
||||
syn-serv:
|
||||
syn-cli:
|
||||
end
|
||||
section: links
|
||||
syn-serv:
|
||||
left = syn-cli # "wrapping" arrangement
|
||||
right = syn-cli # "normal" arrangement
|
||||
syn-cli:
|
||||
left = syn-serv # "normal"
|
||||
right = syn-serv # "wrapping"
|
||||
end
|
||||
section: options
|
||||
keystroke(control+super+right) = switchInDirection(right) # Switch screens on keypress
|
||||
<!-- keystroke(control+super+left) = switchInDirection(left) -->
|
||||
end
|
||||
```
|
||||
|
||||
### AltGr key
|
||||
|
||||
The following screen config allows the mapping for ''Alt'' to ''AltGr''. Although this may not work, see [https://github.com/deskflow/deskflow-core/issues/4411 bug #4411].
|
||||
```
|
||||
section: screens
|
||||
client1:
|
||||
altgr = alt # mapping to fix AltGr key not working on windows clients (e.g. @-Symbol etc.).
|
||||
end
|
||||
```
|
||||
|
||||
See also: the man page for ''deskflow-core''.
|
||||
|
||||
### Stacked Example
|
||||
|
||||
Stack one computer's screen on top of another's.
|
||||
|
||||
```
|
||||
# +-------+
|
||||
# | curly |
|
||||
# | |
|
||||
# +-------+
|
||||
# +-------+ +-------+
|
||||
# | moe | | larry |
|
||||
# | | | |
|
||||
# +-------+ +-------+
|
||||
|
||||
section: screens
|
||||
# three hosts named: moe, larry, and curly
|
||||
moe:
|
||||
larry:
|
||||
curly:
|
||||
end
|
||||
|
||||
section: links
|
||||
# larry is to the right of moe and curly is above moe.
|
||||
moe:
|
||||
right = larry
|
||||
up = curly
|
||||
|
||||
# moe is to the left of larry and curly is above larry.
|
||||
larry:
|
||||
left = moe
|
||||
up = curly
|
||||
|
||||
# larry is below curly.
|
||||
curly:
|
||||
down = larry
|
||||
end
|
||||
|
||||
section: aliases
|
||||
# curly is also known as shemp
|
||||
curly:
|
||||
shemp
|
||||
end
|
||||
```
|
||||
|
||||
### Horizontal Example
|
||||
|
||||
Align all screens horizontally.
|
||||
|
||||
```
|
||||
# +-------+ +-------+ +-------+
|
||||
# | moe | | larry | | curly |
|
||||
# | | | | | |
|
||||
# +-------+ +-------+ +-------+
|
||||
|
||||
section: screens
|
||||
# three hosts named: moe, larry, and curly
|
||||
moe:
|
||||
larry:
|
||||
curly:
|
||||
end
|
||||
|
||||
section: links
|
||||
# curly is to the right of larry and moe is to the left of larry.
|
||||
larry:
|
||||
right = curly
|
||||
left = moe
|
||||
|
||||
# larry is to the right of moe.
|
||||
moe:
|
||||
right = larry
|
||||
|
||||
# larry is to the left of curly.
|
||||
curly:
|
||||
left = larry
|
||||
end
|
||||
|
||||
```
|
||||
|
||||
### Span Example
|
||||
|
||||
Span two screens on one computer across the screens of two computers.
|
||||
|
||||
```
|
||||
# +-------+ +-------+
|
||||
# | curly | | curly |
|
||||
# | | | |
|
||||
# +-------+ +-------+
|
||||
# +-------+ +-------+
|
||||
# | moe | | larry |
|
||||
# | | | |
|
||||
# +-------+ +-------+
|
||||
|
||||
section: screens
|
||||
# three hosts named: moe, larry, and curly
|
||||
moe:
|
||||
larry:
|
||||
curly:
|
||||
end
|
||||
|
||||
section: links
|
||||
# larry is to the right of moe and curly is above moe.
|
||||
moe:
|
||||
right = larry
|
||||
up = curly
|
||||
|
||||
# moe is to the left of larry and curly is above larry.
|
||||
larry:
|
||||
left = moe
|
||||
up = curly
|
||||
|
||||
# larry is below curly.
|
||||
curly:
|
||||
down = larry
|
||||
end
|
||||
```
|
||||
|
||||
# Example file for `--config-toml` arg
|
||||
|
||||
```
|
||||
[server.args]
|
||||
no-daemon = true
|
||||
no-tray = true
|
||||
debug = "DEBUG"
|
||||
name = "moe"
|
||||
address = ":24800"
|
||||
|
||||
[client.args]
|
||||
no-daemon = true
|
||||
no-tray = true
|
||||
debug = "DEBUG2"
|
||||
name = "larry"
|
||||
_last = "moe:24800"
|
||||
```
|
||||
|
||||
|
||||
# Example `.env` file
|
||||
|
||||
|
||||
```
|
||||
#
|
||||
# App
|
||||
#
|
||||
|
||||
# Shows the test menu in the GUI (on by default in debug mode)
|
||||
# DESKFLOW_TEST_MENU=true
|
||||
|
||||
# Version checker URL to use (useful for testing)
|
||||
# DESKFLOW_VERSION_URL="https://api.deskflow.org/version?fake=1.100.0"
|
||||
|
||||
# Enable debug logging in the GUI (on by default in debug mode)
|
||||
# DESKFLOW_GUI_DEBUG=true
|
||||
|
||||
# Enable verbose logging in the GUI (always off by default)
|
||||
# DESKFLOW_GUI_VERBOSE=true
|
||||
```
|
||||
@ -10,11 +10,12 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
function(generate_app_man TARGET)
|
||||
function(generate_app_man TARGET NAME)
|
||||
if(HELP2MAN)
|
||||
add_custom_command(
|
||||
TARGET ${target} POST_BUILD
|
||||
COMMAND QT_QPA_PLATFORM=minimal PATH=$<TARGET_FILE_DIR:${target}>:${PATH} ${HELP2MAN}
|
||||
--name ${NAME}
|
||||
--include ${CMAKE_SOURCE_DIR}/src/apps/res/manpage.txt
|
||||
--no-info
|
||||
${target}
|
||||
@ -27,13 +28,7 @@ function(generate_app_man TARGET)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
option(BUILD_UNIFIED "Build unified binary" OFF)
|
||||
if(BUILD_UNIFIED)
|
||||
add_subdirectory(deskflow-core)
|
||||
else()
|
||||
add_subdirectory(deskflow-client)
|
||||
add_subdirectory(deskflow-server)
|
||||
endif(BUILD_UNIFIED)
|
||||
add_subdirectory(deskflow-core)
|
||||
|
||||
## Only used on windows
|
||||
add_subdirectory(deskflow-daemon)
|
||||
|
||||
@ -1,65 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2024 - 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(target ${CMAKE_PROJECT_NAME}-client)
|
||||
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_PROPER_NAME} client application")
|
||||
|
||||
set(EXE_ICON "
|
||||
IDI_DESKFLOW ICON DISCARDABLE \"${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico\"
|
||||
")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/windows.rc.in ${target}.rc)
|
||||
|
||||
set(PLATFORM_SOURCES
|
||||
${target}.exe.manifest
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/deskflow.ico
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(${target} ${PLATFORM_SOURCES} ${target}.cpp)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
arch
|
||||
base
|
||||
client
|
||||
io
|
||||
mt
|
||||
net
|
||||
platform
|
||||
server
|
||||
app
|
||||
${libs})
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
BUILD_WITH_INSTALL_RPATH TRUE
|
||||
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"
|
||||
RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:${CMAKE_PROJECT_PROPER_NAME}>/MacOS
|
||||
)
|
||||
elseif(UNIX)
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
generate_app_man(${target})
|
||||
elseif(WIN32)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME_DEPENDENCY_SET clientDeps
|
||||
DESTINATION .
|
||||
)
|
||||
install(RUNTIME_DEPENDENCY_SET clientDeps
|
||||
PRE_EXCLUDE_REGEXES
|
||||
"api-ms-win-.*"
|
||||
"ext-ms-.*"
|
||||
"^hvsifiletrust\\.dll$"
|
||||
POST_EXCLUDE_REGEXES
|
||||
".*system32.*"
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "arch/Arch.h"
|
||||
#include "base/EventQueue.h"
|
||||
#include "base/Log.h"
|
||||
#include "deskflow/ClientApp.h"
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
#include <QCoreApplication>
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if SYSAPI_WIN32
|
||||
// HACK to make sure settings gets the correct qApp path
|
||||
QCoreApplication m(argc, argv);
|
||||
m.deleteLater();
|
||||
|
||||
ArchMiscWindows::guardRuntimeVersion();
|
||||
|
||||
// record window instance for tray icon, etc
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||
#endif
|
||||
|
||||
Arch arch;
|
||||
arch.init();
|
||||
|
||||
Log log;
|
||||
EventQueue events;
|
||||
|
||||
ClientApp app(&events);
|
||||
return app.run(argc, argv);
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||
@ -40,7 +40,7 @@ if(APPLE)
|
||||
)
|
||||
elseif(UNIX)
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
generate_app_man(${target})
|
||||
generate_app_man(${target} "${CMAKE_PROJECT_DESCRIPTION}")
|
||||
elseif(WIN32)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
|
||||
@ -6,9 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "VersionInfo.h"
|
||||
#include "arch/Arch.h"
|
||||
#include "base/EventQueue.h"
|
||||
#include "base/Log.h"
|
||||
#include "common/ExitCodes.h"
|
||||
#include "deskflow/ClientApp.h"
|
||||
#include "deskflow/ServerApp.h"
|
||||
|
||||
@ -17,14 +19,46 @@
|
||||
#include <QCoreApplication>
|
||||
#endif
|
||||
|
||||
#include <QSharedMemory>
|
||||
#include <iostream>
|
||||
|
||||
const static auto kHeader = QStringLiteral("%1-core: %2\n").arg(kAppId, kDisplayVersion);
|
||||
|
||||
void showHelp()
|
||||
{
|
||||
std::cout << qPrintable(kHeader) << qPrintable(kAppDescription) << "\n\n";
|
||||
std::cout << "Usage: deskflow-core <server | client> [...options]" << std::endl;
|
||||
std::cout << "server - start as a server (deskflow-server)" << std::endl;
|
||||
std::cout << "client - start as a client (deskflow-client)" << std::endl;
|
||||
std::cout << "use deskflow-core <server|client> --help for more information." << std::endl;
|
||||
|
||||
ServerApp sApp(nullptr);
|
||||
sApp.help();
|
||||
|
||||
ClientApp cApp(nullptr);
|
||||
cApp.help();
|
||||
}
|
||||
|
||||
bool isHelp(int argc, char **argv)
|
||||
{
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (argv[i] == std::string("--help") || argv[i] == std::string("-h"))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void showVersion()
|
||||
{
|
||||
std::cout << qPrintable(kHeader) << qPrintable(kCopyright) << std::endl;
|
||||
}
|
||||
|
||||
bool isVersion(int argc, char **argv)
|
||||
{
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (argv[i] == std::string("--version") || argv[i] == std::string("-v"))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isServer(int argc, char **argv)
|
||||
@ -39,6 +73,35 @@ bool isClient(int argc, char **argv)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Arch arch;
|
||||
arch.init();
|
||||
|
||||
Log log;
|
||||
|
||||
if (isHelp(argc, argv)) {
|
||||
showHelp();
|
||||
return s_exitSuccess;
|
||||
}
|
||||
|
||||
if (isVersion(argc, argv)) {
|
||||
showVersion();
|
||||
return s_exitSuccess;
|
||||
}
|
||||
|
||||
// Create a shared memory segment with a unique key
|
||||
// This is to prevent a new instance from running if one is already running
|
||||
QSharedMemory sharedMemory("deskflow-core");
|
||||
|
||||
// Attempt to attach first and detach in order to clean up stale shm chunks
|
||||
// This can happen if the previous instance was killed or crashed
|
||||
if (sharedMemory.attach())
|
||||
sharedMemory.detach();
|
||||
|
||||
// If we can create 1 byte of SHM we are the only instance
|
||||
if (!sharedMemory.create(1)) {
|
||||
LOG_WARN("an instance of deskflow core is already running");
|
||||
return s_exitDuplicate;
|
||||
}
|
||||
#if SYSAPI_WIN32
|
||||
// HACK to make sure settings gets the correct qApp path
|
||||
QCoreApplication m(argc, argv);
|
||||
@ -47,10 +110,6 @@ int main(int argc, char **argv)
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||
#endif
|
||||
|
||||
Arch arch;
|
||||
arch.init();
|
||||
|
||||
Log log;
|
||||
EventQueue events;
|
||||
|
||||
if (isServer(argc, argv)) {
|
||||
@ -63,5 +122,5 @@ int main(int argc, char **argv)
|
||||
showHelp();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return s_exitSuccess;
|
||||
}
|
||||
|
||||
@ -5,9 +5,11 @@
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "VersionInfo.h"
|
||||
#include "arch/Arch.h"
|
||||
#include "base/EventQueue.h"
|
||||
#include "base/Log.h"
|
||||
#include "common/ExitCodes.h"
|
||||
#include "common/Settings.h"
|
||||
#include "deskflow/DaemonApp.h"
|
||||
#include "deskflow/ipc/DaemonIpcServer.h"
|
||||
@ -57,12 +59,6 @@ int main(int argc, char **argv)
|
||||
const auto foregroundOption = QCommandLineOption({"f", "foreground"}, "Run in the foreground (show console)");
|
||||
parser.addOption(foregroundOption);
|
||||
|
||||
const auto installOption = QCommandLineOption({"i", "install"}, "Install as a Windows service");
|
||||
parser.addOption(installOption);
|
||||
|
||||
const auto uninstallOption = QCommandLineOption({"u", "uninstall"}, "Uninstall the Windows service");
|
||||
parser.addOption(uninstallOption);
|
||||
|
||||
parser.process(app);
|
||||
|
||||
if (parser.isSet(foregroundOption)) {
|
||||
@ -77,11 +73,11 @@ int main(int argc, char **argv)
|
||||
// useful for troubleshooting Windows services.
|
||||
// It's important to write the version number to the log file so we can be certain the old daemon
|
||||
// was uninstalled, since sometimes Windows services can get stuck and fail to be removed.
|
||||
LOG_PRINT("%s v%s", QCoreApplication::applicationName().toStdString().c_str(), kDisplayVersion);
|
||||
LOG_PRINT("%s v%s", qPrintable(QCoreApplication::applicationName()), kDisplayVersion);
|
||||
|
||||
// Default log level to system setting (found in Registry).
|
||||
auto logLevel = Settings::value(Settings::Daemon::LogLevel).toString().toStdString();
|
||||
if (logLevel != "") {
|
||||
if (!logLevel.empty()) {
|
||||
CLOG->setFilter(logLevel.c_str());
|
||||
LOG_DEBUG("log level: %s", logLevel.c_str());
|
||||
}
|
||||
@ -95,16 +91,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (parser.isSet(installOption)) {
|
||||
daemon.install();
|
||||
return kExitSuccess;
|
||||
} else if (parser.isSet(uninstallOption)) {
|
||||
daemon.uninstall();
|
||||
return kExitSuccess;
|
||||
}
|
||||
|
||||
const auto ipcServer =
|
||||
new ipc::DaemonIpcServer(&app, DaemonApp::logFilename().toStdString().c_str()); // NOSONAR - Qt managed
|
||||
const auto ipcServer = new ipc::DaemonIpcServer(&app, qPrintable(DaemonApp::logFilename())); // NOSONAR - Qt managed
|
||||
ipcServer->listen();
|
||||
daemon.connectIpcServer(ipcServer);
|
||||
|
||||
@ -120,10 +107,10 @@ int main(int argc, char **argv)
|
||||
|
||||
} catch (std::exception &e) {
|
||||
handleError(e.what());
|
||||
return kExitFailed;
|
||||
return s_exitFailed;
|
||||
} catch (...) {
|
||||
handleError();
|
||||
return kExitFailed;
|
||||
return s_exitFailed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -72,10 +72,29 @@ if(WIN32)
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
set(QT_DEPENDS_DIR ${CMAKE_BINARY_DIR}/qt-depends)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target} POST_BUILD
|
||||
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network $<TARGET_FILE:${target}>
|
||||
COMMAND ${DEPLOYQT}
|
||||
--no-compiler-runtime
|
||||
--no-system-d3d-compiler
|
||||
--no-opengl-sw
|
||||
--no-quick-import
|
||||
--dir "${QT_DEPENDS_DIR}"
|
||||
--plugindir "${QT_DEPENDS_DIR}/plugins"
|
||||
$<TARGET_FILE:${target}>
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different
|
||||
${QT_DEPENDS_DIR}
|
||||
$<TARGET_FILE_DIR:${target}>
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY ${QT_DEPENDS_DIR}/
|
||||
DESTINATION .
|
||||
PATTERN "dx*.dll" EXCLUDE
|
||||
)
|
||||
|
||||
elseif(APPLE)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"
|
||||
@ -84,5 +103,5 @@ elseif(APPLE)
|
||||
install(TARGETS ${target} BUNDLE DESTINATION .)
|
||||
else()
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
generate_app_man(${target})
|
||||
generate_app_man(${target} "${CMAKE_PROJECT_DESCRIPTION} \\(GUI\\)")
|
||||
endif()
|
||||
|
||||
@ -6,7 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "VersionInfo.h"
|
||||
#include "common/Constants.h"
|
||||
#include "common/ExitCodes.h"
|
||||
#include "common/UrlConstants.h"
|
||||
#include "gui/Diagnostic.h"
|
||||
#include "gui/DotEnv.h"
|
||||
@ -17,7 +19,6 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QGuiApplication>
|
||||
#include <QLocalSocket>
|
||||
#include <QMessageBox>
|
||||
#include <QSharedMemory>
|
||||
@ -37,6 +38,8 @@ using namespace deskflow::gui;
|
||||
bool checkMacAssistiveDevices();
|
||||
#endif
|
||||
|
||||
const static auto kHeader = QStringLiteral("%1: %2\n").arg(kAppName, kDisplayVersion);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
|
||||
@ -53,8 +56,8 @@ int main(int argc, char *argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// Add Command Line Options
|
||||
auto helpOption = QCommandLineOption("help", "Display Help on the command line");
|
||||
auto versionOption = QCommandLineOption("version", "Display version information");
|
||||
auto helpOption = QCommandLineOption({"h", "help"}, "Display Help on the command line");
|
||||
auto versionOption = QCommandLineOption({"v", "version"}, "Display version information");
|
||||
auto resetOption = QCommandLineOption("reset", "Reset all settings");
|
||||
|
||||
QCommandLineParser parser;
|
||||
@ -64,16 +67,20 @@ int main(int argc, char *argv[])
|
||||
parser.addOption(resetOption);
|
||||
parser.parse(QCoreApplication::arguments());
|
||||
|
||||
const auto header = QStringLiteral("%1: %2\n").arg(kAppName, kDisplayVersion);
|
||||
if (parser.isSet(helpOption) || !parser.unknownOptionNames().isEmpty() || !parser.errorText().isEmpty()) {
|
||||
QTextStream(stdout) << header << QStringLiteral(" %1\n\n").arg(kAppDescription)
|
||||
if (!parser.errorText().isEmpty()) {
|
||||
qCritical().noquote() << parser.errorText() << "\nUse --help for more information.";
|
||||
return s_exitArgs;
|
||||
}
|
||||
|
||||
if (parser.isSet(helpOption)) {
|
||||
QTextStream(stdout) << kHeader << QStringLiteral(" %1\n\n").arg(kAppDescription)
|
||||
<< parser.helpText().replace(QApplication::applicationFilePath(), kAppId);
|
||||
return 0;
|
||||
return s_exitSuccess;
|
||||
}
|
||||
|
||||
if (parser.isSet(versionOption)) {
|
||||
QTextStream(stdout) << header << kCopyright << Qt::endl;
|
||||
return 0;
|
||||
QTextStream(stdout) << kHeader << kCopyright << Qt::endl;
|
||||
return s_exitSuccess;
|
||||
}
|
||||
|
||||
// Create a shared memory segment with a unique key
|
||||
@ -96,7 +103,7 @@ int main(int argc, char *argv[])
|
||||
QMessageBox::information(nullptr, QObject::tr("Deskflow"), QObject::tr("Deskflow is already running"));
|
||||
}
|
||||
socket.disconnectFromServer();
|
||||
return 0;
|
||||
return s_exitDuplicate;
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_MAC)
|
||||
@ -106,11 +113,16 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
// Sets the fallback icon path
|
||||
setIconFallbackPaths();
|
||||
// Sets the fallback icon path and fallback theme
|
||||
const auto themeName = QStringLiteral("deskflow-%1").arg(iconMode());
|
||||
if (QIcon::themeName().isEmpty())
|
||||
QIcon::setThemeName(themeName);
|
||||
else
|
||||
QIcon::setFallbackThemeName(themeName);
|
||||
QIcon::setFallbackSearchPaths({QStringLiteral(":/icons/%1").arg(themeName)});
|
||||
|
||||
qInstallMessageHandler(deskflow::gui::messages::messageHandler);
|
||||
qInfo("%s v%s", kAppName, qPrintable(kVersion));
|
||||
qInfo("%s v%s", kAppName, kDisplayVersion);
|
||||
|
||||
dotenv();
|
||||
Logger::instance().loadEnvVars();
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2024 - 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(target ${CMAKE_PROJECT_NAME}-server)
|
||||
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_PROPER_NAME} server application")
|
||||
|
||||
set(EXE_ICON "
|
||||
IDI_DESKFLOW ICON DISCARDABLE \"${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico\"
|
||||
")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/windows.rc.in ${target}.rc)
|
||||
|
||||
set(PLATFORM_SOURCES
|
||||
${target}.exe.manifest
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/deskflow.ico
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(${target} ${PLATFORM_SOURCES} ${target}.cpp)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
arch
|
||||
base
|
||||
client
|
||||
io
|
||||
mt
|
||||
net
|
||||
platform
|
||||
server
|
||||
app
|
||||
${libs})
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
BUILD_WITH_INSTALL_RPATH TRUE
|
||||
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"
|
||||
RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:${CMAKE_PROJECT_PROPER_NAME}>/MacOS
|
||||
)
|
||||
elseif(UNIX)
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
generate_app_man(${target})
|
||||
elseif(WIN32)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME_DEPENDENCY_SET serverDeps
|
||||
DESTINATION .
|
||||
)
|
||||
install(RUNTIME_DEPENDENCY_SET serverDeps
|
||||
PRE_EXCLUDE_REGEXES
|
||||
"api-ms-win-.*"
|
||||
"ext-ms-.*"
|
||||
"^hvsifiletrust\\.dll$"
|
||||
POST_EXCLUDE_REGEXES
|
||||
".*system32.*"
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
endif()
|
||||
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012-2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "arch/Arch.h"
|
||||
#include "base/EventQueue.h"
|
||||
#include "base/Log.h"
|
||||
#include "deskflow/ServerApp.h"
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
#include <QCoreApplication>
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if SYSAPI_WIN32
|
||||
// HACK to make sure settings gets the correct qApp path
|
||||
QCoreApplication m(argc, argv);
|
||||
m.deleteLater();
|
||||
|
||||
ArchMiscWindows::guardRuntimeVersion();
|
||||
|
||||
// record window instance for tray icon, etc
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||
#endif
|
||||
|
||||
Arch arch;
|
||||
arch.init();
|
||||
|
||||
Log log;
|
||||
EventQueue events;
|
||||
|
||||
ServerApp app(&events);
|
||||
return app.run(argc, argv);
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||
@ -6,10 +6,15 @@
|
||||
<file>icons/deskflow-dark/actions/16/document-open.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/document-save-as.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/help-about.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/network-connect.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/network-disconnect.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/process-stop.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/system-run.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/tools-report-bug.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/view-close.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/view-refresh.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/window-minimize-pip.svg</file>
|
||||
<file>icons/deskflow-dark/actions/16/window-restore-pip.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/configure.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/edit-copy.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/document-edit.svg</file>
|
||||
@ -17,10 +22,15 @@
|
||||
<file>icons/deskflow-dark/actions/22/document-save-as.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/fingerprint.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/help-about.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/network-connect.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/network-disconnect.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/process-stop.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/system-run.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/tools-report-bug.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/view-close.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/view-refresh.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/window-minimize-pip.svg</file>
|
||||
<file>icons/deskflow-dark/actions/22/window-restore-pip.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/configure.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/edit-copy.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/document-edit.svg</file>
|
||||
@ -29,10 +39,15 @@
|
||||
<file>icons/deskflow-dark/actions/24/edit-clear-all.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/fingerprint.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/help-about.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/network-connect.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/network-disconnect.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/process-stop.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/system-run.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/tools-report-bug.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/view-close.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/view-refresh.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/window-minimize-pip.svg</file>
|
||||
<file>icons/deskflow-dark/actions/24/window-restore-pip.svg</file>
|
||||
<file>icons/deskflow-dark/actions/32/configure.svg</file>
|
||||
<file>icons/deskflow-dark/actions/32/application-exit.svg</file>
|
||||
<file>icons/deskflow-dark/actions/32/dialog-cancel.svg</file>
|
||||
@ -63,10 +78,15 @@
|
||||
<file>icons/deskflow-light/actions/16/document-open.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/document-save-as.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/help-about.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/network-connect.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/network-disconnect.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/process-stop.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/system-run.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/tools-report-bug.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/view-close.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/view-refresh.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/window-minimize-pip.svg</file>
|
||||
<file>icons/deskflow-light/actions/16/window-restore-pip.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/configure.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/edit-clear-all.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/edit-copy.svg</file>
|
||||
@ -74,11 +94,16 @@
|
||||
<file>icons/deskflow-light/actions/22/document-open.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/document-save-as.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/fingerprint.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/network-connect.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/network-disconnect.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/help-about.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/process-stop.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/system-run.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/tools-report-bug.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/view-close.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/view-refresh.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/window-minimize-pip.svg</file>
|
||||
<file>icons/deskflow-light/actions/22/window-restore-pip.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/configure.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/edit-clear-all.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/edit-copy.svg</file>
|
||||
@ -87,10 +112,15 @@
|
||||
<file>icons/deskflow-light/actions/24/document-open.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/document-save-as.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/help-about.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/network-connect.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/network-disconnect.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/process-stop.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/system-run.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/tools-report-bug.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/view-close.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/view-refresh.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/window-minimize-pip.svg</file>
|
||||
<file>icons/deskflow-light/actions/24/window-restore-pip.svg</file>
|
||||
<file>icons/deskflow-light/actions/32/configure.svg</file>
|
||||
<file>icons/deskflow-light/actions/32/application-exit.svg</file>
|
||||
<file>icons/deskflow-light/actions/32/dialog-cancel.svg</file>
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 13.300781 2 L 10.650391 4.6503906 L 9.5859375 3.5859375 L 3.5859375 9.5859375 L 4.6503906 10.650391 L 2 13.300781 L 2.6992188 14 L 5.3496094 11.349609 L 6.4140625 12.414062 L 12.414062 6.4140625 L 11.349609 5.3496094 L 14 2.6992188 L 13.300781 2 z " class="ColorScheme-Text"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 582 B |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-NegativeText { color: #da4453; } .ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 13.300781 2 L 10.650391 4.6503906 L 9.5859375 3.5859375 L 6.5859375 6.5859375 L 9.4140625 9.4140625 L 12.414062 6.4140625 L 11.349609 5.3496094 L 14 2.6992188 L 13.300781 2 z M 5.5859375 7.5859375 L 3.5859375 9.5859375 L 4.6503906 10.650391 L 2 13.300781 L 2.6992188 14 L 5.3496094 11.349609 L 6.4140625 12.414062 L 8.4140625 10.414062 L 5.5859375 7.5859375 z " class="ColorScheme-Text"/>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 9,9.83 10.667,11.497 9,13.164 9.833,13.997 11.5,12.33 13.167,13.997 14,13.164 12.333,11.497 14,9.83 13.167,8.997 11.5,10.664 9.833,8.997 Z" class="ColorScheme-NegativeText"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 982 B |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-NegativeText { color: #da4453; } .ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="m2 2v12h12v-12h-12m1 2h10v9h-10v-9" class="ColorScheme-Text"/>
|
||||
<path d="m6.2 6l-.707.707 1.793 1.793-1.793 1.793.707.707 1.793-1.793 1.793 1.793.707-.707-1.793-1.793 1.793-1.793-.707-.707-1.793 1.793" style="fill:currentColor;fill-opacity:1;stroke:none" class="ColorScheme-NegativeText"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 639 B |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="m2 2v12h6v-1h-5v-9h10v4h1v-6zm7 7v6h6v-6zm1 2h4v3h-4z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m7.9999465 5.0002137-0.999893 2e-7v1.3423975l1e-6 0.9501754-2.8926898-2.882958-0.707107 0.7071067 2.8887423 2.8831185-0.9501364-7e-7 -1.3390969 7e-7 4.666e-4 0.9998928h1.3386313l2.6606688 5.32e-5 4.131e-4 -2.6573881z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 641 B |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="m2 2v12h6v-1h-5v-9h10v4h1v-6zm7 7v6h6v-6zm1 2h4v3h-4z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="M 4,8.999786 H 4.9999606 V 7.657389 L 4.9999596,6.707213 7.8928452,9.590171 8.6,8.883065 5.7110623,5.999946 l 0.9502006,1e-6 1.3391875,-1e-6 -4.666e-4,-0.999893 H 6.6612619 L 4.0004131,5 4,7.657388 Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 624 B |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z " class="ColorScheme-Text"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 588 B |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-NegativeText { color: #da4453; } .ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 9.5 8.7929688 L 11 10.292969 L 11.707031 11 L 13.207031 12.5 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z M 8.7929688 9.5 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 12.5 13.207031 L 11 11.707031 L 10.292969 11 L 8.7929688 9.5 z " class="ColorScheme-Text"/>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 14.833984 14 L 14 14.833984 L 15.666016 16.5 L 14 18.166016 L 14.833984 19 L 16.5 17.333984 L 18.166016 19 L 19 18.166016 L 17.333984 16.5 L 19 14.833984 L 18.166016 14 L 16.5 15.666016 L 14.833984 14 z " class="ColorScheme-NegativeText"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-Accent { color: #3daee9; } .ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 3 3 L 3 19 L 19 19 L 19 3 L 3 3 z M 4 7 L 18 7 L 18 18 L 4 18 L 4 7 z " class="ColorScheme-Text"/>
|
||||
<path style="fill:#da4453;fill-opacity:1;stroke:none" d="M 8.7070312 9 L 8 9.7070312 L 10.292969 12 L 8 14.292969 L 8.7070312 15 L 11 12.707031 L 13.292969 15 L 14 14.292969 L 11.707031 12 L 14 9.7070312 L 13.292969 9 L 11 11.292969 L 8.7070312 9 z "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 698 B |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="m9.93907 8.0718026-0.999892 2e-7v3.2427472l-3.0355875-3.035587-0.707107 0.7071068 3.0355875 3.0355872h-3.2427475v0.999893h4.9497465v-0.292787z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 581 B |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="M 5,12.949747 H 5.999892 V 9.707 L 9.03548,12.742587 9.7425869,12.03548 6.706999,8.999893 H 9.9497469 V 8 H 5 v 0.292787 z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 561 B |
@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z " class="ColorScheme-Text"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 615 B |
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-NegativeText { color: #da4453; } .ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 9.5 8.7929688 L 11 10.292969 L 11.707031 11 L 13.207031 12.5 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z M 8.7929688 9.5 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 12.5 13.207031 L 11 11.707031 L 10.292969 11 L 8.7929688 9.5 z " class="ColorScheme-Text"/>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 14.833984 14 L 14 14.833984 L 15.666016 16.5 L 14 18.166016 L 14.833984 19 L 16.5 17.333984 L 18.166016 19 L 19 18.166016 L 17.333984 16.5 L 19 14.833984 L 18.166016 14 L 16.5 15.666016 L 14.833984 14 z " class="ColorScheme-NegativeText"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">.ColorScheme-Accent { color: #3daee9; } .ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 3 3 L 3 19 L 19 19 L 19 3 L 3 3 z M 4 7 L 18 7 L 18 18 L 4 18 L 4 7 z " class="ColorScheme-Text"/>
|
||||
<path style="fill:#da4453;fill-opacity:1;stroke:none" d="M 8.7070312 9 L 8 9.7070312 L 10.292969 12 L 8 14.292969 L 8.7070312 15 L 11 12.707031 L 13.292969 15 L 14 14.292969 L 11.707031 12 L 14 9.7070312 L 13.292969 9 L 11 11.292969 L 8.7070312 9 z "/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 728 B |
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path class="ColorScheme-Text" d="m9.93907 8.0718026-0.999892 2e-7v3.2427472l-3.0355875-3.035587-0.707107 0.7071068 3.0355875 3.0355872h-3.2427475v0.999893h4.9497465v-0.292787z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 597 B |
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color: #fcfcfc; } </style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path class="ColorScheme-Text" d="M 5,12.949747 H 5.999892 V 9.707 L 9.03548,12.742587 9.7425869,12.03548 6.706999,8.999893 H 9.9497469 V 8 H 5 v 0.292787 z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 577 B |
@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 13.300781 2 L 10.650391 4.6503906 L 9.5859375 3.5859375 L 3.5859375 9.5859375 L 4.6503906 10.650391 L 2 13.300781 L 2.6992188 14 L 5.3496094 11.349609 L 6.4140625 12.414062 L 12.414062 6.4140625 L 11.349609 5.3496094 L 14 2.6992188 L 13.300781 2 z "
|
||||
class="ColorScheme-Text"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 586 B |
@ -0,0 +1,21 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
.ColorScheme-NegativeText {
|
||||
color:#da4453;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 13.300781 2 L 10.650391 4.6503906 L 9.5859375 3.5859375 L 6.5859375 6.5859375 L 9.4140625 9.4140625 L 12.414062 6.4140625 L 11.349609 5.3496094 L 14 2.6992188 L 13.300781 2 z M 5.5859375 7.5859375 L 3.5859375 9.5859375 L 4.6503906 10.650391 L 2 13.300781 L 2.6992188 14 L 5.3496094 11.349609 L 6.4140625 12.414062 L 8.4140625 10.414062 L 5.5859375 7.5859375 z "
|
||||
class="ColorScheme-Text"
|
||||
/>
|
||||
<path
|
||||
style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 9,9.83 10.667,11.497 9,13.164 9.833,13.997 11.5,12.33 13.167,13.997 14,13.164 12.333,11.497 14,9.83 13.167,8.997 11.5,10.664 9.833,8.997 Z"
|
||||
class="ColorScheme-NegativeText"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
21
src/apps/res/icons/deskflow-light/actions/16/view-close.svg
Normal file
@ -0,0 +1,21 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
.ColorScheme-NegativeText {
|
||||
color:#da4453;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="m2 2v12h12v-12h-12m1 2h10v9h-10v-9"
|
||||
class="ColorScheme-Text"/>
|
||||
<path
|
||||
d="m6.2 6l-.707.707 1.793 1.793-1.793 1.793.707.707 1.793-1.793 1.793 1.793.707-.707-1.793-1.793 1.793-1.793-.707-.707-1.793 1.793"
|
||||
style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
class="ColorScheme-NegativeText"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 686 B |
@ -0,0 +1,9 @@
|
||||
<svg version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}</style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="m2 2v12h6v-1h-5v-9h10v4h1v-6zm7 7v6h6v-6zm1 2h4v3h-4z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m7.9999465 5.0002137-0.999893 2e-7v1.3423975l1e-6 0.9501754-2.8926898-2.882958-0.707107 0.7071067 2.8887423 2.8831185-0.9501364-7e-7 -1.3390969 7e-7 4.666e-4 0.9998928h1.3386313l2.6606688 5.32e-5 4.131e-4 -2.6573881z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 614 B |
@ -0,0 +1,9 @@
|
||||
<svg version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}</style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="m2 2v12h6v-1h-5v-9h10v4h1v-6zm7 7v6h6v-6zm1 2h4v3h-4z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="M 4,8.999786 H 4.9999606 V 7.657389 L 4.9999596,6.707213 7.8928452,9.590171 8.6,8.883065 5.7110623,5.999946 l 0.9502006,1e-6 1.3391875,-1e-6 -4.666e-4,-0.999893 H 6.6612619 L 4.0004131,5 4,7.657388 Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 597 B |
@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z "
|
||||
class="ColorScheme-Text"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 598 B |
@ -0,0 +1,22 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
.ColorScheme-NegativeText {
|
||||
color:#da4453;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 9.5 8.7929688 L 11 10.292969 L 11.707031 11 L 13.207031 12.5 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z M 8.7929688 9.5 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 12.5 13.207031 L 11 11.707031 L 10.292969 11 L 8.7929688 9.5 z "
|
||||
class="ColorScheme-Text"
|
||||
/>
|
||||
<path
|
||||
style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 14.833984 14 L 14 14.833984 L 15.666016 16.5 L 14 18.166016 L 14.833984 19 L 16.5 17.333984 L 18.166016 19 L 19 18.166016 L 17.333984 16.5 L 19 14.833984 L 18.166016 14 L 16.5 15.666016 L 14.833984 14 z "
|
||||
class="ColorScheme-NegativeText"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
21
src/apps/res/icons/deskflow-light/actions/22/view-close.svg
Normal file
@ -0,0 +1,21 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
.ColorScheme-Accent {
|
||||
color:#3daee9;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 3 3 L 3 19 L 19 19 L 19 3 L 3 3 z M 4 7 L 18 7 L 18 18 L 4 18 L 4 7 z "
|
||||
class="ColorScheme-Text"
|
||||
/>
|
||||
<path
|
||||
style="fill:#da4453;fill-opacity:1;stroke:none"
|
||||
d="M 8.7070312 9 L 8 9.7070312 L 10.292969 12 L 8 14.292969 L 8.7070312 15 L 11 12.707031 L 13.292969 15 L 14 14.292969 L 11.707031 12 L 14 9.7070312 L 13.292969 9 L 11 11.292969 L 8.7070312 9 z "
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 745 B |
@ -0,0 +1,9 @@
|
||||
<svg version="1.1" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}</style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="m9.93907 8.0718026-0.999892 2e-7v3.2427472l-3.0355875-3.035587-0.707107 0.7071068 3.0355875 3.0355872h-3.2427475v0.999893h4.9497465v-0.292787z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 554 B |
@ -0,0 +1,9 @@
|
||||
<svg version="1.1" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}</style>
|
||||
</defs>
|
||||
<path class="ColorScheme-Text" d="M 5,12.949747 H 5.999892 V 9.707 L 9.03548,12.742587 9.7425869,12.03548 6.706999,8.999893 H 9.9497469 V 8 H 5 v 0.292787 z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 534 B |
@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z " class="ColorScheme-Text"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 641 B |
@ -0,0 +1,16 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
.ColorScheme-NegativeText {
|
||||
color:#da4453;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 9.5 8.7929688 L 11 10.292969 L 11.707031 11 L 13.207031 12.5 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z M 8.7929688 9.5 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 12.5 13.207031 L 11 11.707031 L 10.292969 11 L 8.7929688 9.5 z " class="ColorScheme-Text"/>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 14.833984 14 L 14 14.833984 L 15.666016 16.5 L 14 18.166016 L 14.833984 19 L 16.5 17.333984 L 18.166016 19 L 19 18.166016 L 17.333984 16.5 L 19 14.833984 L 18.166016 14 L 16.5 15.666016 L 14.833984 14 z " class="ColorScheme-NegativeText"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
16
src/apps/res/icons/deskflow-light/actions/24/view-close.svg
Normal file
@ -0,0 +1,16 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
.ColorScheme-Accent {
|
||||
color:#3daee9;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 3 3 L 3 19 L 19 19 L 19 3 L 3 3 z M 4 7 L 18 7 L 18 18 L 4 18 L 4 7 z " class="ColorScheme-Text"/>
|
||||
<path style="fill:#da4453;fill-opacity:1;stroke:none" d="M 8.7070312 9 L 8 9.7070312 L 10.292969 12 L 8 14.292969 L 8.7070312 15 L 11 12.707031 L 13.292969 15 L 14 14.292969 L 11.707031 12 L 14 9.7070312 L 13.292969 9 L 11 11.292969 L 8.7070312 9 z "/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 773 B |
@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}</style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path class="ColorScheme-Text" d="m9.93907 8.0718026-0.999892 2e-7v3.2427472l-3.0355875-3.035587-0.707107 0.7071068 3.0355875 3.0355872h-3.2427475v0.999893h4.9497465v-0.292787z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 609 B |
@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}</style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path class="ColorScheme-Text" d="M 5,12.949747 H 5.999892 V 9.707 L 9.03548,12.742587 9.7425869,12.03548 6.706999,8.999893 H 9.9497469 V 8 H 5 v 0.292787 z" fill="currentColor"/>
|
||||
<path class="ColorScheme-Text" d="m3 3v16h8v-1h-7v-11h14v4h1v-8h-1zm9 9v4-1 5h8v-8h-3zm1 3h6v4h-6v-5z" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 589 B |
@ -1,5 +1,5 @@
|
||||
[SEE ALSO]
|
||||
deskflow(1), deskflow-client(1), deskflow-server(2)
|
||||
deskflow(1), deskflow-core(1)
|
||||
|
||||
All documentation is on the web, so please point your browser at
|
||||
<https://github.com/deskflow/deskflow/wiki> and surf away.
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
configure_file(VersionInfo.h.in VersionInfo.h @ONLY)
|
||||
|
||||
add_subdirectory(arch)
|
||||
add_subdirectory(base)
|
||||
add_subdirectory(client)
|
||||
|
||||
@ -7,42 +7,12 @@
|
||||
|
||||
// clang-format off
|
||||
|
||||
/* Define if the <X11/extensions/dpms.h> header file declares function prototypes. */
|
||||
#cmakedefine HAVE_DPMS_PROTOTYPES @HAVE_DPMS_PROTOTYPES@
|
||||
|
||||
/* Define if you have the `inet_aton` function. */
|
||||
#cmakedefine HAVE_INET_ATON @HAVE_INET_ATON@
|
||||
|
||||
/* Define if you have the `nanosleep` function. */
|
||||
#cmakedefine HAVE_NANOSLEEP @HAVE_NANOSLEEP@
|
||||
|
||||
/* Define if you have a POSIX `sigwait` function. */
|
||||
#cmakedefine HAVE_POSIX_SIGWAIT @HAVE_POSIX_SIGWAIT@
|
||||
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#cmakedefine HAVE_PTHREAD @HAVE_PTHREAD@
|
||||
|
||||
/* Define if you have `pthread_sigmask` and `pthread_kill` functions. */
|
||||
#cmakedefine HAVE_PTHREAD_SIGNAL @HAVE_PTHREAD_SIGNAL@
|
||||
|
||||
/* Define if your compiler defines socklen_t. */
|
||||
#cmakedefine HAVE_SOCKLEN_T @HAVE_SOCKLEN_T@
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SELECT_H @HAVE_SYS_SELECT_H@
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SOCKET_H @HAVE_SYS_SOCKET_H@
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TIME_H @HAVE_SYS_TIME_H@
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
|
||||
#cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H @HAVE_X11_EXTENSIONS_XRANDR_H@
|
||||
|
||||
@ -61,19 +31,4 @@
|
||||
/* Define this if the XKB extension is available. */
|
||||
#cmakedefine HAVE_XKB_EXTENSION @HAVE_XKB_EXTENSION@
|
||||
|
||||
/* Define to the type of arg 1 for `select`. */
|
||||
#cmakedefine SELECT_TYPE_ARG1 @SELECT_TYPE_ARG1@
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for `select`. */
|
||||
#cmakedefine SELECT_TYPE_ARG234 @SELECT_TYPE_ARG234@
|
||||
|
||||
/* Define to the type of arg 5 for `select`. */
|
||||
#cmakedefine SELECT_TYPE_ARG5 @SELECT_TYPE_ARG5@
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#cmakedefine TIME_WITH_SYS_TIME @TIME_WITH_SYS_TIME@
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#cmakedefine X_DISPLAY_MISSING @X_DISPLAY_MISSING@
|
||||
|
||||
// clang-format on
|
||||
|
||||
14
src/lib/VersionInfo.h.in
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2024 - 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2025 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
const auto kVersion = "@CMAKE_PROJECT_VERSION@";
|
||||
const auto kVersionGitSha = "@GIT_SHA_SHORT@";
|
||||
// clang-format off
|
||||
const auto kDisplayVersion = @CMAKE_PROJECT_VERSION_TWEAK@ ? "@CMAKE_PROJECT_VERSION@ (@GIT_SHA_SHORT@)" : "@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@";
|
||||
// clang-format on
|
||||
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
@ -7,6 +8,8 @@
|
||||
|
||||
#include "arch/Arch.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
#endif
|
||||
@ -28,16 +31,32 @@ Arch::Arch(Arch *arch)
|
||||
s_instance = arch;
|
||||
}
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
void Arch::init()
|
||||
{
|
||||
ARCH_NETWORK::init();
|
||||
#if SYSAPI_WIN32
|
||||
ArchMiscWindows::init();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
Arch *Arch::getInstance()
|
||||
{
|
||||
assert(s_instance != nullptr);
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
void Arch::sleep(double timeout)
|
||||
{
|
||||
ARCH->testCancelThread();
|
||||
if (timeout < 0.0)
|
||||
return;
|
||||
const auto msec = static_cast<uint64_t>(timeout * 1000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(msec));
|
||||
}
|
||||
|
||||
double Arch::time()
|
||||
{
|
||||
auto sinceEpoch = std::chrono::steady_clock::now().time_since_epoch();
|
||||
auto uSecSinceEpoch = std::chrono::duration_cast<std::chrono::microseconds>(sinceEpoch).count();
|
||||
return double(uSecSinceEpoch / 1000000);
|
||||
}
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
// TODO: consider whether or not to use either encapsulation (as below)
|
||||
// Consider whether or not to use either encapsulation (as below)
|
||||
// or inheritance (as it is now) for the ARCH stuff.
|
||||
//
|
||||
// case for encapsulation:
|
||||
@ -24,7 +25,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "arch/ArchString.h"
|
||||
#include "common/Common.h"
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
@ -33,20 +33,13 @@
|
||||
#include "arch/win32/ArchLogWindows.h"
|
||||
#include "arch/win32/ArchMultithreadWindows.h"
|
||||
#include "arch/win32/ArchNetworkWinsock.h"
|
||||
#include "arch/win32/ArchSleepWindows.h"
|
||||
#include "arch/win32/ArchTimeWindows.h"
|
||||
|
||||
#elif SYSAPI_UNIX
|
||||
|
||||
#include "arch/unix/ArchDaemonUnix.h"
|
||||
#include "arch/unix/ArchLogUnix.h"
|
||||
#include "arch/unix/ArchNetworkBSD.h"
|
||||
#include "arch/unix/ArchSleepUnix.h"
|
||||
#include "arch/unix/ArchTimeUnix.h"
|
||||
|
||||
#if HAVE_PTHREAD
|
||||
#include "arch/unix/ArchMultithreadPosix.h"
|
||||
#endif
|
||||
#include "arch/unix/ArchNetworkBSD.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -66,25 +59,21 @@ to each method to those implementations. Clients should use the
|
||||
exactly one of these objects before attempting to call any method,
|
||||
typically at the beginning of \c main().
|
||||
*/
|
||||
class Arch : public ARCH_DAEMON,
|
||||
public ARCH_LOG,
|
||||
public ARCH_MULTITHREAD,
|
||||
public ARCH_NETWORK,
|
||||
public ARCH_SLEEP,
|
||||
public ArchString,
|
||||
public ARCH_TIME
|
||||
class Arch : public ARCH_DAEMON, public ARCH_LOG, public ARCH_MULTITHREAD, public ARCH_NETWORK
|
||||
{
|
||||
public:
|
||||
Arch();
|
||||
explicit Arch(Arch *arch);
|
||||
~Arch() override = default;
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
//! Call init on other arch classes.
|
||||
/*!
|
||||
Some arch classes depend on others to exist first. When init is called
|
||||
these classes will have ARCH available for use.
|
||||
*/
|
||||
void init() override;
|
||||
#endif
|
||||
|
||||
//
|
||||
// accessors
|
||||
@ -102,6 +91,19 @@ public:
|
||||
s_instance = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief blocks calling thread for timout seconds
|
||||
* @param timeout - blocking time in seconds. if < 0 not blocked if == 0 then caller yields the CPU
|
||||
*/
|
||||
static void sleep(double timeout);
|
||||
|
||||
/**
|
||||
* @brief time
|
||||
* @return Returns the number of seconds since some arbitrary starting time.
|
||||
* This should return as high a precision as reasonable.
|
||||
*/
|
||||
static double time();
|
||||
|
||||
private:
|
||||
static Arch *s_instance;
|
||||
};
|
||||
|
||||
@ -6,49 +6,22 @@
|
||||
*/
|
||||
|
||||
#include "arch/ArchDaemonNone.h"
|
||||
#include <QString>
|
||||
|
||||
//
|
||||
// ArchDaemonNone
|
||||
//
|
||||
|
||||
void ArchDaemonNone::installDaemon(const char *, const char *, const char *, const char *, const char *)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void ArchDaemonNone::uninstallDaemon(const char *)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
int ArchDaemonNone::daemonize(const char *name, DaemonFunc const &func)
|
||||
int ArchDaemonNone::daemonize(const QString &name, DaemonFunc const &func)
|
||||
{
|
||||
// simply forward the call to func. obviously, this doesn't
|
||||
// do any daemonizing.
|
||||
return func(1, &name);
|
||||
auto t = name.toStdString();
|
||||
const char *n = t.c_str();
|
||||
return func(1, &n);
|
||||
}
|
||||
|
||||
bool ArchDaemonNone::canInstallDaemon(const char *)
|
||||
QString ArchDaemonNone::commandLine() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ArchDaemonNone::isDaemonInstalled(const char *)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void ArchDaemonNone::installDaemon()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void ArchDaemonNone::uninstallDaemon()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
std::string ArchDaemonNone::commandLine() const
|
||||
{
|
||||
return "";
|
||||
return {};
|
||||
}
|
||||
|
||||
@ -13,9 +13,8 @@
|
||||
|
||||
//! Dummy implementation of IArchDaemon
|
||||
/*!
|
||||
This class implements IArchDaemon for a platform that does not have
|
||||
daemons. The install and uninstall functions do nothing, the query
|
||||
functions return false, and \c daemonize() simply calls the passed
|
||||
This class implements IArchDaemon for a platform that does not have daemons.
|
||||
The query functions return false, and \c daemonize() simply calls the passed
|
||||
function and returns its result.
|
||||
*/
|
||||
class ArchDaemonNone : public IArchDaemon
|
||||
@ -25,14 +24,6 @@ public:
|
||||
~ArchDaemonNone() override = default;
|
||||
|
||||
// IArchDaemon overrides
|
||||
void installDaemon(
|
||||
const char *name, const char *description, const char *pathname, const char *commandLine, const char *dependencies
|
||||
) override;
|
||||
void uninstallDaemon(const char *name) override;
|
||||
int daemonize(const char *name, DaemonFunc const &func) override;
|
||||
bool canInstallDaemon(const char *name) override;
|
||||
bool isDaemonInstalled(const char *name) override;
|
||||
void installDaemon() override;
|
||||
void uninstallDaemon() override;
|
||||
std::string commandLine() const override;
|
||||
int daemonize(const QString &name, DaemonFunc const &func) override;
|
||||
QString commandLine() const override;
|
||||
};
|
||||
|
||||
202
src/lib/arch/ArchException.h
Normal file
@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
//! Generic thread exception
|
||||
/*!
|
||||
Exceptions derived from this class are used by the multithreading
|
||||
library to perform stack unwinding when a thread terminates. These
|
||||
exceptions must always be rethrown by clients when caught.
|
||||
*/
|
||||
class ThreadException : public std::exception
|
||||
{
|
||||
};
|
||||
|
||||
//! Thread exception to cancel
|
||||
/*!
|
||||
Thrown to cancel a thread. Clients must not throw this type, but
|
||||
must rethrow it if caught (by ThreadCancelException, ThreadException, or ...).
|
||||
*/
|
||||
class ThreadCancelException : public ThreadException
|
||||
{
|
||||
};
|
||||
|
||||
/*!
|
||||
\def RETHROW_THREADEXCEPTION
|
||||
Convenience macro to rethrow an ThreadException exception but ignore other
|
||||
exceptions. Put this in your catch (...) handler after necessary
|
||||
cleanup but before leaving or returning from the handler.
|
||||
*/
|
||||
#define RETHROW_THREADEXCEPTION \
|
||||
try { \
|
||||
throw; \
|
||||
} catch (ThreadException &) { \
|
||||
throw; \
|
||||
} catch (...) { \
|
||||
}
|
||||
|
||||
//! Generic network exception
|
||||
/*!
|
||||
Exceptions derived from this class are used by the networking
|
||||
library to indicate various errors.
|
||||
*/
|
||||
class ArchNetworkException : public std::runtime_error
|
||||
{
|
||||
using std::runtime_error::runtime_error;
|
||||
};
|
||||
|
||||
//! Operation was interrupted
|
||||
class ArchNetworkInterruptedException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Network insufficient permission
|
||||
class ArchNetworkAccessException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Network insufficient resources
|
||||
class ArchNetworkResourceException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! No support for requested network resource/service
|
||||
class ArchNetworkSupportException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Network I/O error
|
||||
class ArchNetworkIOException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Network address is unavailable or not local
|
||||
class ArchNetworkNoAddressException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Network address in use
|
||||
class ArchNetworkAddressInUseException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! No route to address
|
||||
class ArchNetworkNoRouteException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Socket not connected
|
||||
class ArchNetworkNotConnectedException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Remote read end of socket has closed
|
||||
class ArchNetworkShutdownException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Remote end of socket has disconnected
|
||||
class ArchNetworkDisconnectedException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Remote end of socket refused connection
|
||||
class ArchNetworkConnectionRefusedException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Remote end of socket is not responding
|
||||
class ArchNetworkTimedOutException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! Generic network name lookup erros
|
||||
class ArchNetworkNameException : public ArchNetworkException
|
||||
{
|
||||
using ArchNetworkException::ArchNetworkException;
|
||||
};
|
||||
|
||||
//! The named host is unknown
|
||||
class ArchNetworkNameUnknownException : public ArchNetworkNameException
|
||||
{
|
||||
using ArchNetworkNameException::ArchNetworkNameException;
|
||||
};
|
||||
|
||||
//! The named host is known but has no address
|
||||
class ArchNetworkNameNoAddressException : public ArchNetworkNameException
|
||||
{
|
||||
using ArchNetworkNameException::ArchNetworkNameException;
|
||||
};
|
||||
|
||||
//! Non-recoverable name server error
|
||||
class ArchNetworkNameFailureException : public ArchNetworkNameException
|
||||
{
|
||||
using ArchNetworkNameException::ArchNetworkNameException;
|
||||
};
|
||||
|
||||
//! Temporary name server error
|
||||
class ArchNetworkNameUnavailableException : public ArchNetworkNameException
|
||||
{
|
||||
using ArchNetworkNameException::ArchNetworkNameException;
|
||||
};
|
||||
|
||||
//! The named host is known but no supported address
|
||||
class ArchNetworkNameUnsupportedException : public ArchNetworkNameException
|
||||
{
|
||||
using ArchNetworkNameException::ArchNetworkNameException;
|
||||
};
|
||||
|
||||
//! Generic daemon exception
|
||||
/*!
|
||||
Exceptions derived from this class are used by the daemon
|
||||
library to indicate various errors.
|
||||
*/
|
||||
class ArchDaemonException : public std::runtime_error
|
||||
{
|
||||
using std::runtime_error::runtime_error;
|
||||
};
|
||||
|
||||
//! Could not daemonize
|
||||
class ArchDaemonFailedException : public ArchDaemonException
|
||||
{
|
||||
using ArchDaemonException::ArchDaemonException;
|
||||
};
|
||||
|
||||
//! Could not install daemon
|
||||
class ArchDaemonInstallException : public ArchDaemonException
|
||||
{
|
||||
using ArchDaemonException::ArchDaemonException;
|
||||
};
|
||||
|
||||
//! Could not uninstall daemon
|
||||
class ArchDaemonUninstallFailedException : public ArchDaemonException
|
||||
{
|
||||
using ArchDaemonException::ArchDaemonException;
|
||||
};
|
||||
|
||||
//! Attempted to uninstall a daemon that was not installed
|
||||
class ArchDaemonUninstallNotInstalledException : public ArchDaemonFailedException
|
||||
{
|
||||
using ArchDaemonFailedException::ArchDaemonFailedException;
|
||||
};
|
||||
@ -1,183 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "arch/ArchString.h"
|
||||
#include "arch/Arch.h"
|
||||
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
static ArchMutex s_mutex = nullptr;
|
||||
|
||||
//
|
||||
// use C library non-reentrant multibyte conversion with mutex
|
||||
//
|
||||
|
||||
ArchString::~ArchString()
|
||||
{
|
||||
if (s_mutex != nullptr) {
|
||||
ARCH->closeMutex(s_mutex);
|
||||
s_mutex = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
int ArchString::convStringWCToMB(char *dst, const wchar_t *src, uint32_t n, bool *errors) const
|
||||
{
|
||||
ptrdiff_t len = 0;
|
||||
|
||||
bool dummyErrors;
|
||||
if (errors == nullptr) {
|
||||
errors = &dummyErrors;
|
||||
}
|
||||
*errors = false;
|
||||
|
||||
if (s_mutex == nullptr) {
|
||||
s_mutex = ARCH->newMutex();
|
||||
}
|
||||
|
||||
ARCH->lockMutex(s_mutex);
|
||||
|
||||
if (dst == nullptr) {
|
||||
char dummy[MB_LEN_MAX];
|
||||
const wchar_t *scan = src;
|
||||
for (; n > 0; --n) {
|
||||
ptrdiff_t mblen = wctomb(dummy, *scan);
|
||||
if (mblen == -1) {
|
||||
*errors = true;
|
||||
mblen = 1;
|
||||
}
|
||||
len += mblen;
|
||||
++scan;
|
||||
}
|
||||
if (ptrdiff_t mblen = wctomb(dummy, L'\0'); mblen != -1) {
|
||||
len += mblen - 1;
|
||||
}
|
||||
} else {
|
||||
const char *dst0 = dst;
|
||||
const wchar_t *scan = src;
|
||||
for (; n > 0; --n) {
|
||||
if (ptrdiff_t mblen = wctomb(dst, *scan); mblen == -1) {
|
||||
*errors = true;
|
||||
*dst++ = '?';
|
||||
} else {
|
||||
dst += mblen;
|
||||
}
|
||||
++scan;
|
||||
}
|
||||
if (ptrdiff_t mblen = wctomb(dst, L'\0'); mblen != -1) {
|
||||
// don't include nul terminator
|
||||
dst += mblen - 1;
|
||||
}
|
||||
len = dst - dst0;
|
||||
}
|
||||
ARCH->unlockMutex(s_mutex);
|
||||
|
||||
return static_cast<int>(len);
|
||||
}
|
||||
|
||||
ArchString::EWideCharEncoding ArchString::getWideCharEncoding() const
|
||||
{
|
||||
#ifdef SYSAPI_WIN32
|
||||
return EWideCharEncoding::kUTF16;
|
||||
#else
|
||||
return EWideCharEncoding::kUCS4;
|
||||
#endif
|
||||
}
|
||||
|
||||
int ArchString::convStringMBToWC(wchar_t *dst, const char *src, uint32_t n, bool *errors) const
|
||||
{
|
||||
ptrdiff_t len = 0;
|
||||
wchar_t dummy;
|
||||
|
||||
bool dummyErrors;
|
||||
if (errors == nullptr) {
|
||||
errors = &dummyErrors;
|
||||
}
|
||||
*errors = false;
|
||||
|
||||
if (s_mutex == nullptr) {
|
||||
s_mutex = ARCH->newMutex();
|
||||
}
|
||||
|
||||
ARCH->lockMutex(s_mutex);
|
||||
|
||||
if (dst == nullptr) {
|
||||
const char *scan = src;
|
||||
while (n > 0) {
|
||||
switch (ptrdiff_t mblen = mbtowc(&dummy, scan, n); mblen) {
|
||||
case -2:
|
||||
// incomplete last character. convert to unknown character.
|
||||
*errors = true;
|
||||
len += 1;
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
case -1:
|
||||
// invalid character. count one unknown character and
|
||||
// start at the next byte.
|
||||
*errors = true;
|
||||
len += 1;
|
||||
scan += 1;
|
||||
n -= 1;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
len += 1;
|
||||
scan += 1;
|
||||
n -= 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
// normal character
|
||||
len += 1;
|
||||
scan += static_cast<int>(mblen);
|
||||
n -= static_cast<int>(mblen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const wchar_t *dst0 = dst;
|
||||
const char *scan = src;
|
||||
while (n > 0) {
|
||||
switch (ptrdiff_t mblen = mbtowc(dst, scan, n); mblen) {
|
||||
case -2:
|
||||
// incomplete character. convert to unknown character.
|
||||
*errors = true;
|
||||
*dst = (wchar_t)0xfffd;
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
case -1:
|
||||
// invalid character. count one unknown character and
|
||||
// start at the next byte.
|
||||
*errors = true;
|
||||
*dst = (wchar_t)0xfffd;
|
||||
scan += 1;
|
||||
n -= 1;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
*dst = (wchar_t)0x0000;
|
||||
scan += 1;
|
||||
n -= 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
// normal character
|
||||
scan += static_cast<int>(mblen);
|
||||
n -= static_cast<int>(mblen);
|
||||
break;
|
||||
}
|
||||
++dst;
|
||||
}
|
||||
len = dst - dst0;
|
||||
}
|
||||
ARCH->unlockMutex(s_mutex);
|
||||
|
||||
return static_cast<int>(len);
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/Common.h"
|
||||
#include "common/IInterface.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
//! Interface for architecture dependent string operations
|
||||
/*!
|
||||
This interface defines the string operations required by
|
||||
deskflow. Each architecture must implement this interface.
|
||||
*/
|
||||
class ArchString : public IInterface
|
||||
{
|
||||
public:
|
||||
ArchString() = default;
|
||||
ArchString(const ArchString &) = delete;
|
||||
ArchString(ArchString &&) = delete;
|
||||
~ArchString() override;
|
||||
|
||||
ArchString &operator=(const ArchString &) = delete;
|
||||
ArchString &operator=(ArchString &&) = delete;
|
||||
|
||||
//! Wide character encodings
|
||||
/*!
|
||||
The known wide character encodings
|
||||
*/
|
||||
enum class EWideCharEncoding : uint8_t
|
||||
{
|
||||
kUCS2, //!< The UCS-2 encoding
|
||||
kUCS4, //!< The UCS-4 encoding
|
||||
kUTF16, //!< The UTF-16 encoding
|
||||
kUTF32, //!< The UTF-32 encoding
|
||||
kPlatformDetermined
|
||||
};
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Convert multibyte string to wide character string
|
||||
int convStringMBToWC(wchar_t *, const char *, uint32_t n, bool *errors) const;
|
||||
|
||||
//! Convert wide character string to multibyte string
|
||||
int convStringWCToMB(char *, const wchar_t *, uint32_t n, bool *errors) const;
|
||||
|
||||
//! Return the architecture's native wide character encoding
|
||||
EWideCharEncoding getWideCharEncoding() const;
|
||||
|
||||
//@}
|
||||
};
|
||||
@ -16,10 +16,6 @@ if(WIN32)
|
||||
win32/ArchMultithreadWindows.h
|
||||
win32/ArchNetworkWinsock.cpp
|
||||
win32/ArchNetworkWinsock.h
|
||||
win32/ArchSleepWindows.cpp
|
||||
win32/ArchSleepWindows.h
|
||||
win32/ArchTimeWindows.cpp
|
||||
win32/ArchTimeWindows.h
|
||||
win32/XArchWindows.cpp
|
||||
win32/XArchWindows.h
|
||||
)
|
||||
@ -34,10 +30,6 @@ elseif(UNIX)
|
||||
unix/ArchMultithreadPosix.h
|
||||
unix/ArchNetworkBSD.cpp
|
||||
unix/ArchNetworkBSD.h
|
||||
unix/ArchSleepUnix.cpp
|
||||
unix/ArchSleepUnix.h
|
||||
unix/ArchTimeUnix.cpp
|
||||
unix/ArchTimeUnix.h
|
||||
unix/XArchUnix.cpp
|
||||
unix/XArchUnix.h
|
||||
)
|
||||
@ -48,17 +40,15 @@ add_library(arch STATIC ${PLATFORM_CODE}
|
||||
Arch.h
|
||||
ArchDaemonNone.cpp
|
||||
ArchDaemonNone.h
|
||||
ArchException.h
|
||||
IArchDaemon.h
|
||||
IArchLog.h
|
||||
IArchMultithread.h
|
||||
IArchNetwork.h
|
||||
IArchSleep.h
|
||||
ArchString.cpp
|
||||
ArchString.h
|
||||
IArchTime.h
|
||||
XArch.h
|
||||
)
|
||||
|
||||
target_link_libraries (arch PUBLIC common)
|
||||
|
||||
if(UNIX)
|
||||
target_link_libraries(arch ${libs})
|
||||
target_link_libraries(arch PUBLIC ${libs})
|
||||
endif()
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
@ -7,10 +8,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/IInterface.h"
|
||||
|
||||
#include <QString>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
//! Interface for architecture dependent daemonizing
|
||||
/*!
|
||||
@ -18,52 +17,18 @@ This interface defines the operations required by deskflow for installing
|
||||
uninstalling daeamons and daemonizing a process. Each architecture must
|
||||
implement this interface.
|
||||
*/
|
||||
class IArchDaemon : public IInterface
|
||||
class IArchDaemon
|
||||
{
|
||||
public:
|
||||
using DaemonFunc = std::function<int(int, const char **)>;
|
||||
|
||||
virtual ~IArchDaemon() = default;
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Install daemon
|
||||
/*!
|
||||
Install a daemon. \c name is the name of the daemon passed to the
|
||||
system and \c description is a short human readable description of
|
||||
the daemon. \c pathname is the path to the daemon executable.
|
||||
\c commandLine should \b not include the name of program as the
|
||||
first argument. If \c allUsers is true then the daemon will be
|
||||
installed to start at boot time, otherwise it will be installed to
|
||||
start when the current user logs in. If \p dependencies is not nullptr
|
||||
then it's a concatenation of NUL terminated other daemon names
|
||||
followed by a NUL; the daemon will be configured to startup after
|
||||
the listed daemons. Throws an \c XArchDaemon exception on failure.
|
||||
*/
|
||||
virtual void installDaemon(
|
||||
const char *name, const char *description, const char *pathname, const char *commandLine, const char *dependencies
|
||||
) = 0;
|
||||
|
||||
//! Uninstall daemon
|
||||
/*!
|
||||
Uninstall a daemon. Throws an \c XArchDaemon on failure.
|
||||
*/
|
||||
virtual void uninstallDaemon(const char *name) = 0;
|
||||
|
||||
//! Install daemon
|
||||
/*!
|
||||
Installs the default daemon.
|
||||
*/
|
||||
virtual void installDaemon() = 0;
|
||||
|
||||
//! Uninstall daemon
|
||||
/*!
|
||||
Uninstalls the default daemon.
|
||||
*/
|
||||
virtual void uninstallDaemon() = 0;
|
||||
|
||||
//! Daemonize the process
|
||||
/*!
|
||||
Daemonize. Throw XArchDaemonFailed on error. \c name is the name
|
||||
Daemonize. Throw ArchDaemonFailedException on error. \c name is the name
|
||||
of the daemon. Once daemonized, \c func is invoked and daemonize
|
||||
returns when and what it does.
|
||||
|
||||
@ -88,23 +53,7 @@ public:
|
||||
\c ArchMiscWindows::daemonFailed() to indicate startup failure.
|
||||
</ul>
|
||||
*/
|
||||
virtual int daemonize(const char *name, DaemonFunc const &func) = 0;
|
||||
|
||||
//! Check if user has permission to install the daemon
|
||||
/*!
|
||||
Returns true iff the caller has permission to install or
|
||||
uninstall the daemon. Note that even if this method returns
|
||||
true it's possible that installing/uninstalling the service
|
||||
may still fail. This method ignores whether or not the
|
||||
service is already installed.
|
||||
*/
|
||||
virtual bool canInstallDaemon(const char *name) = 0;
|
||||
|
||||
//! Check if the daemon is installed
|
||||
/*!
|
||||
Returns true iff the daemon is installed.
|
||||
*/
|
||||
virtual bool isDaemonInstalled(const char *name) = 0;
|
||||
virtual int daemonize(const QString &name, DaemonFunc const &func) = 0;
|
||||
|
||||
//@}
|
||||
|
||||
@ -112,7 +61,7 @@ public:
|
||||
/*!
|
||||
Gets the command line with which the application was started.
|
||||
*/
|
||||
virtual std::string commandLine() const = 0;
|
||||
virtual QString commandLine() const = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
@ -7,17 +8,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "base/ELevel.h"
|
||||
#include "common/IInterface.h"
|
||||
#include <QString>
|
||||
|
||||
#include "base/LogLevel.h"
|
||||
|
||||
//! Interface for architecture dependent logging
|
||||
/*!
|
||||
This interface defines the logging operations required by
|
||||
deskflow. Each architecture must implement this interface.
|
||||
*/
|
||||
class IArchLog : public IInterface
|
||||
class IArchLog
|
||||
{
|
||||
public:
|
||||
virtual ~IArchLog() = default;
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
@ -26,7 +29,7 @@ public:
|
||||
Opens the log for writing. The log must be opened before being
|
||||
written to.
|
||||
*/
|
||||
virtual void openLog(const char *name) = 0;
|
||||
virtual void openLog(const QString &name) = 0;
|
||||
|
||||
//! Close the log
|
||||
/*!
|
||||
@ -47,7 +50,6 @@ public:
|
||||
/*!
|
||||
Writes the given string to the log with the given level.
|
||||
*/
|
||||
virtual void writeLog(ELevel, const char *) = 0;
|
||||
|
||||
virtual void writeLog(LogLevel, const QString &) = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
@ -7,7 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/IInterface.h"
|
||||
#include <cstdint>
|
||||
|
||||
/*!
|
||||
\class ArchCondImpl
|
||||
@ -57,28 +58,30 @@ using ArchThread = ArchThreadImpl *;
|
||||
This interface defines the multithreading operations required by
|
||||
deskflow. Each architecture must implement this interface.
|
||||
*/
|
||||
class IArchMultithread : public IInterface
|
||||
class IArchMultithread
|
||||
{
|
||||
public:
|
||||
//! Type of thread entry point
|
||||
using ThreadFunc = void *(*)(void *);
|
||||
//! Type of thread identifier
|
||||
using ThreadID = unsigned int;
|
||||
|
||||
virtual ~IArchMultithread() = default;
|
||||
//! Types of signals
|
||||
/*!
|
||||
Not all platforms support all signals. Unsupported signals are
|
||||
ignored.
|
||||
*/
|
||||
enum ESignal
|
||||
enum class ThreadSignal : uint8_t
|
||||
{
|
||||
kINTERRUPT, //!< Interrupt (e.g. Ctrl+C)
|
||||
kTERMINATE, //!< Terminate (e.g. Ctrl+Break)
|
||||
kHANGUP, //!< Hangup (SIGHUP)
|
||||
kUSER, //!< User (SIGUSR2)
|
||||
kNUM_SIGNALS
|
||||
Interrupt, //!< Interrupt (e.g. Ctrl+C)
|
||||
Terminate, //!< Terminate (e.g. Ctrl+Break)
|
||||
Hangup, //!< Hangup (SIGHUP)
|
||||
User, //!< User (SIGUSR2)
|
||||
MaxSignals //!< Number of differnt signals
|
||||
};
|
||||
//! Type of signal handler function
|
||||
using SignalFunc = void (*)(ESignal, void *userData);
|
||||
using SignalFunc = void (*)(ThreadSignal, void *userData);
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
@ -249,15 +252,15 @@ public:
|
||||
Sets the function to call on receipt of an external interrupt.
|
||||
By default and when \p func is nullptr, the main thread is cancelled.
|
||||
*/
|
||||
virtual void setSignalHandler(ESignal, SignalFunc func, void *userData) = 0;
|
||||
virtual void setSignalHandler(ThreadSignal, SignalFunc func, void *userData) = 0;
|
||||
|
||||
//! Invoke the signal handler
|
||||
/*!
|
||||
Invokes the signal handler for \p signal, if any. If no handler
|
||||
cancels the main thread for \c kINTERRUPT and \c kTERMINATE and
|
||||
cancels the main thread for \c ThreadSignal::Interrupt and \c ThreadSignal::Terminate and
|
||||
ignores the call otherwise.
|
||||
*/
|
||||
virtual void raiseSignal(ESignal signal) = 0;
|
||||
virtual void raiseSignal(ThreadSignal signal) = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
@ -7,9 +8,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/IInterface.h"
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class ArchThreadImpl;
|
||||
@ -49,22 +49,23 @@ using ArchNetAddress = ArchNetAddressImpl *;
|
||||
This interface defines the networking operations required by
|
||||
deskflow. Each architecture must implement this interface.
|
||||
*/
|
||||
class IArchNetwork : public IInterface
|
||||
class IArchNetwork
|
||||
{
|
||||
public:
|
||||
virtual ~IArchNetwork() = default;
|
||||
//! Supported address families
|
||||
enum EAddressFamily
|
||||
enum class AddressFamily : uint8_t
|
||||
{
|
||||
kUNKNOWN,
|
||||
kINET,
|
||||
kINET6,
|
||||
Unknown,
|
||||
INet,
|
||||
INet6
|
||||
};
|
||||
|
||||
//! Supported socket types
|
||||
enum ESocketType
|
||||
enum class SocketType : uint8_t
|
||||
{
|
||||
kDGRAM,
|
||||
kSTREAM
|
||||
DataGram,
|
||||
Stream
|
||||
};
|
||||
|
||||
//! Events for \c poll()
|
||||
@ -72,12 +73,12 @@ public:
|
||||
Events for \c poll() are bitmasks and can be combined using the
|
||||
bitwise operators.
|
||||
*/
|
||||
enum
|
||||
struct PollEventMask
|
||||
{
|
||||
kPOLLIN = 1, //!< Socket is readable
|
||||
kPOLLOUT = 2, //!< Socket is writable
|
||||
kPOLLERR = 4, //!< The socket is in an error state
|
||||
kPOLLNVAL = 8 //!< The socket is invalid
|
||||
inline static const int In = 1; //!< Socket is readable
|
||||
inline static const int Out = 2; //!< Socket is writable
|
||||
inline static const int Error = 4; //!< The socket is in an error state
|
||||
inline static const int Invalid = 8; //!< The socket is invalid
|
||||
};
|
||||
|
||||
//! A socket query for \c poll()
|
||||
@ -89,8 +90,7 @@ public:
|
||||
|
||||
//! The events to query for
|
||||
/*!
|
||||
The events to query for can be any combination of kPOLLIN and
|
||||
kPOLLOUT.
|
||||
The events to query for can be any combination of PollEventMask::In and PollEventMask::Out.
|
||||
*/
|
||||
unsigned short m_events;
|
||||
|
||||
@ -105,7 +105,7 @@ public:
|
||||
/*!
|
||||
The socket is an opaque data type.
|
||||
*/
|
||||
virtual ArchSocket newSocket(EAddressFamily, ESocketType) = 0;
|
||||
virtual ArchSocket newSocket(AddressFamily, SocketType) = 0;
|
||||
|
||||
//! Copy a socket object
|
||||
/*!
|
||||
@ -175,9 +175,9 @@ public:
|
||||
and/or writable (or indefinitely if \c timeout < 0). Returns the
|
||||
number of sockets that were readable (if readability was being
|
||||
queried) or writable (if writablility was being queried) and sets
|
||||
the \c m_revents members of the entries. \c kPOLLERR and \c kPOLLNVAL
|
||||
the \c m_revents members of the entries. \c PollEventMask::Error and \c PollEventMask::Invalid
|
||||
are set in \c m_revents as appropriate. If a socket indicates
|
||||
\c kPOLLERR then \c throwErrorOnSocket() can be used to determine
|
||||
\c PollEventMask::Error then \c throwErrorOnSocket() can be used to determine
|
||||
the type of error. Returns 0 immediately regardless of the \c timeout
|
||||
if no valid sockets are selected for testing.
|
||||
|
||||
@ -214,7 +214,7 @@ public:
|
||||
//! Check error on socket
|
||||
/*!
|
||||
If the socket \c s is in an error state then throws an appropriate
|
||||
XArchNetwork exception.
|
||||
ArchNetworkException exception.
|
||||
*/
|
||||
virtual void throwErrorOnSocket(ArchSocket s) = 0;
|
||||
|
||||
@ -232,11 +232,8 @@ public:
|
||||
*/
|
||||
virtual bool setReuseAddrOnSocket(ArchSocket, bool reuse) = 0;
|
||||
|
||||
//! Return local host's name
|
||||
virtual std::string getHostName() = 0;
|
||||
|
||||
//! Create an "any" network address
|
||||
virtual ArchNetAddress newAnyAddr(EAddressFamily) = 0;
|
||||
virtual ArchNetAddress newAnyAddr(AddressFamily) = 0;
|
||||
|
||||
//! Copy a network address
|
||||
virtual ArchNetAddress copyAddr(ArchNetAddress) = 0;
|
||||
@ -254,7 +251,7 @@ public:
|
||||
virtual std::string addrToString(ArchNetAddress) = 0;
|
||||
|
||||
//! Get an address's family
|
||||
virtual EAddressFamily getAddrFamily(ArchNetAddress) = 0;
|
||||
virtual AddressFamily getAddrFamily(ArchNetAddress) = 0;
|
||||
|
||||
//! Set the port of an address
|
||||
virtual void setAddrPort(ArchNetAddress, int port) = 0;
|
||||
@ -275,4 +272,15 @@ public:
|
||||
//@}
|
||||
|
||||
virtual void init() = 0;
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief throwError, Used to throw network errors
|
||||
*/
|
||||
[[noreturn]] virtual void throwError(int) const = 0;
|
||||
|
||||
/**
|
||||
* @brief throwNameError, Errors related to client names.
|
||||
*/
|
||||
[[noreturn]] virtual void throwNameError(int) const = 0;
|
||||
};
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/IInterface.h"
|
||||
|
||||
//! Interface for architecture dependent sleeping
|
||||
/*!
|
||||
This interface defines the sleep operations required by
|
||||
deskflow. Each architecture must implement this interface.
|
||||
*/
|
||||
class IArchSleep : public IInterface
|
||||
{
|
||||
public:
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Sleep
|
||||
/*!
|
||||
Blocks the calling thread for \c timeout seconds. If
|
||||
\c timeout < 0.0 then the call returns immediately. If \c timeout
|
||||
== 0.0 then the calling thread yields the CPU.
|
||||
|
||||
(cancellation point)
|
||||
*/
|
||||
virtual void sleep(double timeout) = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/IInterface.h"
|
||||
|
||||
//! Interface for architecture dependent time operations
|
||||
/*!
|
||||
This interface defines the time operations required by
|
||||
deskflow. Each architecture must implement this interface.
|
||||
*/
|
||||
class IArchTime : public IInterface
|
||||
{
|
||||
public:
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Get the current time
|
||||
/*!
|
||||
Returns the number of seconds since some arbitrary starting time.
|
||||
This should return as high a precision as reasonable.
|
||||
*/
|
||||
virtual double time() = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
@ -1,205 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/Common.h"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
//! Generic thread exception
|
||||
/*!
|
||||
Exceptions derived from this class are used by the multithreading
|
||||
library to perform stack unwinding when a thread terminates. These
|
||||
exceptions must always be rethrown by clients when caught.
|
||||
*/
|
||||
class XThread : public std::exception
|
||||
{
|
||||
};
|
||||
|
||||
//! Thread exception to cancel
|
||||
/*!
|
||||
Thrown to cancel a thread. Clients must not throw this type, but
|
||||
must rethrow it if caught (by XThreadCancel, XThread, or ...).
|
||||
*/
|
||||
class XThreadCancel : public XThread
|
||||
{
|
||||
};
|
||||
|
||||
/*!
|
||||
\def RETHROW_XTHREAD
|
||||
Convenience macro to rethrow an XThread exception but ignore other
|
||||
exceptions. Put this in your catch (...) handler after necessary
|
||||
cleanup but before leaving or returning from the handler.
|
||||
*/
|
||||
#define RETHROW_XTHREAD \
|
||||
try { \
|
||||
throw; \
|
||||
} catch (XThread &) { \
|
||||
throw; \
|
||||
} catch (...) { \
|
||||
}
|
||||
|
||||
//! Generic network exception
|
||||
/*!
|
||||
Exceptions derived from this class are used by the networking
|
||||
library to indicate various errors.
|
||||
*/
|
||||
class XArchNetwork : public std::runtime_error
|
||||
{
|
||||
using std::runtime_error::runtime_error;
|
||||
};
|
||||
|
||||
//! Operation was interrupted
|
||||
class XArchNetworkInterrupted : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Network insufficient permission
|
||||
class XArchNetworkAccess : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Network insufficient resources
|
||||
class XArchNetworkResource : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! No support for requested network resource/service
|
||||
class XArchNetworkSupport : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Network I/O error
|
||||
class XArchNetworkIO : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Network address is unavailable or not local
|
||||
class XArchNetworkNoAddress : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Network address in use
|
||||
class XArchNetworkAddressInUse : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! No route to address
|
||||
class XArchNetworkNoRoute : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Socket not connected
|
||||
class XArchNetworkNotConnected : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Remote read end of socket has closed
|
||||
class XArchNetworkShutdown : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Remote end of socket has disconnected
|
||||
class XArchNetworkDisconnected : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Remote end of socket refused connection
|
||||
class XArchNetworkConnectionRefused : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Remote end of socket is not responding
|
||||
class XArchNetworkTimedOut : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! Generic network name lookup erros
|
||||
class XArchNetworkName : public XArchNetwork
|
||||
{
|
||||
using XArchNetwork::XArchNetwork;
|
||||
};
|
||||
|
||||
//! The named host is unknown
|
||||
class XArchNetworkNameUnknown : public XArchNetworkName
|
||||
{
|
||||
using XArchNetworkName::XArchNetworkName;
|
||||
};
|
||||
|
||||
//! The named host is known but has no address
|
||||
class XArchNetworkNameNoAddress : public XArchNetworkName
|
||||
{
|
||||
using XArchNetworkName::XArchNetworkName;
|
||||
};
|
||||
|
||||
//! Non-recoverable name server error
|
||||
class XArchNetworkNameFailure : public XArchNetworkName
|
||||
{
|
||||
using XArchNetworkName::XArchNetworkName;
|
||||
};
|
||||
|
||||
//! Temporary name server error
|
||||
class XArchNetworkNameUnavailable : public XArchNetworkName
|
||||
{
|
||||
using XArchNetworkName::XArchNetworkName;
|
||||
};
|
||||
|
||||
//! The named host is known but no supported address
|
||||
class XArchNetworkNameUnsupported : public XArchNetworkName
|
||||
{
|
||||
using XArchNetworkName::XArchNetworkName;
|
||||
};
|
||||
|
||||
//! Generic daemon exception
|
||||
/*!
|
||||
Exceptions derived from this class are used by the daemon
|
||||
library to indicate various errors.
|
||||
*/
|
||||
class XArchDaemon : public std::runtime_error
|
||||
{
|
||||
using std::runtime_error::runtime_error;
|
||||
};
|
||||
|
||||
//! Could not daemonize
|
||||
class XArchDaemonFailed : public XArchDaemon
|
||||
{
|
||||
using XArchDaemon::XArchDaemon;
|
||||
};
|
||||
|
||||
//! Could not install daemon
|
||||
class XArchDaemonInstallFailed : public XArchDaemon
|
||||
{
|
||||
using XArchDaemon::XArchDaemon;
|
||||
};
|
||||
|
||||
//! Could not uninstall daemon
|
||||
class XArchDaemonUninstallFailed : public XArchDaemon
|
||||
{
|
||||
using XArchDaemon::XArchDaemon;
|
||||
};
|
||||
|
||||
//! Attempted to uninstall a daemon that was not installed
|
||||
class XArchDaemonUninstallNotInstalled : public XArchDaemonFailed
|
||||
{
|
||||
using XArchDaemonFailed::XArchDaemonFailed;
|
||||
};
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
#include "arch/unix/ArchDaemonUnix.h"
|
||||
|
||||
#include "arch/XArch.h"
|
||||
#include "arch/ArchException.h"
|
||||
#include "arch/unix/XArchUnix.h"
|
||||
#include "base/Log.h"
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <QString>
|
||||
//
|
||||
// ArchDaemonUnix
|
||||
//
|
||||
@ -41,16 +42,19 @@ int execSelfNonDaemonized()
|
||||
|
||||
bool alreadyDaemonized()
|
||||
{
|
||||
return getenv("_DESKFLOW_DAEMONIZED") != nullptr;
|
||||
return std::getenv("_DESKFLOW_DAEMONIZED") != nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int ArchDaemonUnix::daemonize(const char *name, DaemonFunc const &func)
|
||||
int ArchDaemonUnix::daemonize(const QString &name, DaemonFunc const &func)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (alreadyDaemonized())
|
||||
return func(1, &name);
|
||||
if (alreadyDaemonized()) {
|
||||
auto t = name.toStdString();
|
||||
const char *n = t.c_str();
|
||||
return func(1, &n);
|
||||
}
|
||||
#endif
|
||||
|
||||
// fork so shell thinks we're done and so we're not a process
|
||||
@ -58,7 +62,7 @@ int ArchDaemonUnix::daemonize(const char *name, DaemonFunc const &func)
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
// failed
|
||||
throw XArchDaemonFailed(errorToString(errno));
|
||||
throw ArchDaemonFailedException(errorToString(errno));
|
||||
|
||||
case 0:
|
||||
// child
|
||||
@ -78,7 +82,7 @@ int ArchDaemonUnix::daemonize(const char *name, DaemonFunc const &func)
|
||||
// TODO: this is a bit of a hack - can we find a better solution?
|
||||
if (int chdirErr = chdir("/"); chdirErr)
|
||||
// NB: file logging actually isn't working at this point!
|
||||
LOG((CLOG_ERR "chdir error: %i", chdirErr));
|
||||
LOG_ERR("chdir error: %i", chdirErr);
|
||||
#endif
|
||||
|
||||
// mask off permissions for any but owner
|
||||
@ -96,7 +100,7 @@ int ArchDaemonUnix::daemonize(const char *name, DaemonFunc const &func)
|
||||
|
||||
if (int dupErr = dup(1); dupErr < 0) {
|
||||
// NB: file logging actually isn't working at this point!
|
||||
LOG((CLOG_ERR "dup error: %i", dupErr));
|
||||
LOG_ERR("dup error: %i", dupErr);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
@ -104,5 +108,8 @@ int ArchDaemonUnix::daemonize(const char *name, DaemonFunc const &func)
|
||||
#endif
|
||||
|
||||
// invoke function
|
||||
return func(1, &name);
|
||||
|
||||
auto t = name.toStdString();
|
||||
const char *n = t.c_str();
|
||||
return func(1, &n);
|
||||
}
|
||||
|
||||
@ -20,5 +20,5 @@ public:
|
||||
~ArchDaemonUnix() override = default;
|
||||
|
||||
// IArchDaemon overrides
|
||||
int daemonize(const char *name, DaemonFunc const &func) override;
|
||||
int daemonize(const QString &name, DaemonFunc const &func) override;
|
||||
};
|
||||
|
||||
@ -7,15 +7,15 @@
|
||||
|
||||
#include "arch/unix/ArchLogUnix.h"
|
||||
|
||||
#include <QString>
|
||||
#include <syslog.h>
|
||||
|
||||
//
|
||||
// ArchLogUnix
|
||||
//
|
||||
|
||||
void ArchLogUnix::openLog(const char *name)
|
||||
void ArchLogUnix::openLog(const QString &name)
|
||||
{
|
||||
openlog(name, 0, LOG_DAEMON);
|
||||
openlog(qPrintable(name), 0, LOG_DAEMON);
|
||||
}
|
||||
|
||||
void ArchLogUnix::closeLog()
|
||||
@ -28,24 +28,25 @@ void ArchLogUnix::showLog(bool)
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void ArchLogUnix::writeLog(ELevel level, const char *msg)
|
||||
void ArchLogUnix::writeLog(LogLevel level, const QString &msg)
|
||||
{
|
||||
// convert level
|
||||
int priority;
|
||||
switch (level) {
|
||||
case kERROR:
|
||||
using enum LogLevel;
|
||||
case Error:
|
||||
priority = LOG_ERR;
|
||||
break;
|
||||
|
||||
case kWARNING:
|
||||
case Warning:
|
||||
priority = LOG_WARNING;
|
||||
break;
|
||||
|
||||
case kNOTE:
|
||||
case Note:
|
||||
priority = LOG_NOTICE;
|
||||
break;
|
||||
|
||||
case kINFO:
|
||||
case Info:
|
||||
priority = LOG_INFO;
|
||||
break;
|
||||
|
||||
@ -55,5 +56,5 @@ void ArchLogUnix::writeLog(ELevel level, const char *msg)
|
||||
}
|
||||
|
||||
// log it
|
||||
syslog(priority, "%s", msg);
|
||||
syslog(priority, "%s", qPrintable(msg));
|
||||
}
|
||||
|
||||
@ -19,8 +19,8 @@ public:
|
||||
~ArchLogUnix() override = default;
|
||||
|
||||
// IArchLog overrides
|
||||
void openLog(const char *name) override;
|
||||
void openLog(const QString &name) override;
|
||||
void closeLog() override;
|
||||
void showLog(bool) override;
|
||||
void writeLog(ELevel, const char *) override;
|
||||
void writeLog(LogLevel, const QString &) override;
|
||||
};
|
||||
|
||||
@ -8,34 +8,15 @@
|
||||
#include "arch/unix/ArchMultithreadPosix.h"
|
||||
|
||||
#include "arch/Arch.h"
|
||||
#include "arch/XArch.h"
|
||||
#include "arch/ArchException.h"
|
||||
|
||||
#include <signal.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#else
|
||||
#if HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <cerrno>
|
||||
#include <signal.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
#define SIGWAKEUP SIGUSR1
|
||||
|
||||
#if !HAVE_PTHREAD_SIGNAL
|
||||
// boy, is this platform broken. forget about pthread signal
|
||||
// handling and let signals through to every process. deskflow
|
||||
// will not terminate cleanly when it gets SIGTERM or SIGINT.
|
||||
#define pthread_sigmask sigprocmask
|
||||
#define pthread_kill(tid_, sig_) kill(0, (sig_))
|
||||
#define sigwait(set_, sig_)
|
||||
#undef HAVE_POSIX_SIGWAIT
|
||||
#define HAVE_POSIX_SIGWAIT 1
|
||||
#endif
|
||||
|
||||
static void setSignalSet(sigset_t *sigset)
|
||||
{
|
||||
sigemptyset(sigset);
|
||||
@ -80,14 +61,11 @@ ArchMultithreadPosix::ArchMultithreadPosix()
|
||||
s_instance = this;
|
||||
|
||||
// no signal handlers
|
||||
for (size_t i = 0; i < kNUM_SIGNALS; ++i) {
|
||||
for (size_t i = 0; i < static_cast<size_t>(ThreadSignal::MaxSignals); ++i) {
|
||||
m_signalFunc[i] = nullptr;
|
||||
m_signalUserData[i] = nullptr;
|
||||
}
|
||||
|
||||
// create mutex for thread list
|
||||
m_threadMutex = newMutex();
|
||||
|
||||
// create thread for calling (main) thread and add it to our
|
||||
// list. no need to lock the mutex since we're the only thread.
|
||||
m_mainThread = new ArchThreadImpl;
|
||||
@ -123,25 +101,20 @@ ArchMultithreadPosix::ArchMultithreadPosix()
|
||||
ArchMultithreadPosix::~ArchMultithreadPosix()
|
||||
{
|
||||
assert(s_instance != nullptr);
|
||||
|
||||
closeMutex(m_threadMutex);
|
||||
s_instance = nullptr;
|
||||
}
|
||||
|
||||
void ArchMultithreadPosix::setNetworkDataForCurrentThread(void *data)
|
||||
{
|
||||
lockMutex(m_threadMutex);
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
ArchThreadImpl *thread = find(pthread_self());
|
||||
thread->m_networkData = data;
|
||||
unlockMutex(m_threadMutex);
|
||||
}
|
||||
|
||||
void *ArchMultithreadPosix::getNetworkDataForThread(ArchThread thread)
|
||||
{
|
||||
lockMutex(m_threadMutex);
|
||||
void *data = thread->m_networkData;
|
||||
unlockMutex(m_threadMutex);
|
||||
return data;
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
return thread->m_networkData;
|
||||
}
|
||||
|
||||
ArchMultithreadPosix *ArchMultithreadPosix::getInstance()
|
||||
@ -308,12 +281,11 @@ ArchThread ArchMultithreadPosix::newThread(ThreadFunc func, void *data)
|
||||
// can't tell the difference.
|
||||
if (!m_newThreadCalled) {
|
||||
m_newThreadCalled = true;
|
||||
#if HAVE_PTHREAD_SIGNAL
|
||||
startSignalHandler();
|
||||
#endif
|
||||
}
|
||||
|
||||
lockMutex(m_threadMutex);
|
||||
// note that the child thread will wait until we release this mutex
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
|
||||
// create thread impl for new thread
|
||||
auto *thread = new ArchThreadImpl;
|
||||
@ -342,17 +314,13 @@ ArchThread ArchMultithreadPosix::newThread(ThreadFunc func, void *data)
|
||||
refThread(thread);
|
||||
}
|
||||
|
||||
// note that the child thread will wait until we release this mutex
|
||||
unlockMutex(m_threadMutex);
|
||||
|
||||
return thread;
|
||||
}
|
||||
|
||||
ArchThread ArchMultithreadPosix::newCurrentThread()
|
||||
{
|
||||
lockMutex(m_threadMutex);
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
ArchThreadImpl *thread = find(pthread_self());
|
||||
unlockMutex(m_threadMutex);
|
||||
assert(thread != nullptr);
|
||||
return thread;
|
||||
}
|
||||
@ -369,10 +337,11 @@ void ArchMultithreadPosix::closeThread(ArchThread thread)
|
||||
}
|
||||
|
||||
// remove thread from list
|
||||
lockMutex(m_threadMutex);
|
||||
assert(findNoRef(thread->m_thread) == thread);
|
||||
erase(thread);
|
||||
unlockMutex(m_threadMutex);
|
||||
{
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
assert(findNoRef(thread->m_thread) == thread);
|
||||
erase(thread);
|
||||
}
|
||||
|
||||
// done with thread
|
||||
delete thread;
|
||||
@ -391,12 +360,14 @@ void ArchMultithreadPosix::cancelThread(ArchThread thread)
|
||||
|
||||
// set cancel and wakeup flags if thread can be cancelled
|
||||
bool wakeup = false;
|
||||
lockMutex(m_threadMutex);
|
||||
if (!thread->m_exited && !thread->m_cancelling) {
|
||||
thread->m_cancel = true;
|
||||
wakeup = true;
|
||||
|
||||
{
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
if (!thread->m_exited && !thread->m_cancelling) {
|
||||
thread->m_cancel = true;
|
||||
wakeup = true;
|
||||
}
|
||||
}
|
||||
unlockMutex(m_threadMutex);
|
||||
|
||||
// force thread to exit system calls if wakeup is true
|
||||
if (wakeup) {
|
||||
@ -414,10 +385,11 @@ void ArchMultithreadPosix::setPriorityOfThread(ArchThread thread, int /*n*/)
|
||||
void ArchMultithreadPosix::testCancelThread()
|
||||
{
|
||||
// find current thread
|
||||
lockMutex(m_threadMutex);
|
||||
ArchThreadImpl *thread = findNoRef(pthread_self());
|
||||
unlockMutex(m_threadMutex);
|
||||
|
||||
ArchThreadImpl *thread = nullptr;
|
||||
{
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
thread = findNoRef(pthread_self());
|
||||
}
|
||||
// test cancel on thread
|
||||
testCancelThreadImpl(thread);
|
||||
}
|
||||
@ -426,22 +398,19 @@ bool ArchMultithreadPosix::wait(ArchThread target, double timeout)
|
||||
{
|
||||
assert(target != nullptr);
|
||||
|
||||
lockMutex(m_threadMutex);
|
||||
|
||||
// find current thread
|
||||
ArchThreadImpl *self = findNoRef(pthread_self());
|
||||
|
||||
// ignore wait if trying to wait on ourself
|
||||
if (target == self) {
|
||||
unlockMutex(m_threadMutex);
|
||||
return false;
|
||||
ArchThreadImpl *self = nullptr;
|
||||
{
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
// find current thread
|
||||
self = findNoRef(pthread_self());
|
||||
// ignore wait if trying to wait on ourself
|
||||
if (target == self) {
|
||||
return false;
|
||||
}
|
||||
// ref the target so it can't go away while we're watching it
|
||||
refThread(target);
|
||||
}
|
||||
|
||||
// ref the target so it can't go away while we're watching it
|
||||
refThread(target);
|
||||
|
||||
unlockMutex(m_threadMutex);
|
||||
|
||||
try {
|
||||
// do first test regardless of timeout
|
||||
testCancelThreadImpl(self);
|
||||
@ -452,10 +421,10 @@ bool ArchMultithreadPosix::wait(ArchThread target, double timeout)
|
||||
|
||||
// wait and repeat test if there's a timeout
|
||||
if (timeout != 0.0) {
|
||||
const double start = ARCH->time();
|
||||
const double start = Arch::time();
|
||||
do {
|
||||
// wait a little
|
||||
ARCH->sleep(0.05);
|
||||
Arch::sleep(0.05);
|
||||
|
||||
// repeat test
|
||||
testCancelThreadImpl(self);
|
||||
@ -465,7 +434,7 @@ bool ArchMultithreadPosix::wait(ArchThread target, double timeout)
|
||||
}
|
||||
|
||||
// repeat wait and test until timed out
|
||||
} while (timeout < 0.0 || (ARCH->time() - start) <= timeout);
|
||||
} while (timeout < 0.0 || (Arch::time() - start) <= timeout);
|
||||
}
|
||||
|
||||
closeThread(target);
|
||||
@ -483,18 +452,14 @@ bool ArchMultithreadPosix::isSameThread(ArchThread thread1, ArchThread thread2)
|
||||
|
||||
bool ArchMultithreadPosix::isExitedThread(ArchThread thread)
|
||||
{
|
||||
lockMutex(m_threadMutex);
|
||||
bool exited = thread->m_exited;
|
||||
unlockMutex(m_threadMutex);
|
||||
return exited;
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
return thread->m_exited;
|
||||
}
|
||||
|
||||
void *ArchMultithreadPosix::getResultOfThread(ArchThread thread)
|
||||
{
|
||||
lockMutex(m_threadMutex);
|
||||
void *result = thread->m_result;
|
||||
unlockMutex(m_threadMutex);
|
||||
return result;
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
return thread->m_result;
|
||||
}
|
||||
|
||||
IArchMultithread::ThreadID ArchMultithreadPosix::getIDOfThread(ArchThread thread)
|
||||
@ -502,24 +467,26 @@ IArchMultithread::ThreadID ArchMultithreadPosix::getIDOfThread(ArchThread thread
|
||||
return thread->m_id;
|
||||
}
|
||||
|
||||
void ArchMultithreadPosix::setSignalHandler(ESignal signal, SignalFunc func, void *userData)
|
||||
void ArchMultithreadPosix::setSignalHandler(ThreadSignal signal, SignalFunc func, void *userData)
|
||||
{
|
||||
lockMutex(m_threadMutex);
|
||||
m_signalFunc[signal] = func;
|
||||
m_signalUserData[signal] = userData;
|
||||
unlockMutex(m_threadMutex);
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
const auto index = static_cast<int>(signal);
|
||||
m_signalFunc[index] = func;
|
||||
m_signalUserData[index] = userData;
|
||||
}
|
||||
|
||||
void ArchMultithreadPosix::raiseSignal(ESignal signal)
|
||||
void ArchMultithreadPosix::raiseSignal(ThreadSignal signal)
|
||||
{
|
||||
lockMutex(m_threadMutex);
|
||||
if (m_signalFunc[signal] != nullptr) {
|
||||
m_signalFunc[signal](signal, m_signalUserData[signal]);
|
||||
using enum ThreadSignal;
|
||||
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
const auto index = static_cast<int>(signal);
|
||||
if (m_signalFunc[index] != nullptr) {
|
||||
m_signalFunc[index](signal, m_signalUserData[index]);
|
||||
pthread_kill(m_mainThread->m_thread, SIGWAKEUP);
|
||||
} else if (signal == kINTERRUPT || signal == kTERMINATE) {
|
||||
} else if (signal == Interrupt || signal == Terminate) {
|
||||
ARCH->cancelThread(m_mainThread);
|
||||
}
|
||||
unlockMutex(m_threadMutex);
|
||||
}
|
||||
|
||||
void ArchMultithreadPosix::startSignalHandler()
|
||||
@ -607,18 +574,17 @@ void ArchMultithreadPosix::testCancelThreadImpl(ArchThreadImpl *thread)
|
||||
assert(thread != nullptr);
|
||||
|
||||
// update cancel state
|
||||
lockMutex(m_threadMutex);
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
bool cancel = false;
|
||||
if (thread->m_cancel && !thread->m_cancelling) {
|
||||
thread->m_cancelling = true;
|
||||
thread->m_cancel = false;
|
||||
cancel = true;
|
||||
}
|
||||
unlockMutex(m_threadMutex);
|
||||
|
||||
// unwind thread's stack if cancelling
|
||||
if (cancel) {
|
||||
throw XThreadCancel();
|
||||
throw ThreadCancelException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -644,8 +610,9 @@ void ArchMultithreadPosix::doThreadFunc(ArchThread thread)
|
||||
setPriorityOfThread(thread, 1);
|
||||
|
||||
// wait for parent to initialize this object
|
||||
lockMutex(m_threadMutex);
|
||||
unlockMutex(m_threadMutex);
|
||||
{
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
}
|
||||
|
||||
void *result = nullptr;
|
||||
try {
|
||||
@ -653,24 +620,26 @@ void ArchMultithreadPosix::doThreadFunc(ArchThread thread)
|
||||
result = (*thread->m_func)(thread->m_userData);
|
||||
}
|
||||
|
||||
catch (XThreadCancel &) {
|
||||
catch (ThreadCancelException &) {
|
||||
// client called cancel()
|
||||
// set base value
|
||||
result = nullptr;
|
||||
} catch (...) {
|
||||
// note -- don't catch (...) to avoid masking bugs
|
||||
lockMutex(m_threadMutex);
|
||||
thread->m_exited = true;
|
||||
unlockMutex(m_threadMutex);
|
||||
{
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
thread->m_exited = true;
|
||||
}
|
||||
closeThread(thread);
|
||||
throw;
|
||||
}
|
||||
|
||||
// thread has exited
|
||||
lockMutex(m_threadMutex);
|
||||
thread->m_result = result;
|
||||
thread->m_exited = true;
|
||||
unlockMutex(m_threadMutex);
|
||||
{
|
||||
std::scoped_lock lock{m_threadMutex};
|
||||
thread->m_result = result;
|
||||
thread->m_exited = true;
|
||||
}
|
||||
|
||||
// done with thread
|
||||
closeThread(thread);
|
||||
@ -712,20 +681,21 @@ void *ArchMultithreadPosix::threadSignalHandler(void *)
|
||||
|
||||
// if we get here then the signal was raised
|
||||
switch (signal) {
|
||||
using enum ThreadSignal;
|
||||
case SIGINT:
|
||||
ARCH->raiseSignal(kINTERRUPT);
|
||||
ARCH->raiseSignal(Interrupt);
|
||||
break;
|
||||
|
||||
case SIGTERM:
|
||||
ARCH->raiseSignal(kTERMINATE);
|
||||
ARCH->raiseSignal(Terminate);
|
||||
break;
|
||||
|
||||
case SIGHUP:
|
||||
ARCH->raiseSignal(kHANGUP);
|
||||
ARCH->raiseSignal(Hangup);
|
||||
break;
|
||||
|
||||
case SIGUSR2:
|
||||
ARCH->raiseSignal(kUSER);
|
||||
ARCH->raiseSignal(User);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
#include "arch/IArchMultithread.h"
|
||||
|
||||
#include <list>
|
||||
#include <mutex>
|
||||
#include <pthread.h>
|
||||
|
||||
#define ARCH_MULTITHREAD ArchMultithreadPosix
|
||||
@ -75,8 +76,8 @@ public:
|
||||
bool isExitedThread(ArchThread) override;
|
||||
void *getResultOfThread(ArchThread) override;
|
||||
ThreadID getIDOfThread(ArchThread) override;
|
||||
void setSignalHandler(ESignal, SignalFunc, void *) override;
|
||||
void raiseSignal(ESignal) override;
|
||||
void setSignalHandler(ThreadSignal, SignalFunc, void *) override;
|
||||
void raiseSignal(ThreadSignal) override;
|
||||
|
||||
private:
|
||||
void startSignalHandler();
|
||||
@ -94,19 +95,18 @@ private:
|
||||
static void threadCancel(int);
|
||||
static void *threadSignalHandler(void *vrep);
|
||||
|
||||
private:
|
||||
using ThreadList = std::list<ArchThread>;
|
||||
|
||||
static ArchMultithreadPosix *s_instance;
|
||||
|
||||
bool m_newThreadCalled = false;
|
||||
|
||||
ArchMutex m_threadMutex;
|
||||
std::mutex m_threadMutex;
|
||||
ArchThread m_mainThread;
|
||||
ThreadList m_threadList;
|
||||
ThreadID m_nextID = 0;
|
||||
|
||||
pthread_t m_signalThread;
|
||||
SignalFunc m_signalFunc[kNUM_SIGNALS];
|
||||
void *m_signalUserData[kNUM_SIGNALS];
|
||||
SignalFunc m_signalFunc[static_cast<int>(ThreadSignal::MaxSignals)];
|
||||
void *m_signalUserData[static_cast<int>(ThreadSignal::MaxSignals)];
|
||||
};
|
||||
|
||||
@ -8,9 +8,10 @@
|
||||
#include "arch/unix/ArchNetworkBSD.h"
|
||||
|
||||
#include "arch/Arch.h"
|
||||
#include "arch/XArch.h"
|
||||
#include "arch/ArchException.h"
|
||||
#include "arch/unix/ArchMultithreadPosix.h"
|
||||
#include "arch/unix/XArchUnix.h"
|
||||
#include "common/Common.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <cstring>
|
||||
@ -18,10 +19,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if !defined(TCP_NODELAY)
|
||||
#include <netinet/tcp.h>
|
||||
@ -66,7 +64,7 @@ static in_addr_t inet_aton(const char *cp, struct in_addr *inp)
|
||||
|
||||
void ArchNetworkBSD::Deps::sleep(double seconds)
|
||||
{
|
||||
ARCH->sleep(seconds);
|
||||
Arch::sleep(seconds);
|
||||
}
|
||||
|
||||
int ArchNetworkBSD::Deps::poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
||||
@ -76,10 +74,7 @@ int ArchNetworkBSD::Deps::poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
||||
|
||||
std::shared_ptr<struct pollfd[]> ArchNetworkBSD::Deps::makePollFD(nfds_t n)
|
||||
{
|
||||
// C++20 supports std::make_shared<struct pollfd[]>(n) but this is not
|
||||
// implemented on the compiler that comes with Ubuntu 22 and a few other
|
||||
// distros, so use the manual new and delete until we drop those distros.
|
||||
return std::shared_ptr<struct pollfd[]>(new struct pollfd[n], std::default_delete<struct pollfd[]>());
|
||||
return std::make_shared<struct pollfd[]>(n);
|
||||
}
|
||||
|
||||
ssize_t ArchNetworkBSD::Deps::read(int fd, void *buf, size_t len)
|
||||
@ -96,22 +91,15 @@ void ArchNetworkBSD::Deps::testCancelThread()
|
||||
// ArchNetworkBSD
|
||||
//
|
||||
|
||||
ArchNetworkBSD::~ArchNetworkBSD()
|
||||
{
|
||||
if (m_mutex)
|
||||
ARCH->closeMutex(m_mutex);
|
||||
}
|
||||
|
||||
void ArchNetworkBSD::init()
|
||||
{
|
||||
// create mutex to make some calls thread safe
|
||||
m_mutex = ARCH->newMutex();
|
||||
// do nothing
|
||||
}
|
||||
|
||||
ArchSocket ArchNetworkBSD::newSocket(EAddressFamily family, ESocketType type)
|
||||
ArchSocket ArchNetworkBSD::newSocket(AddressFamily family, SocketType type)
|
||||
{
|
||||
// create socket
|
||||
int fd = socket(s_family[family], s_type[type], 0);
|
||||
int fd = socket(s_family[static_cast<int>(family)], s_type[static_cast<int>(type)], 0);
|
||||
if (fd == -1) {
|
||||
throwError(errno);
|
||||
}
|
||||
@ -134,9 +122,8 @@ ArchSocket ArchNetworkBSD::copySocket(ArchSocket s)
|
||||
assert(s != nullptr);
|
||||
|
||||
// ref the socket and return it
|
||||
ARCH->lockMutex(m_mutex);
|
||||
std::scoped_lock lock{m_mutex};
|
||||
++s->m_refCount;
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -144,19 +131,22 @@ void ArchNetworkBSD::closeSocket(ArchSocket s)
|
||||
{
|
||||
assert(s != nullptr);
|
||||
|
||||
bool doClose = false;
|
||||
// unref the socket and note if it should be released
|
||||
ARCH->lockMutex(m_mutex);
|
||||
const bool doClose = (--s->m_refCount == 0);
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
{
|
||||
std::scoped_lock lock{m_mutex};
|
||||
doClose = (--s->m_refCount == 0);
|
||||
}
|
||||
|
||||
// close the socket if necessary
|
||||
if (doClose) {
|
||||
if (close(s->m_fd) == -1) {
|
||||
// close failed. restore the last ref and throw.
|
||||
int err = errno;
|
||||
ARCH->lockMutex(m_mutex);
|
||||
++s->m_refCount;
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
{
|
||||
std::scoped_lock lock{m_mutex};
|
||||
++s->m_refCount;
|
||||
}
|
||||
throwError(err);
|
||||
}
|
||||
delete s;
|
||||
@ -289,10 +279,10 @@ int ArchNetworkBSD::pollSocket(PollEntry pe[], int num, double timeout)
|
||||
for (int i = 0; i < num; ++i) {
|
||||
pfd[i].fd = (pe[i].m_socket == nullptr) ? -1 : pe[i].m_socket->m_fd;
|
||||
pfd[i].events = 0;
|
||||
if ((pe[i].m_events & kPOLLIN) != 0) {
|
||||
if ((pe[i].m_events & PollEventMask::In) != 0) {
|
||||
pfd[i].events |= POLLIN;
|
||||
}
|
||||
if ((pe[i].m_events & kPOLLOUT) != 0) {
|
||||
if ((pe[i].m_events & PollEventMask::Out) != 0) {
|
||||
pfd[i].events |= POLLOUT;
|
||||
}
|
||||
}
|
||||
@ -339,16 +329,16 @@ int ArchNetworkBSD::pollSocket(PollEntry pe[], int num, double timeout)
|
||||
for (int i = 0; i < num; ++i) {
|
||||
pe[i].m_revents = 0;
|
||||
if ((pfd[i].revents & POLLIN) != 0) {
|
||||
pe[i].m_revents |= kPOLLIN;
|
||||
pe[i].m_revents |= PollEventMask::In;
|
||||
}
|
||||
if ((pfd[i].revents & POLLOUT) != 0) {
|
||||
pe[i].m_revents |= kPOLLOUT;
|
||||
pe[i].m_revents |= PollEventMask::Out;
|
||||
}
|
||||
if ((pfd[i].revents & POLLERR) != 0) {
|
||||
pe[i].m_revents |= kPOLLERR;
|
||||
pe[i].m_revents |= PollEventMask::Error;
|
||||
}
|
||||
if ((pfd[i].revents & POLLNVAL) != 0) {
|
||||
pe[i].m_revents |= kPOLLNVAL;
|
||||
pe[i].m_revents |= PollEventMask::Invalid;
|
||||
}
|
||||
}
|
||||
|
||||
@ -360,9 +350,7 @@ void ArchNetworkBSD::unblockPollSocket(ArchThread thread)
|
||||
const int *unblockPipe = getUnblockPipeForThread(thread);
|
||||
if (unblockPipe != nullptr) {
|
||||
char dummy = 0;
|
||||
int ignore;
|
||||
|
||||
ignore = write(unblockPipe[1], &dummy, 1);
|
||||
std::ignore = write(unblockPipe[1], &dummy, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,25 +457,16 @@ bool ArchNetworkBSD::setReuseAddrOnSocket(ArchSocket s, bool reuse)
|
||||
return (oflag != 0);
|
||||
}
|
||||
|
||||
std::string ArchNetworkBSD::getHostName()
|
||||
ArchNetAddress ArchNetworkBSD::newAnyAddr(AddressFamily family)
|
||||
{
|
||||
char name[256];
|
||||
if (gethostname(name, sizeof(name)) == -1) {
|
||||
name[0] = '\0';
|
||||
} else {
|
||||
name[sizeof(name) - 1] = '\0';
|
||||
}
|
||||
return name;
|
||||
}
|
||||
using enum AddressFamily;
|
||||
|
||||
ArchNetAddress ArchNetworkBSD::newAnyAddr(EAddressFamily family)
|
||||
{
|
||||
// allocate address
|
||||
auto *addr = new ArchNetAddressImpl;
|
||||
|
||||
// fill it in
|
||||
switch (family) {
|
||||
case kINET: {
|
||||
case INet: {
|
||||
auto *ipAddr = TYPED_ADDR(struct sockaddr_in, addr);
|
||||
ipAddr->sin_family = AF_INET;
|
||||
ipAddr->sin_port = 0;
|
||||
@ -496,7 +475,7 @@ ArchNetAddress ArchNetworkBSD::newAnyAddr(EAddressFamily family)
|
||||
break;
|
||||
}
|
||||
|
||||
case kINET6: {
|
||||
case INet6: {
|
||||
auto *ipAddr = TYPED_ADDR(struct sockaddr_in6, addr);
|
||||
ipAddr->sin6_family = AF_INET6;
|
||||
ipAddr->sin6_port = 0;
|
||||
@ -539,11 +518,10 @@ std::vector<ArchNetAddress> ArchNetworkBSD::nameToAddr(const std::string &name)
|
||||
}
|
||||
|
||||
// done with static buffer
|
||||
ARCH->lockMutex(m_mutex);
|
||||
std::scoped_lock lock{m_mutex};
|
||||
struct addrinfo *pResult = nullptr;
|
||||
|
||||
if (int ret = getaddrinfo(name.c_str(), nullptr, &hints, &pResult); ret != 0) {
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
throwNameError(ret);
|
||||
}
|
||||
|
||||
@ -561,7 +539,6 @@ std::vector<ArchNetAddress> ArchNetworkBSD::nameToAddr(const std::string &name)
|
||||
}
|
||||
|
||||
freeaddrinfo(pResult);
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
|
||||
return addresses;
|
||||
}
|
||||
@ -578,45 +555,46 @@ std::string ArchNetworkBSD::addrToName(ArchNetAddress addr)
|
||||
assert(addr != nullptr);
|
||||
|
||||
// mutexed name lookup (ugh)
|
||||
ARCH->lockMutex(m_mutex);
|
||||
std::scoped_lock lock{m_mutex};
|
||||
char host[1024];
|
||||
char service[20];
|
||||
|
||||
if (int ret =
|
||||
getnameinfo(TYPED_ADDR(struct sockaddr, addr), addr->m_len, host, sizeof(host), service, sizeof(service), 0);
|
||||
ret != 0) {
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
throwNameError(ret);
|
||||
}
|
||||
|
||||
// save (primary) name
|
||||
std::string name = host;
|
||||
|
||||
// done with static buffer
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string ArchNetworkBSD::addrToString(ArchNetAddress addr)
|
||||
{
|
||||
using enum AddressFamily;
|
||||
|
||||
assert(addr != nullptr);
|
||||
|
||||
switch (getAddrFamily(addr)) {
|
||||
case kINET: {
|
||||
case INet: {
|
||||
char strAddr[INET_ADDRSTRLEN];
|
||||
const auto *ipAddr = TYPED_ADDR(struct sockaddr_in, addr);
|
||||
ARCH->lockMutex(m_mutex);
|
||||
std::string s = inet_ntoa(ipAddr->sin_addr);
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
return s;
|
||||
{
|
||||
std::scoped_lock lock{m_mutex};
|
||||
inet_ntop(AF_INET, &ipAddr->sin_addr, strAddr, INET_ADDRSTRLEN);
|
||||
}
|
||||
return strAddr;
|
||||
}
|
||||
|
||||
case kINET6: {
|
||||
case INet6: {
|
||||
char strAddr[INET6_ADDRSTRLEN];
|
||||
const auto *ipAddr = TYPED_ADDR(struct sockaddr_in6, addr);
|
||||
ARCH->lockMutex(m_mutex);
|
||||
inet_ntop(AF_INET6, &ipAddr->sin6_addr, strAddr, INET6_ADDRSTRLEN);
|
||||
ARCH->unlockMutex(m_mutex);
|
||||
{
|
||||
std::scoped_lock lock{m_mutex};
|
||||
inet_ntop(AF_INET6, &ipAddr->sin6_addr, strAddr, INET6_ADDRSTRLEN);
|
||||
}
|
||||
return strAddr;
|
||||
}
|
||||
|
||||
@ -626,33 +604,37 @@ std::string ArchNetworkBSD::addrToString(ArchNetAddress addr)
|
||||
}
|
||||
}
|
||||
|
||||
IArchNetwork::EAddressFamily ArchNetworkBSD::getAddrFamily(ArchNetAddress addr)
|
||||
IArchNetwork::AddressFamily ArchNetworkBSD::getAddrFamily(ArchNetAddress addr)
|
||||
{
|
||||
using enum AddressFamily;
|
||||
|
||||
assert(addr != nullptr);
|
||||
|
||||
switch (addr->m_addr.ss_family) {
|
||||
case AF_INET:
|
||||
return kINET;
|
||||
return INet;
|
||||
case AF_INET6:
|
||||
return kINET6;
|
||||
return INet6;
|
||||
|
||||
default:
|
||||
return kUNKNOWN;
|
||||
return Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
void ArchNetworkBSD::setAddrPort(ArchNetAddress addr, int port)
|
||||
{
|
||||
using enum AddressFamily;
|
||||
|
||||
assert(addr != nullptr);
|
||||
|
||||
switch (getAddrFamily(addr)) {
|
||||
case kINET: {
|
||||
case INet: {
|
||||
auto *ipAddr = TYPED_ADDR(struct sockaddr_in, addr);
|
||||
ipAddr->sin_port = htons(port);
|
||||
break;
|
||||
}
|
||||
|
||||
case kINET6: {
|
||||
case INet6: {
|
||||
auto *ipAddr = TYPED_ADDR(struct sockaddr_in6, addr);
|
||||
ipAddr->sin6_port = htons(port);
|
||||
break;
|
||||
@ -666,15 +648,17 @@ void ArchNetworkBSD::setAddrPort(ArchNetAddress addr, int port)
|
||||
|
||||
int ArchNetworkBSD::getAddrPort(ArchNetAddress addr)
|
||||
{
|
||||
using enum AddressFamily;
|
||||
|
||||
assert(addr != nullptr);
|
||||
|
||||
switch (getAddrFamily(addr)) {
|
||||
case kINET: {
|
||||
case INet: {
|
||||
const auto *ipAddr = TYPED_ADDR(struct sockaddr_in, addr);
|
||||
return ntohs(ipAddr->sin_port);
|
||||
}
|
||||
|
||||
case kINET6: {
|
||||
case INet6: {
|
||||
const auto *ipAddr = TYPED_ADDR(struct sockaddr_in6, addr);
|
||||
return ntohs(ipAddr->sin6_port);
|
||||
}
|
||||
@ -687,15 +671,17 @@ int ArchNetworkBSD::getAddrPort(ArchNetAddress addr)
|
||||
|
||||
bool ArchNetworkBSD::isAnyAddr(ArchNetAddress addr)
|
||||
{
|
||||
using enum AddressFamily;
|
||||
|
||||
assert(addr != nullptr);
|
||||
|
||||
switch (getAddrFamily(addr)) {
|
||||
case kINET: {
|
||||
case INet: {
|
||||
const auto *ipAddr = TYPED_ADDR(struct sockaddr_in, addr);
|
||||
return (ipAddr->sin_addr.s_addr == INADDR_ANY && addr->m_len == static_cast<socklen_t>(sizeof(struct sockaddr_in)));
|
||||
}
|
||||
|
||||
case kINET6: {
|
||||
case INet6: {
|
||||
const auto *ipAddr = TYPED_ADDR(struct sockaddr_in6, addr);
|
||||
return (
|
||||
addr->m_len == (socklen_t)sizeof(struct sockaddr_in6) &&
|
||||
@ -747,16 +733,16 @@ const int *ArchNetworkBSD::getUnblockPipeForThread(ArchThread thread)
|
||||
return unblockPipe;
|
||||
}
|
||||
|
||||
void ArchNetworkBSD::throwError(int err) const
|
||||
[[noreturn]] void ArchNetworkBSD::throwError(int err) const
|
||||
{
|
||||
switch (err) {
|
||||
case EINTR:
|
||||
ARCH->testCancelThread();
|
||||
throw XArchNetworkInterrupted(errorToString(err));
|
||||
throw ArchNetworkInterruptedException(errorToString(err));
|
||||
|
||||
case EACCES:
|
||||
case EPERM:
|
||||
throw XArchNetworkAccess(errorToString(err));
|
||||
throw ArchNetworkAccessException(errorToString(err));
|
||||
|
||||
case ENFILE:
|
||||
case EMFILE:
|
||||
@ -767,7 +753,7 @@ void ArchNetworkBSD::throwError(int err) const
|
||||
#if defined(ENOSR)
|
||||
case ENOSR:
|
||||
#endif
|
||||
throw XArchNetworkResource(errorToString(err));
|
||||
throw ArchNetworkResourceException(errorToString(err));
|
||||
|
||||
case EPROTOTYPE:
|
||||
case EPROTONOSUPPORT:
|
||||
@ -781,44 +767,44 @@ void ArchNetworkBSD::throwError(int err) const
|
||||
#if defined(ENOPKG)
|
||||
case ENOPKG:
|
||||
#endif
|
||||
throw XArchNetworkSupport(errorToString(err));
|
||||
throw ArchNetworkSupportException(errorToString(err));
|
||||
|
||||
case EIO:
|
||||
throw XArchNetworkIO(errorToString(err));
|
||||
throw ArchNetworkIOException(errorToString(err));
|
||||
|
||||
case EADDRNOTAVAIL:
|
||||
throw XArchNetworkNoAddress(errorToString(err));
|
||||
throw ArchNetworkNoAddressException(errorToString(err));
|
||||
|
||||
case EADDRINUSE:
|
||||
throw XArchNetworkAddressInUse(errorToString(err));
|
||||
throw ArchNetworkAddressInUseException(errorToString(err));
|
||||
|
||||
case EHOSTUNREACH:
|
||||
case ENETUNREACH:
|
||||
throw XArchNetworkNoRoute(errorToString(err));
|
||||
throw ArchNetworkNoRouteException(errorToString(err));
|
||||
|
||||
case ENOTCONN:
|
||||
throw XArchNetworkNotConnected(errorToString(err));
|
||||
throw ArchNetworkNotConnectedException(errorToString(err));
|
||||
|
||||
case EPIPE:
|
||||
throw XArchNetworkShutdown(errorToString(err));
|
||||
throw ArchNetworkShutdownException(errorToString(err));
|
||||
|
||||
case ECONNABORTED:
|
||||
case ECONNRESET:
|
||||
throw XArchNetworkDisconnected(errorToString(err));
|
||||
throw ArchNetworkDisconnectedException(errorToString(err));
|
||||
|
||||
case ECONNREFUSED:
|
||||
throw XArchNetworkConnectionRefused(errorToString(err));
|
||||
throw ArchNetworkConnectionRefusedException(errorToString(err));
|
||||
|
||||
case EHOSTDOWN:
|
||||
case ETIMEDOUT:
|
||||
throw XArchNetworkTimedOut(errorToString(err));
|
||||
throw ArchNetworkTimedOutException(errorToString(err));
|
||||
|
||||
default:
|
||||
throw XArchNetwork(errorToString(err));
|
||||
throw ArchNetworkException(errorToString(err));
|
||||
}
|
||||
}
|
||||
|
||||
void ArchNetworkBSD::throwNameError(int err) const
|
||||
[[noreturn]] void ArchNetworkBSD::throwNameError(int err) const
|
||||
{
|
||||
static const char *s_msg[] = {
|
||||
"The specified host is unknown", "The requested name is valid but does not have an IP address",
|
||||
@ -828,18 +814,18 @@ void ArchNetworkBSD::throwNameError(int err) const
|
||||
|
||||
switch (err) {
|
||||
case HOST_NOT_FOUND:
|
||||
throw XArchNetworkNameUnknown(s_msg[0]);
|
||||
throw ArchNetworkNameUnknownException(s_msg[0]);
|
||||
|
||||
case NO_DATA:
|
||||
throw XArchNetworkNameNoAddress(s_msg[1]);
|
||||
throw ArchNetworkNameNoAddressException(s_msg[1]);
|
||||
|
||||
case NO_RECOVERY:
|
||||
throw XArchNetworkNameFailure(s_msg[2]);
|
||||
throw ArchNetworkNameFailureException(s_msg[2]);
|
||||
|
||||
case TRY_AGAIN:
|
||||
throw XArchNetworkNameUnavailable(s_msg[3]);
|
||||
throw ArchNetworkNameUnavailableException(s_msg[3]);
|
||||
|
||||
default:
|
||||
throw XArchNetworkName(s_msg[4]);
|
||||
throw ArchNetworkNameException(s_msg[4]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,29 +11,9 @@
|
||||
#include "arch/IArchNetwork.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#else
|
||||
struct sockaddr_storage
|
||||
{
|
||||
unsigned char ss_len; /* address length */
|
||||
unsigned char ss_family; /* [XSI] address family */
|
||||
char __ss_pad1[_SS_PAD1SIZE];
|
||||
long long __ss_align; /* force structure storage alignment */
|
||||
char __ss_pad2[_SS_PAD2SIZE];
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !HAVE_SOCKLEN_T
|
||||
using socklen_t = int;
|
||||
#endif
|
||||
|
||||
#include <mutex>
|
||||
#include <poll.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#define ARCH_NETWORK ArchNetworkBSD
|
||||
#define TYPED_ADDR(type_, addr_) (reinterpret_cast<type_ *>(&addr_->m_addr))
|
||||
@ -83,7 +63,7 @@ public:
|
||||
}
|
||||
ArchNetworkBSD(ArchNetworkBSD const &) = delete;
|
||||
ArchNetworkBSD(ArchNetworkBSD &&) = delete;
|
||||
~ArchNetworkBSD() override;
|
||||
~ArchNetworkBSD() override = default;
|
||||
|
||||
ArchNetworkBSD &operator=(ArchNetworkBSD const &) = delete;
|
||||
ArchNetworkBSD &operator=(ArchNetworkBSD &&) = delete;
|
||||
@ -91,7 +71,7 @@ public:
|
||||
void init() override;
|
||||
|
||||
// IArchNetwork overrides
|
||||
ArchSocket newSocket(EAddressFamily, ESocketType) override;
|
||||
ArchSocket newSocket(AddressFamily, SocketType) override;
|
||||
ArchSocket copySocket(ArchSocket s) override;
|
||||
void closeSocket(ArchSocket s) override;
|
||||
void closeSocketForRead(ArchSocket s) override;
|
||||
@ -107,14 +87,13 @@ public:
|
||||
void throwErrorOnSocket(ArchSocket) override;
|
||||
bool setNoDelayOnSocket(ArchSocket, bool noDelay) override;
|
||||
bool setReuseAddrOnSocket(ArchSocket, bool reuse) override;
|
||||
std::string getHostName() override;
|
||||
ArchNetAddress newAnyAddr(EAddressFamily) override;
|
||||
ArchNetAddress newAnyAddr(AddressFamily) override;
|
||||
ArchNetAddress copyAddr(ArchNetAddress) override;
|
||||
std::vector<ArchNetAddress> nameToAddr(const std::string &) override;
|
||||
void closeAddr(ArchNetAddress) override;
|
||||
std::string addrToName(ArchNetAddress) override;
|
||||
std::string addrToString(ArchNetAddress) override;
|
||||
EAddressFamily getAddrFamily(ArchNetAddress) override;
|
||||
AddressFamily getAddrFamily(ArchNetAddress) override;
|
||||
void setAddrPort(ArchNetAddress, int port) override;
|
||||
int getAddrPort(ArchNetAddress) override;
|
||||
bool isAnyAddr(ArchNetAddress) override;
|
||||
@ -124,10 +103,9 @@ private:
|
||||
const int *getUnblockPipe();
|
||||
const int *getUnblockPipeForThread(ArchThread);
|
||||
void setBlockingOnSocket(int fd, bool blocking) const;
|
||||
void throwError(int) const;
|
||||
void throwNameError(int) const;
|
||||
[[noreturn]] void throwError(int) const override;
|
||||
[[noreturn]] void throwNameError(int) const override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Deps> m_pDeps;
|
||||
ArchMutex m_mutex{};
|
||||
std::mutex m_mutex;
|
||||
};
|
||||
|
||||