summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-02-21 19:49:55 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-02-21 20:35:00 +0100
commit4937897c0b73d296c3593960bf0cb730cda5eae0 (patch)
tree280b37beef67054e5a3f582ae3c442c674e0a566
parent4510e474f65e5afc7431e7dae7463899bd2861b4 (diff)
tiling: dont use floating state when toggling
when someone toggles a client he usally doesnt want to have it again in toggle state, so make sure its vertical or horizontal.
-rw-r--r--src/modules/tiling/e_mod_tiling.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c
index 08065a161..e99e39055 100644
--- a/src/modules/tiling/e_mod_tiling.c
+++ b/src/modules/tiling/e_mod_tiling.c
@@ -51,7 +51,7 @@ struct tiling_g tiling_g = {
51 51
52static void _client_track(E_Client *ec); 52static void _client_track(E_Client *ec);
53static void _client_untrack(E_Client *ec); 53static void _client_untrack(E_Client *ec);
54static Eina_Bool _add_client(E_Client *ec); 54static Eina_Bool _add_client(E_Client *ec, Tiling_Split_Type type);
55static void _remove_client(E_Client *ec); 55static void _remove_client(E_Client *ec);
56static void _client_apply_settings(E_Client *ec, Client_Extra *extra); 56static void _client_apply_settings(E_Client *ec, Client_Extra *extra);
57static void _foreach_desk(void (*func)(E_Desk *desk)); 57static void _foreach_desk(void (*func)(E_Desk *desk));
@@ -124,6 +124,16 @@ get_current_desk(void)
124 return e_desk_current_get(z); 124 return e_desk_current_get(z);
125} 125}
126 126
127static Tiling_Split_Type
128_current_tiled_state(void)
129{
130 Tiling_Split_Type type = _G.split_type;
131
132 if (type == TILING_SPLIT_FLOAT)
133 return TILING_SPLIT_HORIZONTAL;
134 return type;
135}
136
127static Tiling_Info * 137static Tiling_Info *
128_initialize_tinfo(const E_Desk *desk) 138_initialize_tinfo(const E_Desk *desk)
129{ 139{
@@ -509,7 +519,7 @@ _desk_config_apply(E_Desk *d, int old_nb_stacks, int new_nb_stacks)
509 519
510 E_CLIENT_FOREACH(ec) 520 E_CLIENT_FOREACH(ec)
511 { 521 {
512 _add_client(ec); 522 _add_client(ec, _G.split_type);
513 } 523 }
514 524
515 _reapply_tree(); 525 _reapply_tree();
@@ -551,7 +561,7 @@ _e_client_check_based_on_state_cb(void *data, Evas_Object *obj EINA_UNUSED,
551} 561}
552 562
553static Eina_Bool 563static Eina_Bool
554_add_client(E_Client *ec) 564_add_client(E_Client *ec, Tiling_Split_Type type)
555{ 565{
556 /* Should I need to check that the client is not already added? */ 566 /* Should I need to check that the client is not already added? */
557 if (!ec) 567 if (!ec)
@@ -573,7 +583,7 @@ _add_client(E_Client *ec)
573 if (is_ignored_window(extra)) 583 if (is_ignored_window(extra))
574 return EINA_FALSE; 584 return EINA_FALSE;
575 585
576 if (_G.split_type == TILING_SPLIT_FLOAT) 586 if (type == TILING_SPLIT_FLOAT)
577 { 587 {
578 extra->floating = EINA_TRUE; 588 extra->floating = EINA_TRUE;
579 return EINA_FALSE; 589 return EINA_FALSE;
@@ -607,7 +617,7 @@ _add_client(E_Client *ec)
607 } 617 }
608 618
609 _G.tinfo->tree = 619 _G.tinfo->tree =
610 tiling_window_tree_add(_G.tinfo->tree, parent, ec, _G.split_type); 620 tiling_window_tree_add(_G.tinfo->tree, parent, ec, type);
611 } 621 }
612 622
613 if (started) 623 if (started)
@@ -690,7 +700,7 @@ toggle_floating(E_Client *ec)
690 } 700 }
691 else 701 else
692 { 702 {
693 _add_client(ec); 703 _add_client(ec, _current_tiled_state());
694 } 704 }
695} 705}
696 706
@@ -1234,7 +1244,7 @@ _add_hook(void *data EINA_UNUSED, E_Client *ec)
1234 if (e_object_is_del(E_OBJECT(ec))) 1244 if (e_object_is_del(E_OBJECT(ec)))
1235 return; 1245 return;
1236 1246
1237 _add_client(ec); 1247 _add_client(ec, _G.split_type);
1238} 1248}
1239 1249
1240static Eina_Bool 1250static Eina_Bool
@@ -1263,7 +1273,7 @@ _toggle_tiling_based_on_state(E_Client *ec, Eina_Bool restore)
1263 } 1273 }
1264 else if (!extra->tiled && is_tilable(ec)) 1274 else if (!extra->tiled && is_tilable(ec))
1265 { 1275 {
1266 _add_client(ec); 1276 _add_client(ec, _current_tiled_state());
1267 1277
1268 return EINA_TRUE; 1278 return EINA_TRUE;
1269 } 1279 }
@@ -1304,7 +1314,7 @@ _desk_set_hook(void *data EINA_UNUSED, int type EINA_UNUSED,
1304 if (!desk_should_tile_check(ev->ec->desk)) 1314 if (!desk_should_tile_check(ev->ec->desk))
1305 return true; 1315 return true;
1306 1316
1307 _add_client(ev->ec); 1317 _add_client(ev->ec, _current_tiled_state());
1308 1318
1309 return true; 1319 return true;
1310} 1320}
@@ -1527,7 +1537,7 @@ e_modapi_init(E_Module *m)
1527 1537
1528 E_CLIENT_FOREACH(ec) 1538 E_CLIENT_FOREACH(ec)
1529 { 1539 {
1530 _add_client(ec); 1540 _add_client(ec, _G.split_type);
1531 } 1541 }
1532 } 1542 }
1533 started = EINA_TRUE; 1543 started = EINA_TRUE;