diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index d07c748f49..210eb0dce4 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -146,6 +146,23 @@ Main::Session &Show::session() const { return panel->call()->peer()->session(); } +#ifdef Q_OS_WIN +void UnpinMaximized(not_null widget) { + SetWindowPos( + reinterpret_cast(widget->window()->windowHandle()->winId()), + HWND_NOTOPMOST, + 0, + 0, + 0, + 0, + (SWP_NOMOVE + | SWP_NOSIZE + | SWP_NOOWNERZORDER + | SWP_FRAMECHANGED + | SWP_NOACTIVATE)); +} +#endif // Q_OS_WIN + } // namespace struct Panel::ControlsBackgroundNarrow { @@ -1257,7 +1274,12 @@ void Panel::createPinOnTop() { _pinOnTop->setVisible(!fullScreenOrMaximized); if (fullScreenOrMaximized) { +#ifdef Q_OS_WIN + UnpinMaximized(window()); + _unpinnedMaximized = true; +#else // Q_OS_WIN pin(false); +#endif // Q_OS_WIN _viewport->rp()->events( ) | rpl::filter([](not_null event) { @@ -1269,6 +1291,9 @@ void Panel::createPinOnTop() { _hideControlsTimer.callOnce(kHideControlsTimeout); } else { + if (_unpinnedMaximized) { + pin(false); + } _hideControlsTimerLifetime.destroy(); _hideControlsTimer.cancel(); refreshTitleGeometry(); diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.h b/Telegram/SourceFiles/calls/group/calls_group_panel.h index 8fab145406..cf93526973 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.h +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.h @@ -228,6 +228,7 @@ private: const std::unique_ptr _layerBg; rpl::variable _mode; rpl::variable _fullScreenOrMaximized = false; + bool _unpinnedMaximized = false; #ifndef Q_OS_MAC rpl::variable _controlsTop = 0;