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:06:25 -0400
commitc7a33b33f659256768b3f70295c1f67a994b59e8 (patch)
treeb1cc8777ae72a84859bfebba0b3eb7b335b9d8af
parentd73ff4601193218e92867052d533ee4b686ae8fb (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 225ce6d3d..e75ee1d02 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -3751,12 +3751,10 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3751 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change); 3751 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3752 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in); 3752 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3753 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out); 3753 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3754 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3755 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3754 if (type != ELM_WIN_FAKE) 3756 if (type != ELM_WIN_FAKE)
3755 { 3757 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3756 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3757 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3758 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3759 }
3760 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL); 3758 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3761 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL); 3759 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3762 3760
@@ -3781,24 +3779,26 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3781#endif 3779#endif
3782 3780
3783 /* do not append to list; all windows render as black rects */ 3781 /* do not append to list; all windows render as black rects */
3784 if (type == ELM_WIN_FAKE) return obj; 3782 if (type != ELM_WIN_FAKE)
3785 _elm_win_list = eina_list_append(_elm_win_list, obj);
3786 _elm_win_count++;
3787
3788 if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
3789 { 3783 {
3790 TRAP(sd, fullscreen_set, 1); 3784 _elm_win_list = eina_list_append(_elm_win_list, obj);
3791 } 3785 _elm_win_count++;
3792 else if ((type != ELM_WIN_INLINED_IMAGE) && 3786
3793 ((engine) && 3787 if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
3794 ((!strcmp(engine, ELM_WAYLAND_SHM) || 3788 {
3795 (!strcmp(engine, ELM_WAYLAND_EGL)))))) 3789 TRAP(sd, fullscreen_set, 1);
3796 _elm_win_frame_add(sd, "default"); 3790 }
3791 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3792 ((engine) &&
3793 ((!strcmp(engine, ELM_WAYLAND_SHM) ||
3794 (!strcmp(engine, ELM_WAYLAND_EGL))))))
3795 _elm_win_frame_add(sd, "default");
3797 3796
3798 if (_elm_config->focus_highlight_enable) 3797 if (_elm_config->focus_highlight_enable)
3799 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE); 3798 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3800 if (_elm_config->focus_highlight_animate) 3799 if (_elm_config->focus_highlight_animate)
3801 elm_win_focus_highlight_animate_set(obj, EINA_TRUE); 3800 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3801 }
3802 3802
3803#ifdef ELM_DEBUG 3803#ifdef ELM_DEBUG
3804 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control"); 3804 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
@@ -3811,28 +3811,31 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3811 ERR("failed to grab F12 key to elm widgets (dot) tree generation"); 3811 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3812#endif 3812#endif
3813 3813
3814 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) || 3814 if (type != ELM_WIN_FAKE)
3815 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3816 ((engine) &&
3817 ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
3818 {
3819 Evas_Object *o;
3820 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3821
3822 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3823 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3824 edje_object_size_min_calc(o, &mw, &mh);
3825 evas_object_resize(o, mw, mh);
3826 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3827 &hx, &hy, NULL, NULL);
3828 sd->pointer.hot_x = hx;
3829 sd->pointer.hot_y = hy;
3830 evas_object_show(o);
3831 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3832 }
3833 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3834 { 3815 {
3835 // do nothing 3816 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3817 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3818 ((engine) &&
3819 ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
3820 {
3821 Evas_Object *o;
3822 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3823
3824 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3825 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3826 edje_object_size_min_calc(o, &mw, &mh);
3827 evas_object_resize(o, mw, mh);
3828 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3829 &hx, &hy, NULL, NULL);
3830 sd->pointer.hot_x = hx;
3831 sd->pointer.hot_y = hy;
3832 evas_object_show(o);
3833 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3834 }
3835 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3836 {
3837 // do nothing
3838 }
3836 } 3839 }
3837 3840
3838 sd->edje = edje_object_add(sd->evas); 3841 sd->edje = edje_object_add(sd->evas);
@@ -3843,9 +3846,12 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3843 edje_object_part_swallow(sd->edje, "elm.swallow.contents", sd->box); 3846 edje_object_part_swallow(sd->edje, "elm.swallow.contents", sd->box);
3844 evas_object_move(sd->edje, 0, 0); 3847 evas_object_move(sd->edje, 0, 0);
3845 evas_object_resize(sd->edje, 1, 1); 3848 evas_object_resize(sd->edje, 1, 1);
3846 edje_object_update_hints_set(sd->edje, EINA_TRUE); 3849 if (type != ELM_WIN_FAKE)
3847 evas_object_event_callback_add(sd->edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 3850 {
3848 _elm_win_on_resize_obj_changed_size_hints, obj); 3851 edje_object_update_hints_set(sd->edje, EINA_TRUE);
3852 evas_object_event_callback_add(sd->edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3853 _elm_win_on_resize_obj_changed_size_hints, obj);
3854 }
3849 3855
3850 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW)); 3856 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3851 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON) 3857 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
@@ -3855,7 +3861,11 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3855 3861
3856 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd), 3862 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd),
3857 eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, sd)); 3863 eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, sd));
3858 3864 if (type == ELM_WIN_FAKE)
3865 {
3866 _elm_win_resize_job(obj);
3867 _elm_win_move(sd->ee);
3868 }
3859 return obj; 3869 return obj;
3860} 3870}
3861 3871