PATCH: kwin

Matthias Ettrich ettrich at trolltech.com
Tue Apr 16 20:28:14 BST 2002


The patch makes the do-not-steal-focus behavious less agressive. Among others 
it makes xv work properly with KDE again.

It does two things:

 1. like the comment claimed already, discard usertime if not defined   
    (userTime() returning 0 )

 2. user resourceClass() as another hint whether a window really is 
     a kind of dialog of the active client. Some apps do not use the
     transient hints (like the mentioned all time favorite of all window
     manager authors aka xv)

Feedback welcome, I really like to commit this to the 3.0 branch.

Matthias

Index: client.cpp
===================================================================
RCS file: /home/kde/kdebase/kwin/client.cpp,v
retrieving revision 1.293
diff -d -u -r1.293 client.cpp
--- client.cpp	2002/03/17 13:32:05	1.293
+++ client.cpp	2002/04/16 19:23:17
@@ -856,8 +856,10 @@
             // window does not stem from a restored session.
             Client* ac = workspace()->activeClient();

+            unsigned long usertime = 0;	
             if ( !isTransient() && !session && ac && !ac->isDesktop() &&
-                 ac->userTime() > userTime() ) {
+                   ac->resourceClass() != resourceClass() &&
+                   ( usertime = userTime() ) > 0 && ac->userTime() > usertime 
) {
                 workspace()->stackClientUnderActive( this );
                 show();
             } else {





More information about the kde-core-devel mailing list