summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-09-07 13:05:08 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-09-07 13:07:10 -0400
commit703f5d3c5d778a96a1189b8d92473d793dd7c2c7 (patch)
treeeb2e0a487846a11f46b88f78076e887610641991
parent9fde98ead28d6493e77a6b9b858e37d63c328a69 (diff)
win: fix FAKE window geometry updating + resize object adding
users of this will want the win to automatically match the geometry of the ee in all cases fix T2692
-rw-r--r--src/lib/elm_win.c102
1 files changed, 56 insertions, 46 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index b76fc0c02..6e478f615 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -3748,12 +3748,10 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3748 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change); 3748 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3749 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in); 3749 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3750 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out); 3750 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3751 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3752 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3751 if (type != ELM_WIN_FAKE) 3753 if (type != ELM_WIN_FAKE)
3752 { 3754 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3753 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3754 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3755 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3756 }
3757 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL); 3755 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3758 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL); 3756 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3759 3757
@@ -3778,24 +3776,26 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3778#endif 3776#endif
3779 3777
3780 /* do not append to list; all windows render as black rects */ 3778 /* do not append to list; all windows render as black rects */
3781 if (type == ELM_WIN_FAKE) return obj; 3779 if (type != ELM_WIN_FAKE)
3782 _elm_win_list = eina_list_append(_elm_win_list, obj);
3783 _elm_win_count++;
3784
3785 if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
3786 { 3780 {
3787 TRAP(sd, fullscreen_set, 1); 3781 _elm_win_list = eina_list_append(_elm_win_list, obj);
3788 } 3782 _elm_win_count++;
3789 else if ((type != ELM_WIN_INLINED_IMAGE) && 3783
3790 ((engine) && 3784 if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
3791 ((!strcmp(engine, ELM_WAYLAND_SHM) || 3785 {
3792 (!strcmp(engine, ELM_WAYLAND_EGL)))))) 3786 TRAP(sd, fullscreen_set, 1);
3793 _elm_win_frame_add(sd, "default"); 3787 }
3788 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3789 ((engine) &&
3790 ((!strcmp(engine, ELM_WAYLAND_SHM) ||
3791 (!strcmp(engine, ELM_WAYLAND_EGL))))))
3792 _elm_win_frame_add(sd, "default");
3794 3793
3795 if (_elm_config->focus_highlight_enable) 3794 if (_elm_config->focus_highlight_enable)
3796 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE); 3795 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3797 if (_elm_config->focus_highlight_animate) 3796 if (_elm_config->focus_highlight_animate)
3798 elm_win_focus_highlight_animate_set(obj, EINA_TRUE); 3797 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3798 }
3799 3799
3800#ifdef ELM_DEBUG 3800#ifdef ELM_DEBUG
3801 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control"); 3801 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
@@ -3808,28 +3808,31 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3808 ERR("failed to grab F12 key to elm widgets (dot) tree generation"); 3808 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3809#endif 3809#endif
3810 3810
3811 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) || 3811 if (type != ELM_WIN_FAKE)
3812 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3813 ((engine) &&
3814 ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
3815 {
3816 Evas_Object *o;
3817 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3818
3819 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3820 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3821 edje_object_size_min_calc(o, &mw, &mh);
3822 evas_object_resize(o, mw, mh);
3823 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3824 &hx, &hy, NULL, NULL);
3825 sd->pointer.hot_x = hx;
3826 sd->pointer.hot_y = hy;
3827 evas_object_show(o);
3828 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3829 }
3830 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3831 { 3812 {
3832 // do nothing 3813 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3814 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3815 ((engine) &&
3816 ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
3817 {
3818 Evas_Object *o;
3819 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3820
3821 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3822 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3823 edje_object_size_min_calc(o, &mw, &mh);
3824 evas_object_resize(o, mw, mh);
3825 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3826 &hx, &hy, NULL, NULL);
3827 sd->pointer.hot_x = hx;
3828 sd->pointer.hot_y = hy;
3829 evas_object_show(o);
3830 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3831 }
3832 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3833 {
3834 // do nothing
3835 }
3833 } 3836 }
3834 3837
3835 sd->edje = edje_object_add(sd->evas); 3838 sd->edje = edje_object_add(sd->evas);
@@ -3840,9 +3843,12 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3840 edje_object_part_swallow(sd->edje, "elm.swallow.contents", sd->box); 3843 edje_object_part_swallow(sd->edje, "elm.swallow.contents", sd->box);
3841 evas_object_move(sd->edje, 0, 0); 3844 evas_object_move(sd->edje, 0, 0);
3842 evas_object_resize(sd->edje, 1, 1); 3845 evas_object_resize(sd->edje, 1, 1);
3843 edje_object_update_hints_set(sd->edje, EINA_TRUE); 3846 if (type != ELM_WIN_FAKE)
3844 evas_object_event_callback_add(sd->edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 3847 {
3845 _elm_win_on_resize_obj_changed_size_hints, obj); 3848 edje_object_update_hints_set(sd->edje, EINA_TRUE);
3849 evas_object_event_callback_add(sd->edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3850 _elm_win_on_resize_obj_changed_size_hints, obj);
3851 }
3846 3852
3847 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW)); 3853 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3848 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON) 3854 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
@@ -3852,7 +3858,11 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3852 3858
3853 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd), 3859 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd),
3854 eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, sd)); 3860 eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, sd));
3855 3861 if (type == ELM_WIN_FAKE)
3862 {
3863 _elm_win_resize_job(obj);
3864 _elm_win_move(sd->ee);
3865 }
3856 return obj; 3866 return obj;
3857} 3867}
3858 3868