mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Remove unnecessary repaints in an inactive window.
This commit is contained in:
@@ -252,10 +252,8 @@ void Gif::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms
|
|||||||
const auto autoPaused = App::wnd()->sessionController()->isGifPausedAtLeastFor(Window::GifPauseReason::Any);
|
const auto autoPaused = App::wnd()->sessionController()->isGifPausedAtLeastFor(Window::GifPauseReason::Any);
|
||||||
const auto cornerDownload = downloadInCorner();
|
const auto cornerDownload = downloadInCorner();
|
||||||
const auto canBePlayed = _data->canBePlayed();
|
const auto canBePlayed = _data->canBePlayed();
|
||||||
const auto activeRoundPlaying = activeRoundStreamed();
|
|
||||||
const auto activeOwnPlaying = activeOwnStreamed();
|
|
||||||
const auto autoplay = autoplayEnabled() && canBePlayed;
|
const auto autoplay = autoplayEnabled() && canBePlayed;
|
||||||
const auto streamingMode = _streamed || activeRoundPlaying || autoplay;
|
const auto activeRoundPlaying = activeRoundStreamed();
|
||||||
const auto startPlayAsync = autoplay
|
const auto startPlayAsync = autoplay
|
||||||
&& !_streamed
|
&& !_streamed
|
||||||
&& !activeRoundPlaying;
|
&& !activeRoundPlaying;
|
||||||
@@ -268,6 +266,8 @@ void Gif::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms
|
|||||||
&& !_streamed->instance.failed()) {
|
&& !_streamed->instance.failed()) {
|
||||||
startStreamedPlayer();
|
startStreamedPlayer();
|
||||||
}
|
}
|
||||||
|
const auto streamingMode = _streamed || activeRoundPlaying || autoplay;
|
||||||
|
const auto activeOwnPlaying = activeOwnStreamed();
|
||||||
|
|
||||||
auto paintx = 0, painty = 0, paintw = width(), painth = height();
|
auto paintx = 0, painty = 0, paintw = width(), painth = height();
|
||||||
bool bubble = _parent->hasBubble();
|
bool bubble = _parent->hasBubble();
|
||||||
@@ -1246,6 +1246,10 @@ void Gif::repaintStreamedContent() {
|
|||||||
if (own && !own->frozenFrame.isNull()) {
|
if (own && !own->frozenFrame.isNull()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (App::wnd()->sessionController()->isGifPausedAtLeastFor(Window::GifPauseReason::Any)
|
||||||
|
&& !activeRoundStreamed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
history()->owner().requestViewRepaint(_parent);
|
history()->owner().requestViewRepaint(_parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user