mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 15:35:51 +00:00
Remove some App::wnd() calls.
This commit is contained in:
@@ -145,25 +145,6 @@ void psDoCleanup() {
|
||||
}
|
||||
}
|
||||
|
||||
QRect psDesktopRect() {
|
||||
static QRect _monitorRect;
|
||||
static crl::time _monitorLastGot = 0;
|
||||
auto tnow = crl::now();
|
||||
if (tnow > _monitorLastGot + 1000LL || tnow < _monitorLastGot) {
|
||||
_monitorLastGot = tnow;
|
||||
HMONITOR hMonitor = MonitorFromWindow(App::wnd()->psHwnd(), MONITOR_DEFAULTTONEAREST);
|
||||
if (hMonitor) {
|
||||
MONITORINFOEX info;
|
||||
info.cbSize = sizeof(info);
|
||||
GetMonitorInfo(hMonitor, &info);
|
||||
_monitorRect = QRect(info.rcWork.left, info.rcWork.top, info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top);
|
||||
} else {
|
||||
_monitorRect = QApplication::desktop()->availableGeometry(App::wnd());
|
||||
}
|
||||
}
|
||||
return _monitorRect;
|
||||
}
|
||||
|
||||
int psCleanup() {
|
||||
__try
|
||||
{
|
||||
|
Reference in New Issue
Block a user