Commit 56a36165 authored by Florian Müllner's avatar Florian Müllner Committed by Florian Müllner

appIconMenu: Sync windows section with app menu

Keep the app icon context menu consistent with the app menu, so stop
grouping windows by workspace and add a section heading.

#968
parent d4763b15
Pipeline #75956 passed with stages
in 3 minutes and 31 seconds
......@@ -1707,25 +1707,20 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
w => !w.skip_taskbar
);
// Display the app windows menu items and the separator between windows
// of the current desktop and other windows.
let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace();
let separatorShown = windows.length > 0 && windows[0].get_workspace() != activeWorkspace;
for (let i = 0; i < windows.length; i++) {
let window = windows[i];
if (!separatorShown && window.get_workspace() != activeWorkspace) {
this._appendSeparator();
separatorShown = true;
}
if (windows.length > 0)
this.addMenuItem(
/* Translators: This is the heading of a list of open windows */
new PopupMenu.PopupSeparatorMenuItem(_("Open Windows"))
);
windows.forEach(window => {
let title = window.title ? window.title
: this._source.app.get_name();
let item = this._appendMenuItem(title);
item.connect('activate', () => {
this.emit('activate-window', window);
});
}
});
if (!this._source.app.is_window_backed()) {
this._appendSeparator();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment