diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-09-25 03:00:30 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-09-25 03:00:30 +0000 |
| commit | 2d1b5d6e0a46cd8d3c89dec7662e28106dee0b88 (patch) | |
| tree | 0121d123bc0f0a3919f49d5faed70aa7ad5585ba | |
| parent | e4911d91c873d554e3418a13778a4ed293431e8c (diff) | |
handle the focus_cycle_target being destroyed during cycling
| -rw-r--r-- | openbox/focus.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/openbox/focus.c b/openbox/focus.c index 541cf010..1006c725 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -42,13 +42,23 @@ ObClient *focus_cycle_target; static ObIconPopup *focus_cycle_popup; +static void focus_cycle_destructor(ObClient *c) +{ + /* end cycling if the target disappears */ + if (focus_cycle_target == c) + focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE); +} + void focus_startup(gboolean reconfig) { focus_cycle_popup = icon_popup_new(TRUE); - if (!reconfig) + if (!reconfig) { + client_add_destructor((GDestroyNotify) focus_cycle_destructor); + /* start with nothing focused */ focus_set_client(NULL); + } } void focus_shutdown(gboolean reconfig) @@ -58,6 +68,8 @@ void focus_shutdown(gboolean reconfig) icon_popup_free(focus_cycle_popup); if (!reconfig) { + client_remove_destructor((GDestroyNotify) focus_cycle_destructor); + for (i = 0; i < screen_num_desktops; ++i) g_list_free(focus_order[i]); g_free(focus_order); |
