Skip to content

Commit

Permalink
feat: Reset DBusItem Properties before applying new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlankParticle authored and 3v1n0 committed Apr 18, 2024
1 parent 957bdb8 commit 4041b0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dbusMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ export class DbusMenuItem extends Signals.EventEmitter {
this.emit('property-changed', prop, this.propertyGetVariant(prop));
}

resetProperties() {
Object.entries(PropertyStore.DefaultValues).forEach(([prop, value]) =>
this.propertySet(prop, value));
}

getChildrenIds() {
return this._children_ids.concat(); // clone it!
}
Expand Down Expand Up @@ -297,6 +302,8 @@ export const DBusClient = GObject.registerClass({
if (!item)
return;

item.resetProperties();

for (const [prop, value] of Object.entries(properties))
item.propertySet(prop, value);
});
Expand Down

0 comments on commit 4041b0d

Please sign in to comment.