mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Delay UpdatePowerSaveBlocker to show in media viewer
This commit is contained in:
parent
006d6fe2c0
commit
eea50ed6b0
1 changed files with 11 additions and 7 deletions
|
@ -631,7 +631,6 @@ OverlayWidget::OverlayWidget()
|
|||
_window->setWindowFlags(Qt::FramelessWindowHint | Qt::Tool);
|
||||
}
|
||||
_widget->setMouseTracking(true);
|
||||
_window->createWinId();
|
||||
|
||||
_window->screenValue(
|
||||
) | rpl::skip(1) | rpl::start_with_next([=](not_null<QScreen*> screen) {
|
||||
|
@ -3823,12 +3822,17 @@ void OverlayWidget::updatePowerSaveBlocker(
|
|||
&& _document->isVideoFile()
|
||||
&& !IsPausedOrPausing(state.state)
|
||||
&& !IsStoppedOrStopping(state.state);
|
||||
base::UpdatePowerSaveBlocker(
|
||||
_streamed->powerSaveBlocker,
|
||||
block,
|
||||
base::PowerSaveBlockType::PreventDisplaySleep,
|
||||
[] { return u"Video playback is active"_q; },
|
||||
[=] { return window(); });
|
||||
|
||||
_window->shownValue() | rpl::filter([=](bool shown) {
|
||||
return shown;
|
||||
}) | rpl::take(1) | rpl::start_with_next([=] {
|
||||
base::UpdatePowerSaveBlocker(
|
||||
_streamed->powerSaveBlocker,
|
||||
block,
|
||||
base::PowerSaveBlockType::PreventDisplaySleep,
|
||||
[] { return u"Video playback is active"_q; },
|
||||
[=] { return window(); });
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
QImage OverlayWidget::transformedShownContent() const {
|
||||
|
|
Loading…
Add table
Reference in a new issue