Tiling2: Create a move/resize function that will update extra.

This commit is contained in:
Tom Hacohen 2014-01-14 15:07:30 +00:00
parent b0593cd939
commit 8dd65b90f3
4 changed files with 23 additions and 14 deletions

View File

@ -323,6 +323,21 @@ _get_or_create_client_extra(E_Client *ec)
return extra;
}
void
tiling_e_client_move_resize_extra(E_Client *ec,
int x,
int y,
int w,
int h)
{
Client_Extra *extra = _get_or_create_client_extra(ec);
if (!extra) {
ERR("No extra for %p", ec);
}
_e_client_move_resize(ec, x, y, w, h);
}
/* }}} */
/* Overlays {{{*/

View File

@ -87,6 +87,11 @@ get_vdesk(Eina_List *vdesks,
int y,
unsigned int zone_num);
void tiling_e_client_move_resize_extra(E_Client *ec,
int x,
int y,
int w,
int h);
#define EINA_LIST_IS_IN(_list, _el) \
(eina_list_data_find(_list, _el) == _el)
#define EINA_LIST_APPEND(_list, _el) \

View File

@ -1,6 +1,7 @@
#include "e.h"
#include "window_tree.h"
#include "e_mod_tiling.h"
void
tiling_window_tree_walk(Window_Tree *root, void (*func)(void *))
@ -243,18 +244,6 @@ tiling_window_tree_client_find(Window_Tree *root, E_Client *client)
return NULL;
}
/* FIXME: Deduplicate this func. */
static void
_e_client_move_resize(E_Client *ec,
int x,
int y,
int w,
int h)
{
DBG("%p -> %dx%d+%d+%d", ec, w, h, x, y);
evas_object_geometry_set(ec->frame, x, y, w, h);
}
void
_tiling_window_tree_level_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y,
Evas_Coord w, Evas_Coord h, int level)
@ -263,7 +252,7 @@ _tiling_window_tree_level_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y,
Tiling_Split_Type split_type = level % 2;
if (root->client)
_e_client_move_resize(root->client, x, y, w, h);
tiling_e_client_move_resize_extra(root->client, x, y, w, h);
if (split_type == TILING_SPLIT_HORIZONTAL)
{

View File

@ -1,5 +1,5 @@
#ifndef WINDOW_TREE_H
#define WINDOW_TREE_HO
#define WINDOW_TREE_H
#include <e.h>
/* XXX: Gotta be 0 and 1 because it's calculated using level % 2. */