From 71519fb37e5d0794a36e28d0c6efe1d197639ccb Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 29 Apr 2010 03:39:29 +0000 Subject: More display switching repairs git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1120414 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/randr/krandrtray.cpp | 19 +++++++++++++------ kcontrol/randr/krandrtray.h | 3 +++ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'kcontrol/randr') diff --git a/kcontrol/randr/krandrtray.cpp b/kcontrol/randr/krandrtray.cpp index 18d14bdc6..422aebba2 100644 --- a/kcontrol/randr/krandrtray.cpp +++ b/kcontrol/randr/krandrtray.cpp @@ -136,14 +136,13 @@ void KRandRSystemTray::contextMenuAboutToShow(KPopupMenu* menu) findPrimaryDisplay(); refresh(); +#ifndef QT_XRANDR_FIXES_01 // HACK - // This is needed because Qt does not properly generate screen + // This is needed because all unpatched versions of Qt does not properly generate screen // resize events when switching screens, so KDE gets stuck in the old resolution - // This only seems to happen with more than one screen, so check for that condition... - if (kapp->desktop()->numScreens() > 1) { - currentScreen()->proposeSize(GetHackResolutionParameter()); - currentScreen()->applyProposed(); - } + currentScreen()->proposeSize(GetHackResolutionParameter()); + currentScreen()->applyProposed(); +#endif currentScreen()->proposeSize(GetDefaultResolutionParameter()); currentScreen()->applyProposed(); @@ -257,6 +256,9 @@ int KRandRSystemTray::GetDefaultResolutionParameter() return returnIndex; } +#ifndef QT_XRANDR_FIXES_01 +#warning "Your version of Qt3 does not contain the XRandR screen switching patch. This will force a slow and suboptimal display switching method." +// HACK int KRandRSystemTray::GetHackResolutionParameter() { int resparm; @@ -265,6 +267,7 @@ int KRandRSystemTray::GetHackResolutionParameter() { return resparm; } +#endif void KRandRSystemTray::populateMenu(KPopupMenu* menu) { @@ -558,6 +561,7 @@ void KRandRSystemTray::slotCycleDisplays() findPrimaryDisplay(); refresh(); +#ifndef QT_XRANDR_FIXES_01 // HACK // This is needed because Qt does not properly generate screen // resize events when switching screens, so KDE gets stuck in the old resolution @@ -566,6 +570,7 @@ void KRandRSystemTray::slotCycleDisplays() currentScreen()->proposeSize(GetHackResolutionParameter()); currentScreen()->applyProposed(); } +#endif currentScreen()->proposeSize(GetDefaultResolutionParameter()); currentScreen()->applyProposed(); @@ -741,6 +746,7 @@ void KRandRSystemTray::slotOutputChanged(int parameter) findPrimaryDisplay(); refresh(); +#ifndef QT_XRANDR_FIXES_01 // HACK // This is needed because Qt does not properly generate screen // resize events when switching screens, so KDE gets stuck in the old resolution @@ -749,6 +755,7 @@ void KRandRSystemTray::slotOutputChanged(int parameter) currentScreen()->proposeSize(GetHackResolutionParameter()); currentScreen()->applyProposed(); } +#endif currentScreen()->proposeSize(GetDefaultResolutionParameter()); currentScreen()->applyProposed(); diff --git a/kcontrol/randr/krandrtray.h b/kcontrol/randr/krandrtray.h index fac91e358..6a2892a2d 100644 --- a/kcontrol/randr/krandrtray.h +++ b/kcontrol/randr/krandrtray.h @@ -21,6 +21,7 @@ #include +#include #include #include @@ -62,7 +63,9 @@ private: void populateMenu(KPopupMenu* menu); void addOutputMenu(KPopupMenu* menu); int GetDefaultResolutionParameter(); +#ifndef QT_XRANDR_FIXES_01 int GetHackResolutionParameter(); +#endif void findPrimaryDisplay(); bool m_popupUp; -- cgit v1.2.1