don't raise windows when moving them between desktops in some cases

This commit is contained in:
Dana Jansens 2007-06-13 15:13:16 +00:00
parent 07f60c3a38
commit 99c6a00cf6
6 changed files with 24 additions and 18 deletions

View 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);
}
}

View 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);
}
}

View 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);

View 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();

View 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;

View 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 */