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

List:       kde-devel
Subject:    Window raise-or-lower
From:       Adriaan de Groot <adridg () cs ! kun ! nl>
Date:       2001-03-30 14:57:05
[Download RAW message or body]

People say that KDE 1.1.2 used to have a window raise-or-lower binding. I
know TWM had it. FVWM might have, I don't know. What this feature does is:

	If the window that currently has the focus is at the top of the
	window stack, lower it. Otherwise raise it to the top of the
	stack.

This is useful when you've got two overlapping windows that cover most of
the screen and you want to switch between them. Anyway, I've attached a
patch (most of it was already in there, we just needed an actual
keybinding for it). The patch is (a) relative to 2_1_BRANCH and
(b) relative to the other -- window shade -- patch I just sent in. So it
may apply with considerable offset. Could someone take a look and either
commit, comment, or give me the OK (in which case I'll commit it myself,
to HEAD) ?

-- 
+------------------------------+--------------------------------------------+
+ Adriaan de Groot             + Project: FRESCoS                           +
+ adridg@cs.kun.nl             + Private: adridg@sci.kun.nl                 +
+ Kamer A6020 tel. 024 3652272 + http://www.cs.kun.nl/~adridg/frescos/      +

["raiseLower.diff" (TEXT/PLAIN)]

Index: kwin/kwinbindings.cpp
===================================================================
RCS file: /home/kde/kdebase/kwin/kwinbindings.cpp,v
retrieving revision 1.12
diff -u -r1.12 kwinbindings.cpp
--- kwin/kwinbindings.cpp	2001/02/14 13:35:02	1.12
+++ kwin/kwinbindings.cpp	2001/03/30 14:48:55
@@ -32,6 +32,7 @@
  keys->insertItem(i18n("Window resize"),"Window resize", "");
  keys->insertItem(i18n("Window raise"),"Window raise", "");
  keys->insertItem(i18n("Window lower"),"Window lower", "");
+ keys->insertItem(i18n("Window raise-or-lower"), "Toggle raise and lower", "");
 
  keys->insertItem(i18n("Mouse emulation"),"Mouse emulation", "ALT+F12");
 
Index: kwin/workspace.cpp
===================================================================
RCS file: /home/kde/kdebase/kwin/workspace.cpp,v
retrieving revision 1.215
diff -u -r1.215 workspace.cpp
--- kwin/workspace.cpp	2001/02/21 18:29:24	1.215
+++ kwin/workspace.cpp	2001/03/30 14:48:56
@@ -1820,7 +1820,21 @@
 
 }
 
+void Workspace::raiseOrLowerClient( Client *c)
+{
+    if (!c) return;
+
+    if (c == most_recently_raised)
+    {
+        lowerClient(c);
+    }
+    else
+    {
+        raiseClient(c);
+    }
+}
 
+
 /*!
   Private auxiliary function used in raiseClient()
  */
@@ -2164,6 +2178,7 @@
     keys->connectItem( "Window resize", this, SLOT( slotWindowResize() ) );
     keys->connectItem( "Window raise", this, SLOT( slotWindowRaise() ) );
     keys->connectItem( "Window lower", this, SLOT( slotWindowLower() ) );
+    keys->connectItem( "Toggle raise and lower", this, SLOT( slotWindowRaiseOrLower() ) );
 
     keys->connectItem( "Mouse emulation", this, SLOT( slotMouseEmulation() ) );
 
@@ -2324,6 +2339,15 @@
 {
     if ( popup_client )
         lowerClient( popup_client );
+}
+
+/*!
+  Does a toggle-raise-and-lower on the popup client;
+  */
+void Workspace::slotWindowRaiseOrLower()
+{
+    if  ( popup_client )
+        raiseOrLowerClient( popup_client );
 }
 
 
Index: kwin/workspace.h
===================================================================
RCS file: /home/kde/kdebase/kwin/workspace.h,v
retrieving revision 1.68
diff -u -r1.68 workspace.h
--- kwin/workspace.h	2001/02/21 18:29:24	1.68
+++ kwin/workspace.h	2001/03/30 14:48:56
@@ -128,6 +128,7 @@
     QPoint adjustClientPosition( Client* c, QPoint pos );
     void raiseClient( Client* c );
     void lowerClient( Client* c );
+    void raiseOrLowerClient( Client * );
 
     void clientHidden( Client*  );
 
@@ -227,6 +228,7 @@
     void slotWindowShade();
     void slotWindowRaise();
     void slotWindowLower();
+    void slotWindowRaiseOrLower();
 
     void slotWindowOperations();
     void slotWindowClose();

>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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