static void _remove_client(E_Client *ec);
static void _client_apply_settings(E_Client *ec, Client_Extra *extra);
static void _foreach_desk(void (*func)(E_Desk *desk));
+static Eina_Bool _toggle_tiling_based_on_state(E_Client *ec, Eina_Bool restore);
/* Func Proto Requirements for Gadcon */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
if (!extra)
return EINA_FALSE;
- if (extra->tiled && ec->maximized)
- {
- _restore_client(ec);
- _remove_client(ec);
-
- return EINA_TRUE;
- }
- else if (!extra->tiled && !ec->maximized)
- {
- _add_client(ec);
-
- return EINA_TRUE;
- }
+ if (_toggle_tiling_based_on_state(ec, EINA_TRUE))
+ return EINA_TRUE;
return EINA_FALSE;
}
return true;
}
-static void
+static Eina_Bool
_toggle_tiling_based_on_state(E_Client *ec, Eina_Bool restore)
{
Client_Extra *extra = eina_hash_find(_G.client_extras, &ec);
if (!extra)
{
- return;
+ return EINA_FALSE;
}
/* This is the new state, act accordingly. */
_restore_client(ec);
}
_remove_client(ec);
+
+ return EINA_TRUE;
}
else if (!extra->tiled && is_tilable(ec))
{
_add_client(ec);
+
+ return EINA_TRUE;
}
+
+ return EINA_FALSE;
}
static bool