Tiling2: Add "floating" as a split mode.

This lets people just create floating windows, without the need to toggle.
This commit is contained in:
Tom Hacohen 2014-01-21 14:53:35 +00:00
parent ff078996ff
commit 792022196f
3 changed files with 16 additions and 5 deletions

View File

@ -444,6 +444,12 @@ _add_client(E_Client *ec)
if (is_ignored_window(extra))
return;
if (_G.split_type == TILING_SPLIT_FLOAT)
{
extra->floating = EINA_TRUE;
return;
}
if (extra->tiled)
return;
@ -631,8 +637,7 @@ _e_mod_action_toggle_split_mode(E_Object *obj __UNUSED__,
if (!desk_should_tile_check(desk))
return;
_G.split_type = (_G.split_type == TILING_SPLIT_VERTICAL) ?
TILING_SPLIT_HORIZONTAL : TILING_SPLIT_VERTICAL;
_G.split_type = (_G.split_type + 1) % TILING_SPLIT_LAST;
}
/* }}} */

View File

@ -83,7 +83,11 @@ tiling_window_tree_add(Window_Tree *root, Window_Tree *parent, E_Client *client,
new_node->client = client;
Tiling_Split_Type parent_split_type;
if (!root)
if (split_type > TILING_SPLIT_VERTICAL)
{
return root;
}
else if (!root)
{
new_node->weight = 1.0;
return new_node;

View File

@ -2,10 +2,12 @@
#define WINDOW_TREE_H
#include <e.h>
/* XXX: Gotta be 0 and 1 because it's calculated using level % 2. */
/* XXX: First two have to be 0 and 1 because I use them with modulo. */
typedef enum {
TILING_SPLIT_HORIZONTAL = 0,
TILING_SPLIT_VERTICAL = 1
TILING_SPLIT_VERTICAL = 1,
TILING_SPLIT_FLOAT,
TILING_SPLIT_LAST
} Tiling_Split_Type;
typedef struct _Window_Tree Window_Tree;