diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-22 02:42:08 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-22 02:42:08 +0000 |
commit | a776fee6fafa74cf2d312264882a16628cac866f (patch) | |
tree | e49aa4e8df8ab963dc52212386f77b8153919fd7 /chromeos/display | |
parent | 4ed0d1c1474294a2b9c8808ff2b5f458bac9b92d (diff) | |
download | chromium_src-a776fee6fafa74cf2d312264882a16628cac866f.zip chromium_src-a776fee6fafa74cf2d312264882a16628cac866f.tar.gz chromium_src-a776fee6fafa74cf2d312264882a16628cac866f.tar.bz2 |
Use OutputConfigurator::SetDislpayMode for ctrl-fullscreen
DisplayManager knows the mirroring state, so no need to rely on
OutputConfigurator to move to next state. There is a chance
that dislpay may be disconnected when SetDisplayMode, but that's
harmless as it simply returns false.
BUG=180443
TEST=manual. see bug.
Review URL: https://codereview.chromium.org/12496020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/display')
-rw-r--r-- | chromeos/display/output_configurator.cc | 39 | ||||
-rw-r--r-- | chromeos/display/output_configurator.h | 10 |
2 files changed, 2 insertions, 47 deletions
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index cb8210f..3031b83b 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -622,45 +622,6 @@ void OutputConfigurator::Stop() { configure_display_ = false; } -bool OutputConfigurator::CycleDisplayMode() { - TRACE_EVENT0("chromeos", "OutputConfigurator::CycleDisplayMode"); - VLOG(1) << "CycleDisplayMode"; - if (!configure_display_) - return false; - - bool did_change = false; - Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay(); - CHECK(display != NULL); - XGrabServer(display); - Window window = DefaultRootWindow(display); - XRRScreenResources* screen = GetScreenResourcesAndRecordUMA(display, window); - CHECK(screen != NULL); - - std::vector<OutputSnapshot> outputs = GetDualOutputs(display, screen); - connected_output_count_ = outputs.size(); - OutputState original = InferCurrentState(display, screen, outputs); - OutputState next_state = GetNextState(display, screen, original, outputs); - if (original != next_state && - EnterState(display, screen, window, next_state, power_state_, outputs)) { - did_change = true; - } - // We have seen cases where the XRandR data can get out of sync with our own - // cache so over-write it with whatever we detected, even if we didn't think - // anything changed. - output_state_ = next_state; - - XRRFreeScreenResources(screen); - XUngrabServer(display); - - if (did_change) { - NotifyOnDisplayChanged(); - } else { - FOR_EACH_OBSERVER( - Observer, observers_, OnDisplayModeChangeFailed(next_state)); - } - return did_change; -} - bool OutputConfigurator::SetDisplayPower(DisplayPowerState power_state, bool force_probe) { TRACE_EVENT0("chromeos", "OutputConfigurator::SetDisplayPower"); diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h index 4f93598..f65a6cc 100644 --- a/chromeos/display/output_configurator.h +++ b/chromeos/display/output_configurator.h @@ -79,11 +79,6 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { // Stop handling display configuration events/requests. void Stop(); - // Called when the user hits ctrl-F4 to request a display mode change. - // This method should only return false if it was called in a single-head or - // headless mode. - bool CycleDisplayMode(); - // Called when powerd notifies us that some set of displays should be turned // on or off. This requires enabling or disabling the CRTC associated with // the display(s) in question so that the low power state is engaged. @@ -91,9 +86,8 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { // |power_state| matches |power_state_|. bool SetDisplayPower(DisplayPowerState power_state, bool force_probe); - // Force switching the display mode to |new_state|. This method is used when - // the user explicitly changes the display mode in the options UI. Returns - // false if it was called in a single-head or headless mode. + // Force switching the display mode to |new_state|. Returns false if + // it was called in a single-head or headless mode. bool SetDisplayMode(OutputState new_state); // Called when an RRNotify event is received. The implementation is |