~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy

« back to all changes in this revision

Viewing changes to kcontrol/randr/randrdisplay.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-11 14:04:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071011140448-v0eb7lxbb24zagca
Tags: 3.94.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <KLocale>
 
21
#include <KConfigGroup>
 
22
#include <KDebug>
21
23
#include <QApplication>
22
24
#include <QDesktopWidget>
23
25
#include <QX11Info>
66
68
                        m_legacyScreens.append(new LegacyRandRScreen(i));
67
69
        }
68
70
 
 
71
#ifdef HAS_RANDR_1_2
 
72
        // check if we have more than one output, if no, revert to the legacy behavior
 
73
        if (RandR::has_1_2)
 
74
        {
 
75
                int count = 0;
 
76
                foreach(RandRScreen *screen, m_screens)
 
77
                        count += screen->outputs().count();
 
78
 
 
79
                if (count < 2)
 
80
                {
 
81
                        RandR::has_1_2 = false;
 
82
                        for (int i = 0; i < m_numScreens; ++i)
 
83
                        {
 
84
                                delete m_screens[i];
 
85
                                m_legacyScreens.append(new LegacyRandRScreen(i));
 
86
                        }
 
87
                        m_screens.clear();
 
88
                }
 
89
        }
 
90
#endif
 
91
 
69
92
        setCurrentScreen(QApplication::desktop()->primaryScreen());
70
93
}
71
94