Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion shell/plugins/bar/widgets/Tray.qml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ BarWidget {
persistTrayState(p, h)
}

visible: pinnedItems.length > 0 || drawerCount > 0
// Keyed on every reporting item, hidden ones included, like the chevron:
// the chevron's manage menu is the only way to unhide an item, so hiding
// the last visible one must not take the tray (and the menu) with it.
visible: allItems.length > 0
clip: false
implicitWidth: root.vertical ? root.barSize : trayContent.implicitWidth
implicitHeight: root.vertical ? trayContent.implicitHeight : root.barSize
Expand Down
8 changes: 8 additions & 0 deletions test/shell.d/tray-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ assert(!tray.ownedByOmarchy({ id: 'dropbox' }, { left: [], center: [], right: []
assert(tray.ownedByOmarchy({ id: 'qlBCprNUqU', title: 'localsend' }, { left: [], center: [], right: [] }), 'tray suppresses localsend regardless of layout')
assert(!tray.ownedByOmarchy({ id: 'nextcloud' }, layout), 'tray keeps unrelated tray items')
JS

# The chevron's manage menu is the only way to unhide a tray item, so the tray
# has to stay while hidden items remain: its root keys on every reporting item
# (as the chevron does), not only on the pinned and drawer ones (#7117).
if ! perl -0ne 'exit(/\n visible:\s*allItems\.length\s*>\s*0\n/ ? 0 : 1)' "$ROOT/shell/plugins/bar/widgets/Tray.qml"; then
fail "tray stays visible while only hidden items remain"
fi
pass "tray stays visible while only hidden items remain"