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 --- kdesktop/krootwm.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'kdesktop') 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 -- cgit v1.2.1