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 --- kicker/kicker/core/menumanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'kicker') 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); -- cgit v1.2.1