forked from quickshell/quickshell
service/mpris: add uniqueId property to detect track changes
Also emits all property changes after trackChanged
This commit is contained in:
parent
d9f66e63a3
commit
abc0201f6e
4 changed files with 104 additions and 34 deletions
|
|
@ -21,3 +21,22 @@ Qt::Edges Edges::toQt(Edges::Flags edges) { return Qt::Edges(edges.toInt()); }
|
|||
bool Edges::isOpposing(Edges::Flags edges) {
|
||||
return edges.testFlags(Edges::Top | Edges::Bottom) || edges.testFlags(Edges::Left | Edges::Right);
|
||||
}
|
||||
|
||||
DropEmitter::DropEmitter(DropEmitter&& other) noexcept: object(other.object), signal(other.signal) {
|
||||
other.object = nullptr;
|
||||
}
|
||||
|
||||
DropEmitter& DropEmitter::operator=(DropEmitter&& other) noexcept {
|
||||
this->object = other.object;
|
||||
this->signal = other.signal;
|
||||
other.object = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DropEmitter::~DropEmitter() { this->call(); }
|
||||
|
||||
void DropEmitter::call() {
|
||||
if (!this->object) return;
|
||||
this->signal(this->object);
|
||||
this->object = nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue