]> Dogcows Code - chaz/openbox/commitdiff
don't raise windows when moving them between desktops in some cases
authorDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 15:13:16 +0000 (15:13 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 15:13:16 +0000 (15:13 +0000)
openbox/action.c
openbox/client.c
openbox/client.h
openbox/client_menu.c
openbox/event.c
openbox/screen.c

index 52b1de3da18bc4ace02f1c895984786d5cbeb735..da4eee75464f4960ac92cda345e7a4bef49411a1 100644 (file)
@@ -1437,7 +1437,7 @@ void action_toggle_omnipresent(union ActionData *data)
 { 
     client_set_desktop(data->client.any.c,
                        data->client.any.c->desktop == DESKTOP_ALL ?
-                       screen_desktop : DESKTOP_ALL, FALSE);
+                       screen_desktop : DESKTOP_ALL, FALSE, TRUE);
 }
 
 void action_move_relative_horz(union ActionData *data)
@@ -1611,7 +1611,7 @@ void action_send_to_desktop(union ActionData *data)
 
     if (data->sendto.desk < screen_num_desktops ||
         data->sendto.desk == DESKTOP_ALL) {
-        client_set_desktop(c, data->sendto.desk, data->sendto.follow);
+        client_set_desktop(c, data->sendto.desk, data->sendto.follow, FALSE);
         if (data->sendto.follow && data->sendto.desk != screen_desktop)
             screen_set_desktop(data->sendto.desk, TRUE);
     }
@@ -1669,7 +1669,7 @@ void action_send_to_desktop_dir(union ActionData *data)
     if (!data->sendtodir.inter.any.interactive ||
         (data->sendtodir.inter.final && !data->sendtodir.inter.cancel))
     {
-        client_set_desktop(c, d, data->sendtodir.follow);
+        client_set_desktop(c, d, data->sendtodir.follow, FALSE);
         if (data->sendtodir.follow && d != screen_desktop)
             screen_set_desktop(d, TRUE);
     }
@@ -2045,7 +2045,7 @@ void action_add_desktop(union ActionData *data)
         for (it = client_list; it; it = g_list_next(it)) {
             ObClient *c = it->data;
             if (c->desktop != DESKTOP_ALL && c->desktop >= screen_desktop)
-                client_set_desktop(c, c->desktop+1, FALSE);
+                client_set_desktop(c, c->desktop+1, FALSE, TRUE);
         }
     }
 }
@@ -2061,7 +2061,7 @@ void action_remove_desktop(union ActionData *data)
         for (it = client_list; it; it = g_list_next(it)) {
             ObClient *c = it->data;
             if (c->desktop != DESKTOP_ALL && c->desktop > screen_desktop)
-                client_set_desktop(c, c->desktop-1, FALSE);
+                client_set_desktop(c, c->desktop-1, FALSE, TRUE);
         }
     }
 
index 563eb045399749455b66e91c1f8b129562a7c440..d80ed2986736b17b296f47c4e61d22f33acae00b 100644 (file)
@@ -3071,7 +3071,7 @@ static void client_iconify_recursive(ObClient *self,
 
             if (curdesk && self->desktop != screen_desktop &&
                 self->desktop != DESKTOP_ALL)
-                client_set_desktop(self, screen_desktop, FALSE);
+                client_set_desktop(self, screen_desktop, FALSE, FALSE);
 
             /* this puts it after the current focused window */
             focus_order_remove(self);
@@ -3244,7 +3244,8 @@ void client_hilite(ObClient *self, gboolean hilite)
 
 void client_set_desktop_recursive(ObClient *self,
                                   guint target,
-                                  gboolean donthide)
+                                  gboolean donthide,
+                                  gboolean dontraise)
 {
     guint old;
     GSList *it;
@@ -3264,7 +3265,7 @@ void client_set_desktop_recursive(ObClient *self,
         if (!donthide)
             client_showhide(self);
         /* raise if it was not already on the desktop */
-        if (old != DESKTOP_ALL)
+        if (old != DESKTOP_ALL && !dontraise)
             stacking_raise(CLIENT_AS_WINDOW(self));
         if (STRUT_EXISTS(self->strut))
             screen_update_areas();
@@ -3278,13 +3279,15 @@ void client_set_desktop_recursive(ObClient *self,
     for (it = self->transients; it; it = g_slist_next(it))
         if (it->data != self)
             if (client_is_direct_child(self, it->data))
-                client_set_desktop_recursive(it->data, target, donthide);
+                client_set_desktop_recursive(it->data, target,
+                                             donthide, dontraise);
 }
 
-void client_set_desktop(ObClient *self, guint target, gboolean donthide)
+void client_set_desktop(ObClient *self, guint target,
+                        gboolean donthide, gboolean dontraise)
 {
     self = client_search_top_direct_parent(self);
-    client_set_desktop_recursive(self, target, donthide);
+    client_set_desktop_recursive(self, target, donthide, dontraise);
 }
 
 gboolean client_is_direct_child(ObClient *parent, ObClient *child)
@@ -3616,7 +3619,7 @@ static void client_present(ObClient *self, gboolean here, gboolean raise)
         self->desktop != screen_desktop)
     {
         if (here)
-            client_set_desktop(self, screen_desktop, FALSE);
+            client_set_desktop(self, screen_desktop, FALSE, TRUE);
         else
             screen_set_desktop(self->desktop, FALSE);
     } else if (!self->frame->visible)
@@ -3683,7 +3686,7 @@ static void client_bring_windows_recursive(ObClient *self,
         if (iconic && self->iconic)
             client_iconify(self, FALSE, TRUE, FALSE);
         else
-            client_set_desktop(self, desktop, FALSE);
+            client_set_desktop(self, desktop, FALSE, FALSE);
     }
 }
 
index a334ad2bf37ba1b32e1b85e8ec5478da0ce98e9f..812d0ac5e7bf701cca57298b7f941ce072688a33 100644 (file)
@@ -496,8 +496,11 @@ void client_kill(ObClient *self);
 /*! Sends the window to the specified desktop
   @param donthide If TRUE, the window will not be shown/hidden after its
                   desktop has been changed. Generally this should be FALSE.
+  @param dontraise If TRUE, the window will not be raised. Generally this should
+                   be FALSE.
 */
-void client_set_desktop(ObClient *self, guint target, gboolean donthide);
+void client_set_desktop(ObClient *self, guint target, gboolean donthide,
+                        gboolean dontraise);
 
 /*! Show the client if it should be shown. Returns if the window is shown. */
 gboolean client_show(ObClient *self);
index ce29db10b5945d0ad0220a507391b8103b74a4bd..cc67a4613568408d7f1e991ac8f93b8f64e85095 100644 (file)
@@ -286,7 +286,7 @@ static void send_to_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
 {
     g_assert(c);
 
-    client_set_desktop(c, e->id, FALSE);
+    client_set_desktop(c, e->id, FALSE, FALSE);
     /* the client won't even be on the screen anymore, so hide the menu */
     if (f)
         menu_frame_hide_all();
index cfa000d009490e7889c03a0ba7d0949a79eea321..3052e1bf8f6cbd345d2eedaf82786757c6988ae6 100644 (file)
@@ -1264,7 +1264,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
             if ((unsigned)e->xclient.data.l[0] < screen_num_desktops ||
                 (unsigned)e->xclient.data.l[0] == DESKTOP_ALL)
                 client_set_desktop(client, (unsigned)e->xclient.data.l[0],
-                                   FALSE);
+                                   FALSE, FALSE);
         } else if (msgtype == prop_atoms.net_wm_state) {
             gulong ignore_start;
 
index 92d4d9a421bac5db1a62a8b59fc81cc9fee8f6b4..3d3d73cd29f2f96aab8d66b1d9eca4e91301b212 100644 (file)
@@ -520,7 +520,7 @@ void screen_set_num_desktops(guint num)
     for (it = client_list; it; it = g_list_next(it)) {
         ObClient *c = it->data;
         if (c->desktop >= num && c->desktop != DESKTOP_ALL)
-            client_set_desktop(c, num - 1, FALSE);
+            client_set_desktop(c, num - 1, FALSE, TRUE);
     }
  
     /* change our struts/area to match (after moving windows) */
@@ -561,7 +561,7 @@ void screen_set_desktop(guint num, gboolean dofocus)
     ignore_start = event_start_ignore_all_enters();
 
     if (moveresize_client)
-        client_set_desktop(moveresize_client, num, TRUE);
+        client_set_desktop(moveresize_client, num, TRUE, FALSE);
 
     /* show windows before hiding the rest to lessen the enter/leave events */
 
This page took 0.03873 seconds and 4 git commands to generate.