mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Fix maximize/fullscreen of pinned-to-top livestream.
This commit is contained in:
@@ -146,6 +146,23 @@ Main::Session &Show::session() const {
|
||||
return panel->call()->peer()->session();
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void UnpinMaximized(not_null<QWidget*> widget) {
|
||||
SetWindowPos(
|
||||
reinterpret_cast<HWND>(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<QEvent*> event) {
|
||||
@@ -1269,6 +1291,9 @@ void Panel::createPinOnTop() {
|
||||
|
||||
_hideControlsTimer.callOnce(kHideControlsTimeout);
|
||||
} else {
|
||||
if (_unpinnedMaximized) {
|
||||
pin(false);
|
||||
}
|
||||
_hideControlsTimerLifetime.destroy();
|
||||
_hideControlsTimer.cancel();
|
||||
refreshTitleGeometry();
|
||||
|
Reference in New Issue
Block a user