forked from quickshell/quickshell
service/mpris: reset position timestamps on seek
Moving the onPositionUpdated callback to a bpPosition binding caused it not to fire when Position was changed to the same value, which can happen when quickly changing tracks before the player has sent a new position. This reverts the above change while still updating position on seek.
This commit is contained in:
parent
fca058e66c
commit
761d99d644
2 changed files with 10 additions and 5 deletions
|
@ -237,7 +237,7 @@ void MprisPlayer::setPosition(qreal position) {
|
|||
this->player->Seek(target - pos);
|
||||
}
|
||||
|
||||
this->bpPosition = target;
|
||||
this->setPosition(target);
|
||||
}
|
||||
|
||||
void MprisPlayer::onPositionUpdated() {
|
||||
|
@ -248,11 +248,16 @@ void MprisPlayer::onPositionUpdated() {
|
|||
if (firstChange) emit this->positionSupportedChanged();
|
||||
}
|
||||
|
||||
void MprisPlayer::setPosition(qlonglong position) {
|
||||
this->bpPosition = position;
|
||||
this->onPositionUpdated();
|
||||
}
|
||||
|
||||
void MprisPlayer::onExportedPositionChanged() {
|
||||
if (!this->lengthSupported()) emit this->lengthChanged();
|
||||
}
|
||||
|
||||
void MprisPlayer::onSeek(qlonglong time) { this->bpPosition = time; }
|
||||
void MprisPlayer::onSeek(qlonglong time) { this->setPosition(time); }
|
||||
|
||||
qreal MprisPlayer::length() const {
|
||||
if (this->bInternalLength == -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue