diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 3a833dd785..abad7435b2 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -947,14 +947,9 @@ Window::ControlsLayout WindowControlsLayout() { } // namespace Platform -namespace { - -QRect _monitorRect; -auto _monitorLastGot = 0LL; - -} // namespace - QRect psDesktopRect() { + static QRect _monitorRect; + static auto _monitorLastGot = 0LL; auto tnow = crl::now(); if (tnow > _monitorLastGot + 1000LL || tnow < _monitorLastGot) { _monitorLastGot = tnow; diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.mm b/Telegram/SourceFiles/platform/mac/specific_mac.mm index e856a103dd..712e42c93c 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac.mm @@ -36,14 +36,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -namespace { - -QRect _monitorRect; -crl::time _monitorLastGot = 0; - -} // namespace - QRect psDesktopRect() { + static QRect _monitorRect; + static crl::time _monitorLastGot = 0; auto tnow = crl::now(); if (tnow > _monitorLastGot + 1000 || tnow < _monitorLastGot) { _monitorLastGot = tnow; diff --git a/Telegram/SourceFiles/platform/win/specific_win.cpp b/Telegram/SourceFiles/platform/win/specific_win.cpp index fc0b9957fc..ad7ee8a2c4 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.cpp +++ b/Telegram/SourceFiles/platform/win/specific_win.cpp @@ -145,14 +145,9 @@ void psDoCleanup() { } } -namespace { - -QRect _monitorRect; -crl::time _monitorLastGot = 0; - -} // namespace - QRect psDesktopRect() { + static QRect _monitorRect; + static crl::time _monitorLastGot = 0; auto tnow = crl::now(); if (tnow > _monitorLastGot + 1000LL || tnow < _monitorLastGot) { _monitorLastGot = tnow;