From 4dbc077f949ffab83c5a8033e659c2fd8753ef84 Mon Sep 17 00:00:00 2001 From: Domenico Ferraro Date: Sun, 14 Jul 2024 23:21:03 +0200 Subject: [PATCH] fix: how the indicator orders the monitors --- src/indicator/defaultMenu.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/indicator/defaultMenu.ts b/src/indicator/defaultMenu.ts index a229c87..e50091e 100644 --- a/src/indicator/defaultMenu.ts +++ b/src/indicator/defaultMenu.ts @@ -315,8 +315,8 @@ export default class DefaultMenu implements CurrentMenu { const selectedIdPerMonitor = Settings.get_selected_layouts(); const monitors = getMonitors(); - this._layoutsRows = monitors.map((monitor, index) => { - const selectedId = selectedIdPerMonitor[index]; + this._layoutsRows = monitors.map((monitor) => { + const selectedId = selectedIdPerMonitor[monitor.index]; const row = new LayoutsRow( this._container, layouts, @@ -327,7 +327,10 @@ export default class DefaultMenu implements CurrentMenu { row.connect( 'selected-layout', (r: LayoutsRow, layoutId: string) => { - this._indicator.selectLayoutOnClick(index, layoutId); + this._indicator.selectLayoutOnClick( + monitor.index, + layoutId, + ); }, ); return row;