don't raise windows when moving them between desktops in some cases
Dana Jansens danakj@orodu.net
6 files changed,
24 insertions(+),
18 deletions(-)
M
openbox/action.c
→
openbox/action.c
@@ -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 @@ if (!client_normal(c)) return;
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 @@ NotifyWhileGrabbed and applications don't like that. */
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 @@
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 @@
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); } }
M
openbox/client.c
→
openbox/client.c
@@ -3071,7 +3071,7 @@ self->iconic = iconic;
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_set_desktop_recursive(ObClient *self, guint target, - gboolean donthide) + gboolean donthide, + gboolean dontraise) { guint old; GSList *it;@@ -3264,7 +3265,7 @@ /* 'move' the window to the new desktop */
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 @@ /* move all transients */
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 @@ if (self->desktop != DESKTOP_ALL &&
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 @@ {
if (iconic && self->iconic) client_iconify(self, FALSE, TRUE, FALSE); else - client_set_desktop(self, desktop, FALSE); + client_set_desktop(self, desktop, FALSE, FALSE); } }
M
openbox/client.h
→
openbox/client.h
@@ -496,8 +496,11 @@
/*! 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);
M
openbox/event.c
→
openbox/event.c
@@ -1264,7 +1264,7 @@ }
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;
M
openbox/screen.c
→
openbox/screen.c
@@ -520,7 +520,7 @@ /* move windows on desktops that will no longer exist! */
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 @@ /* ignore enter events caused by the move */
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 */