summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-12-10 15:53:31 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-12-10 15:53:31 -0500
commit6149fd7a0a9ef3f9495270cf1c4ab7727a30f21c (patch)
tree0b103f1111ec47c053031381f2b4649445b4e7d6
parent800c3ee81033985c8a0b409fe50e4e024b913db1 (diff)
win: redo resize deferral to trigger during pre render
using a job results in the resize occurring after render in the same loop, meaning that anything which depends on resizes to happen in a certain time will not have synchronized display vs toolkit geometries fixes all issues related to wayland window geometries
-rw-r--r--src/lib/elm_win.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index c9729ce06..0012445bd 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -130,7 +130,7 @@ struct _Elm_Win_Data
130 } win32; 130 } win32;
131#endif 131#endif
132 132
133 Ecore_Job *deferred_resize_job; 133 Eina_Bool deferred_resize_job;
134 Ecore_Job *deferred_child_eval_job; 134 Ecore_Job *deferred_child_eval_job;
135 135
136 Elm_Win_Type type; 136 Elm_Win_Type type;
@@ -824,7 +824,7 @@ _elm_win_resize_job(void *data)
824 ELM_WIN_DATA_GET(data, sd); 824 ELM_WIN_DATA_GET(data, sd);
825 int w, h; 825 int w, h;
826 826
827 sd->deferred_resize_job = NULL; 827 sd->deferred_resize_job = EINA_FALSE;
828 ecore_evas_request_geometry_get(sd->ee, NULL, NULL, &w, &h); 828 ecore_evas_request_geometry_get(sd->ee, NULL, NULL, &w, &h);
829 if (sd->constrain) 829 if (sd->constrain)
830 { 830 {
@@ -848,13 +848,21 @@ _elm_win_resize_job(void *data)
848} 848}
849 849
850static void 850static void
851_elm_win_pre_render(Ecore_Evas *ee)
852{
853 Elm_Win_Data *sd = _elm_win_associate_get(ee);
854
855 if (sd->deferred_resize_job)
856 _elm_win_resize_job(sd->obj);
857}
858
859static void
851_elm_win_resize(Ecore_Evas *ee) 860_elm_win_resize(Ecore_Evas *ee)
852{ 861{
853 Elm_Win_Data *sd = _elm_win_associate_get(ee); 862 Elm_Win_Data *sd = _elm_win_associate_get(ee);
854 if (!sd) return; 863 if (!sd) return;
855 864
856 ecore_job_del(sd->deferred_resize_job); 865 sd->deferred_resize_job = EINA_TRUE;
857 sd->deferred_resize_job = ecore_job_add(_elm_win_resize_job, sd->obj);
858} 866}
859 867
860static void 868static void
@@ -1945,7 +1953,6 @@ _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
1945 ecore_evas_callback_resize_set(sd->ee, NULL); 1953 ecore_evas_callback_resize_set(sd->ee, NULL);
1946 } 1954 }
1947 1955
1948 ecore_job_del(sd->deferred_resize_job);
1949 ecore_job_del(sd->deferred_child_eval_job); 1956 ecore_job_del(sd->deferred_child_eval_job);
1950 eina_stringshare_del(sd->shot.info); 1957 eina_stringshare_del(sd->shot.info);
1951 ecore_timer_del(sd->shot.timer); 1958 ecore_timer_del(sd->shot.timer);
@@ -1992,6 +1999,7 @@ _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
1992 ecore_evas_callback_focus_out_set(sd->ee, NULL); 1999 ecore_evas_callback_focus_out_set(sd->ee, NULL);
1993 ecore_evas_callback_move_set(sd->ee, NULL); 2000 ecore_evas_callback_move_set(sd->ee, NULL);
1994 ecore_evas_callback_state_change_set(sd->ee, NULL); 2001 ecore_evas_callback_state_change_set(sd->ee, NULL);
2002 ecore_evas_callback_pre_render_set(sd->ee, NULL);
1995 2003
1996 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 2004 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1997 2005
@@ -3856,6 +3864,7 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3856 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out); 3864 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3857 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize); 3865 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3858 ecore_evas_callback_move_set(sd->ee, _elm_win_move); 3866 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3867 ecore_evas_callback_pre_render_set(sd->ee, _elm_win_pre_render);
3859 if (type != ELM_WIN_FAKE) 3868 if (type != ELM_WIN_FAKE)
3860 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in); 3869 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3861 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL); 3870 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);