fix: build (#12968)
Some checks are pending
CI / ${{ matrix.job.target }} (${{ matrix.job.os }}) (map[os:ubuntu-22.04 target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Full Flutter CI / run-ci (push) Waiting to run

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2025-09-19 17:20:53 +08:00 committed by GitHub
parent 2d1c94f1ef
commit b11a8dfe54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 13 deletions

View File

@ -21,7 +21,10 @@ namespace Win32Desktop
hMonitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY);
RECT workAreaRect;
bool haveWorkAreaRect = false;
workAreaRect.left = 0;
workAreaRect.top = 0;
workAreaRect.right = 1280;
workAreaRect.bottom = 1024 - 40; // default Windows 10 task bar height
if (hMonitor != NULL)
{
@ -32,20 +35,9 @@ namespace Win32Desktop
if (GetMonitorInfoW(hMonitor, &monitorInfo))
{
workAreaRect = monitorInfo.rcWork;
haveWorkAreaRect = true;
}
}
if (!haveWorkAreaRect)
{
// I don't think this is possible, but just in case, some
// reasonably sane fallbacks.
workAreaRect.left = 0;
workAreaRect.top = 0;
workAreaRect.right = 1280;
workAreaRect.bottom = 1024 - 40; // default Windows 10 task bar height
}
origin.x = workAreaRect.left;
origin.y = workAreaRect.top;

View File

@ -9,4 +9,4 @@ namespace Win32Desktop
void FitToWorkArea(Win32Window::Point& origin, Win32Window::Size& size);
}
#endif // RUNNER_WIN32_DESKTOP_H_
#endif // RUNNER_WIN32_DESKTOP_H_