Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dbusMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,23 @@ export const DBusClient = GObject.registerClass({
}
}

_isEmptyMenu() {
const rootItem = this.getRoot();
return !rootItem || rootItem.getChildren().length === 0;
}

_onSignal(_sender, signal, params) {
// an empty menu will not open, thus the signal "open-state-changed"
// will never be emitted, and thus `this._active` will always be false.
if (signal === 'LayoutUpdated') {
if (!this._active) {
if (!this._active && !this._isEmptyMenu()) {
this._flagLayoutUpdateRequired = true;
return;
}

this._requestLayoutUpdate();
} else if (signal === 'ItemsPropertiesUpdated') {
if (!this._active) {
if (!this._active && !this._isEmptyMenu()) {
this._flagItemsUpdateRequired = true;
return;
}
Expand Down