switchMonitor: Fix switching configuration

Since commit 37271ffe70, we pass an explicit `switchType` instead
of the selected item's index to select a configuration. Alas, the item
use `switchMode` as property name, so we always end up passing `undefined`.

Change both to `configType` which matches the API on the other end.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5217

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2245>
This commit is contained in:
Florian Müllner 2022-03-19 16:53:59 +01:00 committed by Marge Bot
parent 2127222b39
commit 6c44162c17

View File

@ -18,7 +18,7 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
* Try to keep it under around 15 characters. * Try to keep it under around 15 characters.
*/ */
label: _('Mirror'), label: _('Mirror'),
switchMode: Meta.MonitorSwitchConfigType.ALL_MIRROR, configType: Meta.MonitorSwitchConfigType.ALL_MIRROR,
}); });
items.push({ items.push({
@ -27,7 +27,7 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
* Try to keep it under around 15 characters. * Try to keep it under around 15 characters.
*/ */
label: _('Join Displays'), label: _('Join Displays'),
switchMode: Meta.MonitorSwitchConfigType.ALL_LINEAR, configType: Meta.MonitorSwitchConfigType.ALL_LINEAR,
}); });
if (global.backend.get_monitor_manager().has_builtin_panel) { if (global.backend.get_monitor_manager().has_builtin_panel) {
@ -37,7 +37,7 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
* Try to keep it under around 15 characters. * Try to keep it under around 15 characters.
*/ */
label: _('External Only'), label: _('External Only'),
switchMode: Meta.MonitorSwitchConfigType.EXTERNAL, configType: Meta.MonitorSwitchConfigType.EXTERNAL,
}); });
items.push({ items.push({
icon: 'computer-symbolic', icon: 'computer-symbolic',
@ -45,7 +45,7 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
* Try to keep it under around 15 characters. * Try to keep it under around 15 characters.
*/ */
label: _('Built-in Only'), label: _('Built-in Only'),
switchMode: Meta.MonitorSwitchConfigType.BUILTIN, configType: Meta.MonitorSwitchConfigType.BUILTIN,
}); });
} }
@ -86,7 +86,7 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
const monitorManager = global.backend.get_monitor_manager(); const monitorManager = global.backend.get_monitor_manager();
const item = this._items[this._selectedIndex]; const item = this._items[this._selectedIndex];
monitorManager.switch_config(item.switchType); monitorManager.switch_config(item.configType);
} }
}); });