make focusEnsurance() multi-screen capable (at least I hope it works this

way)

svn path=/trunk/kdebase/kwin/; revision=105769
This commit is contained in:
Matthias Ettrich 2001-07-12 13:50:19 +00:00
parent 1540b2bf62
commit a325dd9966

View file

@ -4009,6 +4009,16 @@ void Workspace::focusEnsurance()
int revert;
XGetInputFocus( qt_xdisplay(), &focus, &revert );
if ( focus == None || focus == PointerRoot ) {
Window root_return;
Window child = root;
int root_x, root_y, lx, ly;
uint state;
Window w;
if ( ! XQueryPointer( qt_xdisplay(), root, &root_return, &child,
&root_x, &root_y, &lx, &ly, &state ) )
return; // cursor is on another screen, so do not play with focus
if ( !last_active_client )
last_active_client = topClientOnDesktop();
if ( last_active_client && last_active_client->isVisible() ) {
@ -4030,7 +4040,7 @@ void Workspace::checkStartOnDesktop( WId w )
KStartupInfoData data;
if( d->startup->checkStartup( w, data ) != KStartupInfo::Match || data.desktop() == 0 )
return;
NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NET::WMDesktop );
NETWinInfo info( qt_xdisplay(), w, root, NET::WMDesktop );
if( info.desktop() == 0 )
info.setDesktop( data.desktop());
}