changeset 3160:45ed364bd4f3

Added jump argument to subClientNext()
author unexist
date Mon, 19 Dec 2011 19:43:10 +0100
parents 0f22f61cd418
children 7d63ac8f6460
files src/subtle/client.c src/subtle/subtle.h
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Wed Dec 14 23:19:32 2011 +0100
+++ b/src/subtle/client.c	Mon Dec 19 19:43:10 2011 +0100
@@ -579,11 +579,13 @@
  /** subClientNext {{{
   * @brief Find next client and set focus to it
   * @param[in]  screenid  Screen id
+  * @param[in]  jump      Jump to other screen
   * @return Returns a new #SubClient or \p NULL
   **/
 
 SubClient *
-subClientNext(int screenid)
+subClientNext(int screenid,
+  int jump)
 {
   int i;
   SubClient *c = NULL;
@@ -594,8 +596,7 @@
       if((c = CLIENT(subSubtleFind(subtle->windows.focus[i], CLIENTID))))
         {
           /* Check visibility on current screen */
-          if(c->screenid == screenid &&
-              ALIVE(c) && VISIBLE(c) &&
+          if(c->screenid == screenid && ALIVE(c) && VISIBLE(c) &&
               c->win != subtle->windows.focus[0])
             return c;
         }
@@ -607,14 +608,13 @@
       c = CLIENT(subtle->clients->data[i]);
 
       /* Check visibility on current screen */
-      if(c->screenid == screenid &&
-          ALIVE(c) && VISIBLE(c) &&
+      if(c->screenid == screenid && ALIVE(c) && VISIBLE(c) &&
           c->win != subtle->windows.focus[0])
         return c;
     }
 
   /* Pass 3: Check client stacking list backwards of any visible screen */
-  if(1 < subtle->screens->ndata)
+  if(1 < subtle->screens->ndata && jump)
     {
       for(i = subtle->clients->ndata - 1; 0 <= i; i--)
         {
@@ -1735,7 +1735,7 @@
       /* Update focus if necessary */
       if(-1 != sid)
         {
-          SubClient *k = subClientNext(sid);
+          SubClient *k = subClientNext(sid, False);
 
           if(k) subClientFocus(k, True);
         }
--- a/src/subtle/subtle.h	Wed Dec 14 23:19:32 2011 +0100
+++ b/src/subtle/subtle.h	Mon Dec 19 19:43:10 2011 +0100
@@ -765,7 +765,7 @@
 void subClientConfigure(SubClient *c);                            ///< Send configure request
 void subClientDimension(int id);                                  ///< Dimension clients
 void subClientFocus(SubClient *c, int warp);                      ///< Focus client
-SubClient *subClientNext(int screenid);                      ///< Focus next client
+SubClient *subClientNext(int screenid, int jump);                 ///< Focus next client
 void subClientWarp(SubClient *c);                                 ///< Warp pointer to client
 void subClientDrag(SubClient *c, int mode, int direction);        ///< Move/drag client
 void subClientUpdate(int vid);                                    ///< Update clients