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)
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 32b47564d..9cee12ce6 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)
3043} 3043}
3044 3044
3045E_API void 3045E_API void
3046e_comp_object_util_center(Evas_Object *obj) 3046e_comp_object_util_center_on_zone(Evas_Object *obj, E_Zone *zone)
3047{ 3047{
3048 int x, y, w, h, ow, oh; 3048 int x, y, w, h, ow, oh;
3049 E_Zone *zone;
3050 3049
3051 SOFT_ENTRY(); 3050 SOFT_ENTRY();
3052 3051
3053 zone = e_comp_object_util_zone_get(obj);
3054 EINA_SAFETY_ON_NULL_RETURN(zone); 3052 EINA_SAFETY_ON_NULL_RETURN(zone);
3055 e_zone_useful_geometry_get(zone, &x, &y, &w, &h); 3053 e_zone_useful_geometry_get(zone, &x, &y, &w, &h);
3056 if (cw && (cw->ec->changes.size || cw->ec->new_client)) 3054 if (cw && (cw->ec->changes.size || cw->ec->new_client))
@@ -3063,6 +3061,16 @@ e_comp_object_util_center(Evas_Object *obj)
3063} 3061}
3064 3062
3065E_API void 3063E_API void
3064e_comp_object_util_center(Evas_Object *obj)
3065{
3066 E_Zone *zone;
3067
3068 zone = e_comp_object_util_zone_get(obj);
3069
3070 e_comp_object_util_center_on_zone(obj, zone);
3071}
3072
3073E_API void
3066e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on) 3074e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on)
3067{ 3075{
3068 int x, y, w, h, ow, oh; 3076 int x, y, w, h, ow, oh;
diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h
index f108b3b26..1701aceb8 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
54E_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); 54E_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);
55E_API void e_comp_object_util_center(Evas_Object *obj); 55E_API void e_comp_object_util_center(Evas_Object *obj);
56E_API void e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on); 56E_API void e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on);
57E_API void e_comp_object_util_center_on_zone(Evas_Object *obj, E_Zone *zone);
57E_API void e_comp_object_util_center_pos_get(Evas_Object *obj, int *x, int *y); 58E_API void e_comp_object_util_center_pos_get(Evas_Object *obj, int *x, int *y);
58E_API void e_comp_object_util_fullscreen(Evas_Object *obj); 59E_API void e_comp_object_util_fullscreen(Evas_Object *obj);
59E_API Eina_Bool e_comp_object_frame_allowed(Evas_Object *obj); 60E_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 3b3565e7d..d83aa2865 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
96 Evas_Object *comp_obj; 96 Evas_Object *comp_obj;
97 Evas_Object *obj; 97 Evas_Object *obj;
98 Ecore_Timer *timer; 98 Ecore_Timer *timer;
99 E_Desk *desk;
99 } split_popup; 100 } split_popup;
100} _G = 101} _G =
101{ 102{
@@ -844,6 +845,7 @@ _split_type_popup_timer_del_cb(void *data EINA_UNUSED)
844 _G.split_popup.comp_obj = NULL; 845 _G.split_popup.comp_obj = NULL;
845 _G.split_popup.obj = NULL; 846 _G.split_popup.obj = NULL;
846 _G.split_popup.timer = NULL; 847 _G.split_popup.timer = NULL;
848 _G.split_popup.desk = NULL;
847 849
848 return EINA_FALSE; 850 return EINA_FALSE;
849} 851}
@@ -853,8 +855,19 @@ _tiling_split_type_changed_popup(void)
853{ 855{
854 Evas_Object *comp_obj = _G.split_popup.comp_obj; 856 Evas_Object *comp_obj = _G.split_popup.comp_obj;
855 Evas_Object *o = _G.split_popup.obj; 857 Evas_Object *o = _G.split_popup.obj;
858 E_Desk *desk = NULL;
856 859
857 /* If this is not NULL, the rest isn't either. */ 860 /* If this is not NULL, the rest isn't either. */
861
862 /* check for the current desk we have */
863 if (e_client_focused_get())
864 {
865 E_Client *c;
866
867 c = e_client_focused_get();
868 desk = c->desk;
869 }
870
858 if (!o) 871 if (!o)
859 { 872 {
860 _G.split_popup.obj = o = edje_object_add(e_comp->evas); 873 _G.split_popup.obj = o = edje_object_add(e_comp->evas);
@@ -864,7 +877,12 @@ _tiling_split_type_changed_popup(void)
864 evas_object_resize(o, TILING_POPUP_SIZE, TILING_POPUP_SIZE); 877 evas_object_resize(o, TILING_POPUP_SIZE, TILING_POPUP_SIZE);
865 878
866 _G.split_popup.comp_obj = comp_obj = e_comp_object_util_add(o, E_COMP_OBJECT_TYPE_POPUP); 879 _G.split_popup.comp_obj = comp_obj = e_comp_object_util_add(o, E_COMP_OBJECT_TYPE_POPUP);
867 e_comp_object_util_center(comp_obj); 880
881 if (desk)
882 e_comp_object_util_center_on_zone(comp_obj, e_zone_current_get());
883 else
884 e_comp_object_util_center(comp_obj);
885 _G.split_popup.desk = desk;
868 evas_object_layer_set(comp_obj, E_LAYER_POPUP); 886 evas_object_layer_set(comp_obj, E_LAYER_POPUP);
869 evas_object_pass_events_set(comp_obj, EINA_TRUE); 887 evas_object_pass_events_set(comp_obj, EINA_TRUE);
870 888
@@ -874,9 +892,12 @@ _tiling_split_type_changed_popup(void)
874 } 892 }
875 else 893 else
876 { 894 {
895 if (desk != _G.split_popup.desk)
896 e_comp_object_util_center_on_zone(comp_obj, e_zone_current_get());
877 ecore_timer_reset(_G.split_popup.timer); 897 ecore_timer_reset(_G.split_popup.timer);
878 } 898 }
879 899
900
880 _edje_tiling_icon_set(o); 901 _edje_tiling_icon_set(o);
881} 902}
882 903