forked from enlightenment/enlightenment
Tiling2: Properly apply settings from the config dialog.
This fixes T911.
This commit is contained in:
parent
555730c2bc
commit
4c846ca7fc
|
@ -43,6 +43,7 @@ struct tiling_g tiling_g = {
|
||||||
|
|
||||||
static void _add_client(E_Client *ec);
|
static void _add_client(E_Client *ec);
|
||||||
static void _remove_client(E_Client *ec);
|
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 void _foreach_desk(void (*func)(E_Desk *desk));
|
||||||
|
|
||||||
/* Func Proto Requirements for Gadcon */
|
/* Func Proto Requirements for Gadcon */
|
||||||
|
@ -415,7 +416,7 @@ change_desk_conf(struct _Config_vdesk *newconf)
|
||||||
E_Comp *c;
|
E_Comp *c;
|
||||||
E_Zone *z;
|
E_Zone *z;
|
||||||
E_Desk *d;
|
E_Desk *d;
|
||||||
int new_nb_stacks = newconf->nb_stacks;
|
int old_nb_stacks, new_nb_stacks = newconf->nb_stacks;
|
||||||
|
|
||||||
m = e_manager_current_get();
|
m = e_manager_current_get();
|
||||||
if (!m)
|
if (!m)
|
||||||
|
@ -429,6 +430,8 @@ change_desk_conf(struct _Config_vdesk *newconf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
check_tinfo(d);
|
check_tinfo(d);
|
||||||
|
old_nb_stacks = _G.tinfo->conf->nb_stacks;
|
||||||
|
|
||||||
_G.tinfo->conf = newconf;
|
_G.tinfo->conf = newconf;
|
||||||
_G.tinfo->conf->nb_stacks = new_nb_stacks;
|
_G.tinfo->conf->nb_stacks = new_nb_stacks;
|
||||||
|
|
||||||
|
@ -438,6 +441,17 @@ change_desk_conf(struct _Config_vdesk *newconf)
|
||||||
_G.tinfo->tree = NULL;
|
_G.tinfo->tree = NULL;
|
||||||
e_place_zone_region_smart_cleanup(z);
|
e_place_zone_region_smart_cleanup(z);
|
||||||
}
|
}
|
||||||
|
else if (new_nb_stacks == old_nb_stacks)
|
||||||
|
{
|
||||||
|
E_Client *ec;
|
||||||
|
|
||||||
|
E_CLIENT_FOREACH(e_comp_get(NULL), ec)
|
||||||
|
{
|
||||||
|
_client_apply_settings(ec, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
_reapply_tree();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Add all the existing windows. */
|
/* Add all the existing windows. */
|
||||||
|
@ -453,6 +467,35 @@ change_desk_conf(struct _Config_vdesk *newconf)
|
||||||
/* }}} */
|
/* }}} */
|
||||||
/* Reorganize windows {{{ */
|
/* Reorganize windows {{{ */
|
||||||
|
|
||||||
|
static void
|
||||||
|
_client_apply_settings(E_Client *ec, Client_Extra *extra)
|
||||||
|
{
|
||||||
|
if (!extra)
|
||||||
|
{
|
||||||
|
extra = tiling_entry_func(ec);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!extra)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (is_ignored_window(extra))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!extra->tiled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ec->maximized)
|
||||||
|
_e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
|
||||||
|
|
||||||
|
if (!tiling_g.config->show_titles && (!ec->bordername ||
|
||||||
|
strcmp(ec->bordername, "pixel")))
|
||||||
|
change_window_border(ec, "pixel");
|
||||||
|
else if (tiling_g.config->show_titles && (ec->bordername &&
|
||||||
|
!strcmp(ec->bordername, "pixel")))
|
||||||
|
change_window_border(ec, (extra->orig.bordername) ? extra->orig.bordername : "default");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_add_client(E_Client *ec)
|
_add_client(E_Client *ec)
|
||||||
{
|
{
|
||||||
|
@ -487,12 +530,7 @@ _add_client(E_Client *ec)
|
||||||
|
|
||||||
DBG("adding %p", ec);
|
DBG("adding %p", ec);
|
||||||
|
|
||||||
if (ec->maximized)
|
_client_apply_settings(ec, extra);
|
||||||
_e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
|
|
||||||
|
|
||||||
if (!tiling_g.config->show_titles && (!ec->bordername ||
|
|
||||||
strcmp(ec->bordername, "pixel")))
|
|
||||||
change_window_border(ec, "pixel");
|
|
||||||
|
|
||||||
/* Window tree updating. */
|
/* Window tree updating. */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue