summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-29 03:39:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-29 03:39:29 +0000
commit71519fb37e5d0794a36e28d0c6efe1d197639ccb (patch)
tree40ad972526bf79141ec23f21e6481975d67ea6b4
parent5669b778e5426a75b50fcd63deaba022c25ab5bc (diff)
downloadtdebase-71519fb37e5d0794a36e28d0c6efe1d197639ccb.tar.gz
tdebase-71519fb37e5d0794a36e28d0c6efe1d197639ccb.zip
More display switching repairs
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1120414 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--kcontrol/randr/krandrtray.cpp19
-rw-r--r--kcontrol/randr/krandrtray.h3
-rw-r--r--kdesktop/krootwm.cc12
-rw-r--r--kicker/kicker/core/menumanager.cpp6
-rw-r--r--kwin/workspace.cpp2
5 files changed, 32 insertions, 10 deletions
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 <qptrlist.h>
+#include <qapplication.h>
#include <ksystemtray.h>
#include <kglobalaccel.h>
@@ -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;
diff --git a/kdesktop/krootwm.cc b/kdesktop/krootwm.cc
index fa22ab146..145360b65 100644
--- a/kdesktop/krootwm.cc
+++ b/kdesktop/krootwm.cc
@@ -600,7 +600,11 @@ void KRootWm::slotWindowList() {
// kdDebug() << "KRootWm::slotWindowList" << endl;
// Popup at the center of the screen, this is from keyboard shortcut.
QDesktopWidget* desktop = KApplication::desktop();
- QRect r = desktop->screenGeometry( desktop->screenNumber(QCursor::pos()));
+ QRect r;
+ if (desktop->numScreens() < 2)
+ r = desktop->geometry();
+ else
+ r = desktop->screenGeometry( desktop->screenNumber(QCursor::pos()));
windowListMenu->init();
disconnect( windowListMenu, SIGNAL( aboutToShow() ),
this, SLOT( slotWindowListAboutToShow() ) ); // avoid calling init() twice
@@ -616,7 +620,11 @@ void KRootWm::slotSwitchUser() {
if (!sessionsMenu)
return;
QDesktopWidget* desktop = KApplication::desktop();
- QRect r = desktop->screenGeometry( desktop->screenNumber(QCursor::pos()));
+ QRect r;
+ if (desktop->numScreens() < 2)
+ r = desktop->geometry();
+ else
+ r = desktop->screenGeometry( desktop->screenNumber(QCursor::pos()));
slotPopulateSessions();
disconnect( sessionsMenu, SIGNAL( aboutToShow() ),
this, SLOT( slotPopulateSessions() ) ); // avoid calling init() twice
diff --git a/kicker/kicker/core/menumanager.cpp b/kicker/kicker/core/menumanager.cpp
index ba07b39c7..9e4a91f97 100644
--- a/kicker/kicker/core/menumanager.cpp
+++ b/kicker/kicker/core/menumanager.cpp
@@ -150,7 +150,11 @@ void MenuManager::kmenuAccelActivated()
QPoint p;
// Popup the K-menu at the center of the screen.
QDesktopWidget* desktop = KApplication::desktop();
- QRect r = desktop->screenGeometry(desktop->screenNumber(QCursor::pos()));
+ QRect r;
+ if (desktop->numScreens() < 2)
+ r = desktop->geometry();
+ else
+ r = desktop->screenGeometry(desktop->screenNumber(QCursor::pos()));
// kMenu->rect() is not valid before showing, use sizeHint()
p = r.center() - QRect( QPoint( 0, 0 ), m_kmenu->sizeHint()).center();
m_kmenu->popup(p);
diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp
index 2bf94c9a5..e04f0590d 100644
--- a/kwin/workspace.cpp
+++ b/kwin/workspace.cpp
@@ -1568,7 +1568,7 @@ void Workspace::setActiveScreenMouse( QPoint mousepos )
QRect Workspace::screenGeometry( int screen ) const
{
- if( !options->xineramaEnabled )
+ if (( !options->xineramaEnabled ) || (kapp->desktop()->numScreens() < 2))
return qApp->desktop()->geometry();
return qApp->desktop()->screenGeometry( screen );
}