From 156f6ff9848359b2280b515ae6630cd0eb306e82 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 16 Jan 2014 11:21:14 +0000 Subject: [PATCH] Tiling2: Properly handle more than one desk. --- src/modules/tiling/e_mod_tiling.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c index 43bd45f5a..9f65e2d5b 100644 --- a/src/modules/tiling/e_mod_tiling.c +++ b/src/modules/tiling/e_mod_tiling.c @@ -167,7 +167,7 @@ static Eina_Bool desk_should_tile_check(const E_Desk *desk) { check_tinfo(desk); - return (_G.tinfo->conf &&_G.tinfo->conf->nb_stacks); + return (_G.tinfo && _G.tinfo->conf &&_G.tinfo->conf->nb_stacks); } static int @@ -442,9 +442,8 @@ _add_client(E_Client *ec) return; } - if (!_G.tinfo || !_G.tinfo->conf || !_G.tinfo->conf->nb_stacks) { + if (!desk_should_tile_check(ec->desk)) return; - } _get_or_create_client_extra(ec); @@ -481,6 +480,18 @@ _add_client(E_Client *ec) static void _remove_client(E_Client *ec) { + if (!ec) + return; + + if (is_floating_window(ec)) + return; + + if (!is_tilable(ec)) + return; + + if (!desk_should_tile_check(ec->desk)) + return; + DBG("removing %p", ec); eina_hash_del(_G.client_extras, ec, NULL);