diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea7c02ff7..1e6f575cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,14 +145,14 @@ jobs: job: ${{ matrix.target.name }} - name: Package - if: ${{ vars.CI_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }} + if: ${{ env.PACKAGE_BUILD == 'true' }} run: python ./scripts/package.py env: WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }} WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }} - name: Upload - if: ${{ vars.CI_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }} + if: ${{ env.PACKAGE_UPLOAD == 'true' }} uses: ./.github/actions/dist-upload with: use-github: true @@ -223,7 +223,7 @@ jobs: job: ${{ matrix.target.name }} - name: Package - if: ${{ vars.CI_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }} + if: ${{ env.PACKAGE_BUILD == 'true' }} run: ./scripts/package.py env: APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }} @@ -234,7 +234,7 @@ jobs: APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - name: Upload - if: ${{ vars.CI_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }} + if: ${{ env.PACKAGE_UPLOAD == 'true' }} uses: ./.github/actions/dist-upload with: use-github: true @@ -308,14 +308,14 @@ jobs: job: linux-${{ matrix.distro.name }} - name: Package - if: ${{ vars.CI_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }} + if: ${{ env.PACKAGE_BUILD == 'true' }} env: LINUX_EXTRA_PACKAGES: ${{ matrix.distro.extra-packages }} LINUX_PACKAGE_USER: ${{ matrix.distro.package-user }} run: ./scripts/package.py - name: Upload - if: ${{ vars.CI_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }} + if: ${{ env.PACKAGE_UPLOAD == 'true' }} uses: ./.github/actions/dist-upload with: use-github: true diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index 8d8e6caed..8a9be6d93 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -42,6 +42,7 @@ #include "server/PrimaryClient.h" #include +#include #include #include #include @@ -1790,7 +1791,31 @@ void Server::sendDragInfo(BaseClientProxy *newScreen) { } void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) { - LOG((CLOG_DEBUG2 "onMouseMoveSecondary %+d,%+d", dx, dy)); + LOG((CLOG_DEBUG2 "onMouseMoveSecondary initial %+d,%+d", dx, dy)); + const char *envVal = std::getenv("DESKFLOW_MOUSE_ADJUSTMENT"); + if (envVal != nullptr) { + try { + double multiplier = std::stod(envVal); // Convert to double + SInt32 adjustedDx = static_cast( + std::round(dx * multiplier)); // Apply multiplier and round + SInt32 adjustedDy = static_cast(std::round(dy * multiplier)); + LOG( + (CLOG_DEBUG2 "Adjusted to %+d,%+d using multiplier %.2f", adjustedDx, + adjustedDy, multiplier)); + dx = adjustedDx; // Update dx and dy to adjusted values + dy = adjustedDy; + } catch (const std::exception &e) { + // Log the error message from the exception + LOG(( + CLOG_ERR "Invalid DESKFLOW_MOUSE_ADJUSTMENT value: %s. Exception: %s", + envVal, e.what())); + } + } else { + LOG( + (CLOG_DEBUG1 + "DESKFLOW_MOUSE_ADJUSTMENT not set, using original values %+d,%+d", + dx, dy)); + } // mouse move on secondary (client's) screen assert(m_active != NULL);