summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-06 16:31:13 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-06 16:31:13 +0200
commitf5e4403164bc1630d506cac0606bb5332c365f72 (patch)
tree7cbe75a6083470f7eee98a70a1d281b5afd7f828
parent5df7963ad1c4cf624f479be5ba8245e762e388e0 (diff)
downloadenlightenment-f5e4403164bc1630d506cac0606bb5332c365f72.tar.gz
tiling: place popup on the current active zone
Otherwise the popup will be where you are not looking at. This patch adds a new function to e_comp_object where you can pass the zone where you want to place the e_comp_object on. ref T4499
-rw-r--r--src/bin/e_comp_object.c14
-rw-r--r--src/bin/e_comp_object.h1
-rw-r--r--src/modules/tiling/e_mod_tiling.c23
3 files changed, 34 insertions, 4 deletions
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index 32b47564d6..9cee12ce67 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -3043,14 +3043,12 @@ e_comp_object_util_zone_get(Evas_Object *obj)
}
E_API void
-e_comp_object_util_center(Evas_Object *obj)
+e_comp_object_util_center_on_zone(Evas_Object *obj, E_Zone *zone)
{
int x, y, w, h, ow, oh;
- E_Zone *zone;
SOFT_ENTRY();
- zone = e_comp_object_util_zone_get(obj);
EINA_SAFETY_ON_NULL_RETURN(zone);
e_zone_useful_geometry_get(zone, &x, &y, &w, &h);
if (cw && (cw->ec->changes.size || cw->ec->new_client))
@@ -3063,6 +3061,16 @@ e_comp_object_util_center(Evas_Object *obj)
}
E_API void
+e_comp_object_util_center(Evas_Object *obj)
+{
+ E_Zone *zone;
+
+ zone = e_comp_object_util_zone_get(obj);
+
+ e_comp_object_util_center_on_zone(obj, zone);
+}
+
+E_API void
e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on)
{
int x, y, w, h, ow, oh;
diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h
index f108b3b26d..1701aceb85 100644
--- a/src/bin/e_comp_object.h
+++ b/src/bin/e_comp_object.h
@@ -54,6 +54,7 @@ E_API Eina_Bool e_comp_object_util_autoclose_on_escape(void *d EINA_UNUSED, Ecor
E_API void e_comp_object_util_autoclose(Evas_Object *obj, E_Comp_Object_Autoclose_Cb del_cb, E_Comp_Object_Key_Cb cb, const void *data);
E_API void e_comp_object_util_center(Evas_Object *obj);
E_API void e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on);
+E_API void e_comp_object_util_center_on_zone(Evas_Object *obj, E_Zone *zone);
E_API void e_comp_object_util_center_pos_get(Evas_Object *obj, int *x, int *y);
E_API void e_comp_object_util_fullscreen(Evas_Object *obj);
E_API Eina_Bool e_comp_object_frame_allowed(Evas_Object *obj);
diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c
index 3b3565e7d9..d83aa2865e 100644
--- a/src/modules/tiling/e_mod_tiling.c
+++ b/src/modules/tiling/e_mod_tiling.c
@@ -96,6 +96,7 @@ static struct tiling_mod_main_g
Evas_Object *comp_obj;
Evas_Object *obj;
Ecore_Timer *timer;
+ E_Desk *desk;
} split_popup;
} _G =
{
@@ -844,6 +845,7 @@ _split_type_popup_timer_del_cb(void *data EINA_UNUSED)
_G.split_popup.comp_obj = NULL;
_G.split_popup.obj = NULL;
_G.split_popup.timer = NULL;
+ _G.split_popup.desk = NULL;
return EINA_FALSE;
}
@@ -853,8 +855,19 @@ _tiling_split_type_changed_popup(void)
{
Evas_Object *comp_obj = _G.split_popup.comp_obj;
Evas_Object *o = _G.split_popup.obj;
+ E_Desk *desk = NULL;
/* If this is not NULL, the rest isn't either. */
+
+ /* check for the current desk we have */
+ if (e_client_focused_get())
+ {
+ E_Client *c;
+
+ c = e_client_focused_get();
+ desk = c->desk;
+ }
+
if (!o)
{
_G.split_popup.obj = o = edje_object_add(e_comp->evas);
@@ -864,7 +877,12 @@ _tiling_split_type_changed_popup(void)
evas_object_resize(o, TILING_POPUP_SIZE, TILING_POPUP_SIZE);
_G.split_popup.comp_obj = comp_obj = e_comp_object_util_add(o, E_COMP_OBJECT_TYPE_POPUP);
- e_comp_object_util_center(comp_obj);
+
+ if (desk)
+ e_comp_object_util_center_on_zone(comp_obj, e_zone_current_get());
+ else
+ e_comp_object_util_center(comp_obj);
+ _G.split_popup.desk = desk;
evas_object_layer_set(comp_obj, E_LAYER_POPUP);
evas_object_pass_events_set(comp_obj, EINA_TRUE);
@@ -874,9 +892,12 @@ _tiling_split_type_changed_popup(void)
}
else
{
+ if (desk != _G.split_popup.desk)
+ e_comp_object_util_center_on_zone(comp_obj, e_zone_current_get());
ecore_timer_reset(_G.split_popup.timer);
}
+
_edje_tiling_icon_set(o);
}