mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 02:57:22 +00:00
@@ -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;
|
||||
|
||||
|
||||
@@ -9,4 +9,4 @@ namespace Win32Desktop
|
||||
void FitToWorkArea(Win32Window::Point& origin, Win32Window::Size& size);
|
||||
}
|
||||
|
||||
#endif // RUNNER_WIN32_DESKTOP_H_
|
||||
#endif // RUNNER_WIN32_DESKTOP_H_
|
||||
|
||||
Reference in New Issue
Block a user