handle the focus_cycle_target being destroyed during cycling
This commit is contained in:
parent
e4911d91c8
commit
2d1b5d6e0a
1 changed files with 13 additions and 1 deletions
|
@ -42,14 +42,24 @@ ObClient *focus_cycle_target;
|
||||||
|
|
||||||
static ObIconPopup *focus_cycle_popup;
|
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)
|
void focus_startup(gboolean reconfig)
|
||||||
{
|
{
|
||||||
focus_cycle_popup = icon_popup_new(TRUE);
|
focus_cycle_popup = icon_popup_new(TRUE);
|
||||||
|
|
||||||
if (!reconfig)
|
if (!reconfig) {
|
||||||
|
client_add_destructor((GDestroyNotify) focus_cycle_destructor);
|
||||||
|
|
||||||
/* start with nothing focused */
|
/* start with nothing focused */
|
||||||
focus_set_client(NULL);
|
focus_set_client(NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void focus_shutdown(gboolean reconfig)
|
void focus_shutdown(gboolean reconfig)
|
||||||
{
|
{
|
||||||
|
@ -58,6 +68,8 @@ void focus_shutdown(gboolean reconfig)
|
||||||
icon_popup_free(focus_cycle_popup);
|
icon_popup_free(focus_cycle_popup);
|
||||||
|
|
||||||
if (!reconfig) {
|
if (!reconfig) {
|
||||||
|
client_remove_destructor((GDestroyNotify) focus_cycle_destructor);
|
||||||
|
|
||||||
for (i = 0; i < screen_num_desktops; ++i)
|
for (i = 0; i < screen_num_desktops; ++i)
|
||||||
g_list_free(focus_order[i]);
|
g_list_free(focus_order[i]);
|
||||||
g_free(focus_order);
|
g_free(focus_order);
|
||||||
|
|
Loading…
Reference in a new issue