diff --git a/checkbox-support/checkbox_support/dbus/gnome_monitor.py b/checkbox-support/checkbox_support/dbus/gnome_monitor.py index ee87197e71..0afb52e85b 100644 --- a/checkbox-support/checkbox_support/dbus/gnome_monitor.py +++ b/checkbox-support/checkbox_support/dbus/gnome_monitor.py @@ -175,7 +175,13 @@ def cycle( # left and right should convert x and y xy = 1 if (trans == 1 or trans == 3) else 0 position_x += int(m.resolution.split("x")[xy]) - self._apply_monitors_config(state[0], logical_monitors) + try: + self._apply_monitors_config(state[0], logical_monitors) + except GLib.Error: + # Sometimes the NVIDIA driver won't change the state. + # Get the state again to prevent this issue. + state = self._get_current_state() + self._apply_monitors_config(state[0], logical_monitors) if action: action(uni_string, **kwargs) if not resolution: