changeset 3138:7a96f23ea202

Updated #110: Removed obsolete raise argument from subClientWarp and updated subClientFocus
author unexist
date Fri, 18 Nov 2011 22:57:41 +0100
parents 37080a7864b2
children 514eb5ac9246
files src/subtle/client.c
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Fri Nov 18 22:56:08 2011 +0100
+++ b/src/subtle/client.c	Fri Nov 18 22:57:41 2011 +0100
@@ -509,11 +509,13 @@
 
  /** subClientFocus {{{
   * @brief Set focus to client
-  * @param[in]  c  A #SubClient
+  * @param[in]  c     A #SubClient
+  * @param[in]  warp  Whether to warp pointer to window
   **/
 
 void
-subClientFocus(SubClient *c)
+subClientFocus(SubClient *c,
+  int warp)
 {
   DEAD(c);
   assert(c);
@@ -533,23 +535,26 @@
     }
   else if(c->flags & SUB_CLIENT_INPUT)
     XSetInputFocus(subtle->dpy, c->win, RevertToPointerRoot, CurrentTime);
+
+  /* Warp pointer */
+  if(warp) subClientWarp(c);
 } /* }}} */
 
  /** subClientWarp {{{
   * @brief Warp pointer to window center
-  * @param[in]  c     A #SubClient
-  * @param[in]  rise  Raise window
+  * @param[in]  c  A #SubClient
   **/
 
 void
-subClientWarp(SubClient *c,
-  int rise)
+subClientWarp(SubClient *c)
 {
   DEAD(c);
   assert(c);
 
-  XWarpPointer(subtle->dpy, None, ROOT, 0, 0, 0, 0,
-    c->geom.x + c->geom.width / 2, c->geom.y + c->geom.height / 2);
+  /* Move pointer to window center */
+  if(!(subtle->flags & SUB_SUBTLE_CLICK_TO_FOCUS))
+    XWarpPointer(subtle->dpy, None, ROOT, 0, 0, 0, 0,
+      c->geom.x + c->geom.width / 2, c->geom.y + c->geom.height / 2);
 } /* }}} */
 
  /** subClientDrag {{{