only kill focus cycling when the window being destroyed was in the list of targets

This commit is contained in:
Dana Jansens 2007-05-26 21:22:28 +00:00
parent 11c4ce4903
commit aa7c36d1bc
3 changed files with 28 additions and 11 deletions

View file

@ -75,7 +75,8 @@ void focus_set_client(ObClient *client)
screen_install_colormap(client, TRUE);
/* in the middle of cycling..? kill it. */
focus_cycle_stop();
focus_cycle_stop(focus_client);
focus_cycle_stop(client);
focus_client = client;
@ -208,7 +209,7 @@ void focus_order_add_new(ObClient *c)
}
/* in the middle of cycling..? kill it. */
focus_cycle_stop();
focus_cycle_stop(c);
}
void focus_order_remove(ObClient *c)
@ -216,7 +217,7 @@ void focus_order_remove(ObClient *c)
focus_order = g_list_remove(focus_order, c);
/* in the middle of cycling..? kill it. */
focus_cycle_stop();
focus_cycle_stop(c);
}
void focus_order_to_top(ObClient *c)

View file

@ -32,6 +32,7 @@
#include <glib.h>
ObClient *focus_cycle_target = NULL;
static gboolean focus_cycle_iconic_windows;
static gboolean focus_cycle_all_desktops;
static gboolean focus_cycle_dock_windows;
static gboolean focus_cycle_desktop_windows;
@ -58,9 +59,17 @@ void focus_cycle_shutdown(gboolean reconfig)
if (reconfig) return;
}
void focus_cycle_stop()
void focus_cycle_stop(ObClient *ifclient)
{
if (focus_cycle_target) {
/* stop focus cycling if the given client is a valid focus target,
and so the cycling is being disrupted */
if (focus_cycle_target && ifclient &&
focus_cycle_target_valid(ifclient,
focus_cycle_iconic_windows,
focus_cycle_all_desktops,
focus_cycle_dock_windows,
focus_cycle_desktop_windows))
{
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
}
@ -179,7 +188,8 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
if (focus_cycle_target == NULL) {
focus_cycle_all_desktops = FALSE;
focus_cycle_iconic_windows = TRUE;
focus_cycle_all_desktops = all_desktops;
focus_cycle_dock_windows = dock_windows;
focus_cycle_desktop_windows = desktop_windows;
focus_cycle_target = focus_client;
@ -199,7 +209,8 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
if (it == NULL) it = g_list_last(list);
}
ft = it->data;
if (focus_cycle_target_valid(ft, TRUE,
if (focus_cycle_target_valid(ft,
focus_cycle_iconic_windows,
focus_cycle_all_desktops,
focus_cycle_dock_windows,
focus_cycle_desktop_windows))
@ -211,7 +222,8 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
}
if (dialog)
/* same arguments as focus_target_valid */
focus_cycle_popup_show(ft, TRUE,
focus_cycle_popup_show(ft,
focus_cycle_iconic_windows,
focus_cycle_all_desktops,
focus_cycle_dock_windows,
focus_cycle_desktop_windows);
@ -356,6 +368,7 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
goto done_cycle;
if (focus_cycle_target == NULL) {
focus_cycle_iconic_windows = FALSE;
focus_cycle_all_desktops = FALSE;
focus_cycle_dock_windows = dock_windows;
focus_cycle_desktop_windows = desktop_windows;
@ -371,7 +384,9 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
GList *it;
for (it = focus_order; it; it = g_list_next(it))
if (focus_cycle_target_valid(it->data, FALSE, FALSE,
if (focus_cycle_target_valid(it->data,
focus_cycle_iconic_windows,
focus_cycle_all_desktops,
focus_cycle_dock_windows,
focus_cycle_desktop_windows))
ft = it->data;
@ -386,7 +401,8 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
if (focus_cycle_target && dialog) {
/* same arguments as focus_target_valid */
focus_cycle_popup_single_show(focus_cycle_target,
FALSE, FALSE,
focus_cycle_iconic_windows,
focus_cycle_all_desktops,
focus_cycle_dock_windows,
focus_cycle_desktop_windows);
return;

View file

@ -42,7 +42,7 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
gboolean desktop_windows, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel);
void focus_cycle_stop();
void focus_cycle_stop(struct _ObClient *ifclient);
gboolean focus_cycle_target_valid(struct _ObClient *ft,
gboolean iconic_windows,