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

Unified Diff: chromeos/display/output_configurator.cc

Issue 12367007: Don't handle display change event/requests to avoid being killed by session manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index de22e2c0750d14c719efcb957a0086beaa82d8e2..8bb89bfc6bb2f27b94483e94f262138f4880c872 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -526,7 +526,9 @@ bool IsOutputAspectPreservingScaling(Display* display,
} // namespace
OutputConfigurator::OutputConfigurator()
- : is_running_on_chrome_os_(base::chromeos::IsRunningOnChromeOS()),
+ // If we aren't running on ChromeOS (like linux desktop),
+ // don't try to configure display.
+ : configure_display_(base::chromeos::IsRunningOnChromeOS()),
is_panel_fitting_enabled_(false),
connected_output_count_(0),
xrandr_event_base_(0),
@@ -543,7 +545,7 @@ OutputConfigurator::~OutputConfigurator() {
void OutputConfigurator::Init(bool is_panel_fitting_enabled,
uint32 background_color_argb) {
TRACE_EVENT0("chromeos", "OutputConfigurator::Init");
- if (!is_running_on_chrome_os_)
+ if (!configure_display_)
return;
is_panel_fitting_enabled_ = is_panel_fitting_enabled;
@@ -613,10 +615,14 @@ void OutputConfigurator::Init(bool is_panel_fitting_enabled,
SetIsProjecting(is_projecting);
}
+void OutputConfigurator::Stop() {
+ configure_display_ = false;
+}
+
bool OutputConfigurator::CycleDisplayMode() {
TRACE_EVENT0("chromeos", "OutputConfigurator::CycleDisplayMode");
VLOG(1) << "CycleDisplayMode";
- if (!is_running_on_chrome_os_)
+ if (!configure_display_)
return false;
bool did_change = false;
@@ -654,7 +660,7 @@ bool OutputConfigurator::ScreenPowerSet(bool power_on, bool all_displays) {
TRACE_EVENT0("chromeos", "OutputConfigurator::ScreenPowerSet");
VLOG(1) << "OutputConfigurator::SetScreensOn " << power_on
<< " all displays " << all_displays;
- if (!is_running_on_chrome_os_)
+ if (!configure_display_)
return false;
bool success = false;
@@ -759,8 +765,9 @@ bool OutputConfigurator::Dispatch(const base::NativeEvent& event) {
TRACE_EVENT0("chromeos", "OutputConfigurator::Dispatch");
if (event->type - xrandr_event_base_ == RRScreenChangeNotify)
XRRUpdateConfiguration(event);
- // Ignore this event if the Xrandr extension isn't supported.
- if (!is_running_on_chrome_os_ ||
+ // Ignore this event if the Xrandr extension isn't supported, or
+ // the device is being shutdown.
+ if (!configure_display_ ||
(event->type - xrandr_event_base_ != RRNotify)) {
return true;
}
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698