Skip to content

Commit 1ebb673

Browse files
authored
Linux: Notifications Accessible View only opens when focusing with mouse (fix microsoft#191705) (microsoft#191888)
1 parent 8800b43 commit 1ebb673

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/vs/workbench/browser/parts/notifications/notificationsCommands.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,19 @@ export function getNotificationFromContext(listService: IListService, context?:
6868

6969
const list = listService.lastFocusedList;
7070
if (list instanceof WorkbenchList) {
71-
const focusedElement = list.getFocusedElements()[0];
72-
if (isNotificationViewItem(focusedElement)) {
73-
return focusedElement;
71+
let element = list.getFocusedElements()[0];
72+
if (!isNotificationViewItem(element)) {
73+
if (list.isDOMFocused()) {
74+
// the notification list might have received focus
75+
// via keyboard and might not have a focussed element.
76+
// in that case just return the first element
77+
// https://github.com/microsoft/vscode/issues/191705
78+
element = list.element(0);
79+
}
80+
}
81+
82+
if (isNotificationViewItem(element)) {
83+
return element;
7484
}
7585
}
7686

0 commit comments

Comments
 (0)