[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] KWin Xinerama: Move mouse to other screen
From: Hans Meine <hans_meine () gmx ! net>
Date: 2008-10-29 13:02:48
Message-ID: 200810291501.59127.hans_meine () gmx ! net
[Download RAW message or body]
On Tuesday 21 October 2008 16:17:02 Hans Meine wrote:
> You suggested that the functionality could be activated iff "active mouse
> screen" aka "active screen follows mouse" is activated; the more I think
> about this the more sense this makes. This
> - fixes the current problem (without my patch) that "switch to next screen"
> onto an empty screen does not work if "active mouse screen" is not active,
> - prevents the problem that "switch to next screen" back *from* an empty
> screen does not work with my unconditional patch, and
> - makes sense because then this supplements "active screen follows mouse"
> by "mouse follows active screen".
>
> I will post an updated patch soon (maybe only next week).
Here's an updated patch; I also made the FIXMEs more verbose to clearly
explain the remaining problems and how to test it.
Sorry for the delay; I am still sick (and tired of it - being ill I mean).
I really hope this will get testing from Xinerama people and will be
eventually included; I cannot live without the patch anymore!
Best wishes,
Hans
["kwin4_xinerama_pointer_move_active_mouse_screen.diff" (text/x-patch)]
--- kwin-4.1.2/kwin/activation.cpp.orig 2008-04-30 15:58:39.000000000 +0200
+++ kwin-4.1.2/kwin/activation.cpp 2008-10-29 15:00:56.000000000 +0100
@@ -41,6 +41,7 @@
#include "rules.h"
#include "effects.h"
#include <QX11Info>
+#include <QDesktopWidget>
namespace KWin
{
@@ -466,6 +467,13 @@
return;
if ( !options->focusPolicyIsReasonable())
return;
+
+ // QCursor code duplicated with in sendClientToScreen (workspace.cpp):
+ QDesktopWidget *desktopwidget = KApplication::desktop();
+ QPoint cursor_pos =
+ QCursor::pos() -
+ desktopwidget->screenGeometry( active_screen ).topLeft();
+
closeActivePopup();
Client* get_focus = NULL;
for( int i = focus_chain[ currentDesktop() ].count() - 1;
@@ -484,7 +492,15 @@
get_focus = findDesktop( true, currentDesktop());
if( get_focus != NULL && get_focus != mostRecentlyActivatedClient())
requestFocus( get_focus );
+
active_screen = new_screen;
+
+ // FIXME: this may activate the wrong client if focus follows
+ // mouse (should be get_focus according to the above logic)!
+ if( options->activeMouseScreen )
+ QCursor::setPos(
+ desktopwidget->screenGeometry( active_screen ).topLeft() +
+ cursor_pos );
}
void Workspace::gotFocusIn( const Client* c )
--- kwin-4.1.2/kwin/workspace.cpp.orig 2008-08-28 10:07:01.000000000 +0200
+++ kwin-4.1.2/kwin/workspace.cpp 2008-10-29 15:01:12.000000000 +0100
@@ -1687,7 +1687,27 @@
++it )
sendClientToScreen( *it, screen );
if( c->isActive())
+ {
+ // QCursor code duplicated with in setCurrentScreen (activation.cpp):
+ QDesktopWidget *desktopwidget = KApplication::desktop();
+ QPoint cursor_pos =
+ QCursor::pos() -
+ desktopwidget->screenGeometry( active_screen ).topLeft();
+
active_screen = screen;
+
+ // FIXME: this may activate the wrong client (should be 'c')
+ // if focus follows mouse - the latter seems to kick in before
+ // the client is transferred! (A reliable interactive test is
+ // to bind "Window to Next Screen" to a key and repeatedly
+ // activate it; you would expect the same window to jump from
+ // screen to screen, but in the presence of other windows, you
+ // get larger cycles of different windows being transferred.)
+ if( options->activeMouseScreen )
+ QCursor::setPos(
+ desktopwidget->screenGeometry( active_screen ).topLeft() +
+ cursor_pos );
+ }
}
void Workspace::updateDesktopLayout()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic