Tiling2: Create a move/resize function that will update extra.
authorTom Hacohen <tom@stosb.com>
Tue, 14 Jan 2014 15:07:30 +0000 (15:07 +0000)
committerTom Hacohen <tom@stosb.com>
Fri, 21 Feb 2014 09:15:06 +0000 (09:15 +0000)
src/modules/tiling/e_mod_tiling.c
src/modules/tiling/e_mod_tiling.h
src/modules/tiling/window_tree.c
src/modules/tiling/window_tree.h

index c237013..099f9ee 100644 (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 {{{*/
 
index 353af31..e6f7ee8 100644 (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) \
index dc2b2fa..350966e 100644 (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)
      {
index 3f34334..520899c 100644 (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. */