From c84b674e6a24ad1c2f52abe0ef18b636e08b8604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 18 Dec 2003 12:16:30 +0000 Subject: [PATCH] Pass also the currently active window in the _NET_ACTIVE_WINDOW message. svn path=/trunk/kdebase/kwin/; revision=273668 --- events.cpp | 8 +++++++- workspace.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/events.cpp b/events.cpp index 0ff6bc3db2..439241fd2b 100644 --- a/events.cpp +++ b/events.cpp @@ -103,7 +103,7 @@ void RootInfo::changeCurrentDesktop(int d) workspace->setCurrentDesktop( d ); } -void RootInfo::changeActiveWindow( Window w, NET::RequestSource src, Time timestamp ) +void RootInfo::changeActiveWindow( Window w, NET::RequestSource src, Time timestamp, Window active_window ) { if( Client* c = workspace->findClient( WindowMatchPredicate( w ))) { @@ -113,8 +113,14 @@ void RootInfo::changeActiveWindow( Window w, NET::RequestSource src, Time timest workspace->activateClient( c ); else // NET::FromApplication { + Client* c2; if( workspace->allowClientActivation( c, timestamp )) workspace->activateClient( c ); + // if activation of the requestor's window would be allowed, allow activation too + else if( active_window != None + && ( c2 = workspace->findClient( WindowMatchPredicate( active_window ))) != NULL + && workspace->allowClientActivation( c2, timestamp )) + workspace->activateClient( c ); else c->demandAttention(); } diff --git a/workspace.h b/workspace.h index 528d915cd3..b4142d451f 100644 --- a/workspace.h +++ b/workspace.h @@ -539,7 +539,7 @@ class RootInfo : public NETRootInfo2 virtual void changeNumberOfDesktops(int n); virtual void changeCurrentDesktop(int d); // virtual void changeActiveWindow(Window w); the extended version is used - virtual void changeActiveWindow(Window w,NET::RequestSource src, Time timestamp); + virtual void changeActiveWindow(Window w,NET::RequestSource src, Time timestamp, Window active_window); virtual void closeWindow(Window w); virtual void moveResize(Window w, int x_root, int y_root, unsigned long direction); virtual void moveResizeWindow(Window w, int flags, int x, int y, int width, int height );