Fixed changing volume and seeking video in windowed media viewer.

This commit is contained in:
23rd 2023-02-27 15:28:13 +03:00 committed by John Preston
parent 63c390c505
commit 30ae879fb3
3 changed files with 13 additions and 2 deletions

View File

@ -550,7 +550,7 @@ void OverlayWidget::setupWindow() {
return Flag::None | Flag(0);
}
const auto inControls = (_over != OverNone) && (_over != OverVideo);
if (inControls) {
if (inControls || (_streamed && _streamed->controls.dragging())) {
return Flag::None | Flag(0);
}
return Flag::Move | Flag(0);
@ -2810,7 +2810,6 @@ void OverlayWidget::show(OpenRequest request) {
const auto contextTopicRootId = request.topicRootId();
if (!request.continueStreaming() && !request.startTime()) {
if (_message && (_message == contextItem)) {
_message = nullptr;
return close();
} else if (_user && (_user == contextPeer)) {
if ((_photo && (_photo == photo))
@ -5237,6 +5236,7 @@ Window::SessionController *OverlayWidget::findWindow(bool switchTo) const {
// #TODO unite and check
void OverlayWidget::clearBeforeHide() {
_message = nullptr;
_sharedMedia = nullptr;
_sharedMediaData = std::nullopt;
_sharedMediaDataKey = std::nullopt;

View File

@ -590,6 +590,16 @@ bool PlaybackControls::hasMenu() const {
return _menu != nullptr;
}
bool PlaybackControls::dragging() const {
return _volumeController->isChanging()
|| _playbackSlider->isChanging()
|| _playPauseResume->isOver()
|| _volumeToggle->isOver()
|| _menuToggle->isOver()
|| _fullScreenToggle->isOver()
|| _pictureInPicture->isOver();
}
PlaybackControls::~PlaybackControls() = default;
} // namespace View

View File

@ -58,6 +58,7 @@ public:
void setLoadingProgress(int64 ready, int64 total);
void setInFullScreen(bool inFullScreen);
[[nodiscard]] bool hasMenu() const;
[[nodiscard]] bool dragging() const;
~PlaybackControls();