]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
make activate take a here parameter
[chaz/openbox] / openbox / client.c
index 81eafa7d0110b0e9d6775e65230dba69f8f7fcf0..a1deded5a06fcb790e2a7bdc7d3a4d41ef42cd1d 100644 (file)
@@ -2533,16 +2533,19 @@ void client_unfocus(ObClient *self)
     focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
 }
 
-void client_activate(ObClient *self)
+void client_activate(ObClient *self, gboolean here)
 {
     if (client_normal(self) && screen_showing_desktop)
         screen_show_desktop(FALSE);
     if (self->iconic)
         client_iconify(self, FALSE, FALSE);
     if (self->desktop != DESKTOP_ALL &&
-        self->desktop != screen_desktop)
-        screen_set_desktop(self->desktop);
-    else if (!self->frame->visible)
+        self->desktop != screen_desktop) {
+        if (here)
+            client_set_desktop(self, screen_desktop, FALSE);
+        else
+            screen_set_desktop(self->desktop);
+    } else if (!self->frame->visible)
         /* if its not visible for other reasons, then don't mess
            with it */
         return;
@@ -2796,11 +2799,11 @@ int client_directional_edge_search(ObClient *c, ObDirection dir)
             his_edge_end = cur->frame->area.x + cur->frame->area.width;
             his_offset = cur->frame->area.y + cur->frame->area.height;
 
-            if(his_offset + c->size_inc.height > my_offset)
+            if(his_offset + 1 > my_offset)
                 continue;
 
             if(his_offset < dest)
-                    continue;
+                continue;
             
             if(his_edge_start >= my_edge_start &&
                his_edge_start <= my_edge_end)
@@ -2837,11 +2840,11 @@ int client_directional_edge_search(ObClient *c, ObDirection dir)
             his_offset = cur->frame->area.y;
 
 
-            if(his_offset - c->size_inc.height < my_offset)
+            if(his_offset - 1 < my_offset)
                 continue;
             
             if(his_offset > dest)
-                    continue;
+                continue;
             
             if(his_edge_start >= my_edge_start &&
                his_edge_start <= my_edge_end)
@@ -2877,11 +2880,11 @@ int client_directional_edge_search(ObClient *c, ObDirection dir)
             his_edge_end = cur->frame->area.y + cur->frame->area.height;
             his_offset = cur->frame->area.x + cur->frame->area.width;
 
-            if(his_offset + c->size_inc.width > my_offset)
+            if(his_offset + 1 > my_offset)
                 continue;
             
             if(his_offset < dest)
-                    continue;
+                continue;
             
             if(his_edge_start >= my_edge_start &&
                his_edge_start <= my_edge_end)
@@ -2918,11 +2921,11 @@ int client_directional_edge_search(ObClient *c, ObDirection dir)
             his_edge_end = cur->frame->area.y + cur->frame->area.height;
             his_offset = cur->frame->area.x;
 
-            if(his_offset - c->size_inc.width < my_offset)
+            if(his_offset - 1 < my_offset)
                 continue;
             
             if(his_offset > dest)
-                    continue;
+                continue;
             
             if(his_edge_start >= my_edge_start &&
                his_edge_start <= my_edge_end)
This page took 0.021962 seconds and 4 git commands to generate.