diff --git a/activation.cpp b/activation.cpp index 844c908c06..8be0e08843 100644 --- a/activation.cpp +++ b/activation.cpp @@ -220,7 +220,7 @@ void Workspace::setActiveClient( Client* c, allowed_t ) closeActivePopup(); StackingUpdatesBlocker blocker( this ); ++set_active_client_recursion; - updateFocusMousePosition( QCursor::pos()); + updateFocusMousePosition( cursorPos()); if( active_client != NULL ) { // note that this may call setActiveClient( NULL ), therefore the recursion counter active_client->setActive( false ); diff --git a/workspace.cpp b/workspace.cpp index edc46acaa0..dda03209a5 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1613,7 +1613,7 @@ int Workspace::activeScreen() const return qApp->desktop()->screenNumber( activeClient()->geometry().center()); return active_screen; } - return qApp->desktop()->screenNumber( QCursor::pos()); + return qApp->desktop()->screenNumber( cursorPos()); } // check whether a client moved completely out of what's considered the active screen, @@ -2587,7 +2587,7 @@ static QPoint last_cursor_pos; static int last_buttons = 0; static Time last_cursor_timestamp = CurrentTime; -QPoint Workspace::cursorPos() +QPoint Workspace::cursorPos() const { if( last_cursor_timestamp == CurrentTime || last_cursor_timestamp != QX11Info::appTime()) @@ -2601,7 +2601,7 @@ QPoint Workspace::cursorPos() &root_x, &root_y, &win_x, &win_y, &state ); last_cursor_pos = QPoint( root_x, root_y ); last_buttons = state; - QTimer::singleShot( 0, this, SLOT( resetCursorPosTime())); + QTimer::singleShot( 0, const_cast< Workspace* >( this ), SLOT( resetCursorPosTime())); } return last_cursor_pos; } diff --git a/workspace.h b/workspace.h index b54ac30969..dcaacfbdcb 100644 --- a/workspace.h +++ b/workspace.h @@ -271,7 +271,7 @@ class Workspace : public QObject, public KDecorationDefines bool globalShortcutsDisabled() const; void disableGlobalShortcuts( bool disable ); void disableGlobalShortcutsForClient( bool disable ); - QPoint cursorPos(); + QPoint cursorPos() const; void sessionSaveStarted(); void sessionSaveDone();