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

Side by Side Diff: chromeos/display/output_configurator.cc

Issue 10829026: Fix display switching for extended displays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/display/output_configurator.h" 5 #include "chromeos/display/output_configurator.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #include <X11/extensions/dpms.h> 8 #include <X11/extensions/dpms.h>
9 #include <X11/extensions/Xrandr.h> 9 #include <X11/extensions/Xrandr.h>
10 10
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 // Primary is tiled first. 652 // Primary is tiled first.
653 state = STATE_DUAL_PRIMARY_ONLY; 653 state = STATE_DUAL_PRIMARY_ONLY;
654 } 654 }
655 } 655 }
656 } 656 }
657 } 657 }
658 658
659 return state; 659 return state;
660 } 660 }
661 661
662 bool OutputConfigurator::CycleDisplayMode() { 662 bool OutputConfigurator::CycleDisplayMode(bool extended_desktop_enabled) {
663 VLOG(1) << "CycleDisplayMode"; 663 VLOG(1) << "CycleDisplayMode";
664 bool did_change = false; 664 bool did_change = false;
665
665 if (is_running_on_chrome_os_) { 666 if (is_running_on_chrome_os_) {
666 // Rules: 667 // Rules:
667 // - if there are 0 or 1 displays, do nothing and return false. 668 // - if there are 0 or 1 displays, do nothing and return false.
668 // - use y-coord of CRTCs to determine if we are mirror, primary-first, or 669 // - use y-coord of CRTCs to determine if we are mirror, primary-first, or
669 // secondary-first. The cycle order is: 670 // secondary-first. The cycle order is:
670 // mirror->primary->secondary->mirror. 671 // mirror->primary->secondary->mirror.
672 // Note: If the extended desktop is enabled, the cycle order becomes,
673 // mirror->extended->mirror
671 State new_state = STATE_INVALID; 674 State new_state = STATE_INVALID;
672 switch (output_state_) { 675 switch (output_state_) {
673 case STATE_DUAL_MIRROR: 676 case STATE_DUAL_MIRROR:
674 new_state = STATE_DUAL_PRIMARY_ONLY; 677 new_state = STATE_DUAL_PRIMARY_ONLY;
675 break; 678 break;
676 case STATE_DUAL_PRIMARY_ONLY: 679 case STATE_DUAL_PRIMARY_ONLY:
677 new_state = STATE_DUAL_SECONDARY_ONLY; 680 if (extended_desktop_enabled) {
681 if (mirror_supported_)
682 new_state = STATE_DUAL_MIRROR;
683 else
684 new_state = STATE_INVALID;
685 } else {
686 new_state = STATE_DUAL_SECONDARY_ONLY;
687 }
678 break; 688 break;
679 case STATE_DUAL_SECONDARY_ONLY: 689 case STATE_DUAL_SECONDARY_ONLY:
680 new_state = mirror_supported_ ? 690 new_state = mirror_supported_ ?
681 STATE_DUAL_MIRROR : 691 STATE_DUAL_MIRROR :
682 STATE_DUAL_PRIMARY_ONLY; 692 STATE_DUAL_PRIMARY_ONLY;
683 break; 693 break;
684 default: 694 default:
685 // Do nothing - we aren't in a mode which we can rotate. 695 // Do nothing - we aren't in a mode which we can rotate.
686 break; 696 break;
687 } 697 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 power_manager::kSetIsProjectingMethod); 828 power_manager::kSetIsProjectingMethod);
819 dbus::MessageWriter writer(&method_call); 829 dbus::MessageWriter writer(&method_call);
820 writer.AppendBool(is_projecting); 830 writer.AppendBool(is_projecting);
821 power_manager_proxy->CallMethod( 831 power_manager_proxy->CallMethod(
822 &method_call, 832 &method_call,
823 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 833 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
824 dbus::ObjectProxy::EmptyResponseCallback()); 834 dbus::ObjectProxy::EmptyResponseCallback());
825 } 835 }
826 836
827 } // namespace chromeos 837 } // namespace chromeos
OLDNEW
« 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