Skip to content
Snippets Groups Projects
Commit 3216c6b9 authored by Jeremy Bícha's avatar Jeremy Bícha
Browse files

Cherry-pick patch to fix mirror mode crash when monitor resolutions don't match

LP: #2026228
parent 85bd8908
No related merge requests found
From: Dirk Su <dirk.su@canonical.com>
Date: Mon, 26 Jun 2023 16:38:48 +0800
Subject: Check best_mode exist before adding flag
When there is no compatible clone mode, the best_mode will be NULL
. It will cause gnome-control-center crash when access to the
variable.
(cherry picked from commit b7c0c42317db9bea85cbf83667babf2d73a10b4a)
---
panels/display/cc-display-config-dbus.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/panels/display/cc-display-config-dbus.c b/panels/display/cc-display-config-dbus.c
index e054d00..e6733ec 100644
--- a/panels/display/cc-display-config-dbus.c
+++ b/panels/display/cc-display-config-dbus.c
@@ -1440,7 +1440,8 @@ cc_display_config_dbus_generate_cloning_modes (CcDisplayConfig *pself)
best_mode = virtual_mode;
}
- best_mode->flags |= MODE_PREFERRED;
+ if (best_mode)
+ best_mode->flags |= MODE_PREFERRED;
return clone_modes;
}
......@@ -30,3 +30,4 @@ ubuntu/sound-Add-a-button-to-select-the-default-theme.patch
ubuntu/applications-Launch-snap-store-if-it-is-installed.patch
ubuntu/display-Allow-fractional-scaling-to-be-enabled.patch
ubuntu/mouse-Add-animations-following-the-accent-colors.patch
Check-best_mode-exist-before-adding-flag.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment