[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Kstart - put window under others?
From:       David Faure <faure () kde ! org>
Date:       2014-01-27 9:11:50
Message-ID: 1526993.iB6y31S8Nz () asterix
[Download RAW message or body]

On Saturday 25 January 2014 23:16:14 N Rodge wrote:
> Hi,
> 
> If you are busy in a window and something starts up, usually it puts
> the window underneath others and then blinks the task bar.

Yes, I think this is called "demands attention" in the API.

> How do I make Kstart do that, or is there something I can change
> (generally is OK - I'm a programmer) in the source code and compile it
> myself (point me in the right direction, I don't know KDE hooks).
> It would be a good feature. The --onbottom, --keepbelow doesn't do
> this, it makes it stuck below and doesn't come forward easy.

The attached patch (for kde-runtime.git) should give you a starting point.
It doesn't work (maybe because the window gets focus?),
and it should obviously be put under a different option name, I was reusing
--keepbelow just for quick testing before going to work :)

I'm CC'ing the kwin mailing-list where the kwin experts will be able to help 
with this much more than I can do myself ;)

-- 
David Faure, faure@kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5

["kstart_demandattention_unfinished.diff" (kstart_demandattention_unfinished.diff)]

diff --git a/kstart/kstart.cpp b/kstart/kstart.cpp
index 29ccd3e..5b32a5e 100644
--- a/kstart/kstart.cpp
+++ b/kstart/kstart.cpp
@@ -60,6 +60,7 @@ static int desktop = 0;
 static bool activate = false;
 static bool iconify = false;
 static bool fullscreen = false;
+static bool demandAttention = false;
 static unsigned long state = 0;
 static unsigned long mask = 0;
 static NET::WindowType windowtype = NET::Unknown;
@@ -283,6 +284,9 @@ void KStart::applyStyle(WId w ) {
 
     if (activate)
       KWindowSystem::forceActiveWindow( w );
+    if (demandAttention) {
+        KWindowSystem::demandAttention(w, true);
+    }
 
     QApplication::flush();
 }
@@ -394,8 +398,9 @@ int main( int argc, char *argv[] )
       state |= NET::KeepAbove;
       mask |= NET::KeepAbove;
   } else if ( args->isSet( "keepbelow" ) ) {
-      state |= NET::KeepBelow;
-      mask |= NET::KeepBelow;
+      //state |= NET::KeepBelow;
+      //mask |= NET::KeepBelow;
+      demandAttention = true;
   }
 
   if ( args->isSet( "skiptaskbar" ) ) {


_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic