Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Unified Diff: ui/display/manager/display_manager.cc

Issue 2799963003: Fix errors in display resolution change notifications (Closed)
Patch Set: Update commit message Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/display_options_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/manager/display_manager.cc
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc
index 6b34dedcd70dcc1b7f1082554ceee05301939a37..0a7bd1363d26c3eff61d7b6994abafe11242dcd5 100644
--- a/ui/display/manager/display_manager.cc
+++ b/ui/display/manager/display_manager.cc
@@ -377,27 +377,37 @@ bool DisplayManager::SetDisplayMode(
display_property_changed = true;
} else {
display_modes_[display_id] = *iter;
- if (info.bounds_in_native().size() != display_mode->size())
+ if (info.bounds_in_native().size() != display_mode->size()) {
+ // If resolution changes, then we can break right here. No need to
+ // continue to fill |display_info_list|, since we won't be
+ // synchronously updating the displays here.
resolution_changed = true;
+ break;
+ }
if (info.device_scale_factor() != display_mode->device_scale_factor()) {
info.set_device_scale_factor(display_mode->device_scale_factor());
display_property_changed = true;
}
}
}
- display_info_list.push_back(info);
+ display_info_list.emplace_back(info);
}
- if (display_property_changed) {
+
+ if (display_property_changed && !resolution_changed) {
+ // We shouldn't synchronously update the displays here if the resolution
+ // changed. This should happen asynchronously when configuration is
+ // triggered.
AddMirrorDisplayInfoIfAny(&display_info_list);
UpdateDisplaysWith(display_info_list);
}
- if (resolution_changed && IsInUnifiedMode()) {
+
+ if (resolution_changed && IsInUnifiedMode())
ReconfigureDisplays();
#if defined(OS_CHROMEOS)
- } else if (resolution_changed && configure_displays_) {
+ else if (resolution_changed && configure_displays_)
delegate_->display_configurator()->OnConfigurationChanged();
-#endif
- }
+#endif // defined(OS_CHROMEOS)
+
return resolution_changed || display_property_changed;
}
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/display_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698