Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed May 9, 2024
1 parent 9398a94 commit dc08db3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Magpie.App/ScalingService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ bool ScalingService::_StartScale(HWND hWnd, const Profile& profile) {
}
}
}

// 尝试启用触控支持
bool isTouchSupportEnabled;
if (!TouchHelper::TryLaunchTouchHelper(isTouchSupportEnabled)) {
Logger::Get().Error("TryLaunchTouchHelper 失败");
return false;
}

options.graphicsCard = profile.graphicsCard;
options.captureMethod = profile.captureMethod;
Expand All @@ -250,6 +257,8 @@ bool ScalingService::_StartScale(HWND hWnd, const Profile& profile) {
options.cursorInterpolationMode = profile.cursorInterpolationMode;
options.flags = profile.scalingFlags;

options.IsTouchSupportEnabled(isTouchSupportEnabled);

if (profile.isCroppingEnabled) {
options.cropping = profile.cropping;
}
Expand Down Expand Up @@ -304,14 +313,6 @@ bool ScalingService::_StartScale(HWND hWnd, const Profile& profile) {
options.duplicateFrameDetectionMode = settings.DuplicateFrameDetectionMode();
options.IsStatisticsForDynamicDetectionEnabled(settings.IsStatisticsForDynamicDetectionEnabled());

// 尝试启用触控支持
bool isTouchSupportEnabled;
if (!TouchHelper::TryLaunchTouchHelper(isTouchSupportEnabled)) {
Logger::Get().Error("TryLaunchTouchHelper 失败");
return false;
}
options.IsTouchSupportEnabled(isTouchSupportEnabled);

_isAutoScaling = profile.isAutoScale;
_scalingRuntime->Start(hWnd, std::move(options));
_hwndCurSrc = hWnd;
Expand Down

0 comments on commit dc08db3

Please sign in to comment.