bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=476010b018e3f7d76f3ed198ad2657fc18cc50c8

commit 476010b018e3f7d76f3ed198ad2657fc18cc50c8
Author: Yeongjong Lee <yj34....@samsung.com>
Date:   Mon Mar 25 10:33:29 2019 +0000

    elm_win: fix correct rot variable in elm_win_rotation_get
    
    Remove duplicated rotation variable
    
    Also, it fixes wrong layout class comparing.
    
    Reviewed-by: Marcel Hollerbach <m...@marcel-hollerbach.de>
    Differential Revision: https://phab.enlightenment.org/D8464
---
 src/lib/elementary/efl_ui_win.c     |  5 ++---
 src/tests/elementary/elm_test_win.c | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 26c135b356..18e28fa080 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -213,7 +213,6 @@ struct _Efl_Ui_Win_Data
    int          norender;
    int          modal_count;
    int          response;
-   int          rotation;
    Eina_Bool    req_wh : 1;
    Eina_Bool    req_xy : 1;
 
@@ -1676,7 +1675,7 @@ _efl_ui_win_win_rotation_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Win_Data *pd, int rotat
    it = efl_ui_widget_tree_widget_iterator(obj);
    EINA_ITERATOR_FOREACH(it, widget)
      {
-        if (!efl_isa(widget, EFL_UI_LAYOUT_CLASS)) continue;
+        if (!efl_isa(widget, EFL_UI_LAYOUT_BASE_CLASS)) continue;
 
         if (efl_ui_layout_automatic_theme_rotation_get(widget))
           efl_ui_layout_theme_rotation_apply(widget, rot);
@@ -1686,7 +1685,7 @@ _efl_ui_win_win_rotation_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Win_Data *pd, int rotat
 EOLIAN static int
 _efl_ui_win_win_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
 {
-   return pd->rotation;
+   return pd->rot;
 }
 
 EAPI void
diff --git a/src/tests/elementary/elm_test_win.c 
b/src/tests/elementary/elm_test_win.c
index e08e0d3be5..92daf1c656 100644
--- a/src/tests/elementary/elm_test_win.c
+++ b/src/tests/elementary/elm_test_win.c
@@ -449,6 +449,19 @@ EFL_START_TEST(efl_ui_win_multi_touch_inputs)
 }
 EFL_END_TEST
 
+EFL_START_TEST(elm_win_test_rotation)
+{
+   Evas_Object *win;
+
+   win = win_add(NULL, "win", ELM_WIN_BASIC);
+
+   elm_win_rotation_set(win, 90);
+   ck_assert_int_eq(elm_win_rotation_get(win), 90);
+   elm_win_rotation_with_resize_set(win, 180);
+   ck_assert_int_eq(elm_win_rotation_get(win), 180);
+}
+EFL_END_TEST
+
 void elm_test_win(TCase *tc)
 {
    tcase_add_test(tc, elm_win_legacy_type_check);
@@ -458,6 +471,7 @@ void elm_test_win(TCase *tc)
    tcase_add_test(tc, elm_win_test_exit_on_close);
    tcase_add_test(tc, elm_win_test_app_exit_on_windows_close);
    tcase_add_test(tc, efl_ui_win_multi_touch_inputs);
+   tcase_add_test(tc, elm_win_test_rotation);
 #ifdef HAVE_ELEMENTARY_X
    tcase_add_test(tc, elm_win_autohide);
    tcase_add_test(tc, elm_win_autohide_and_policy_quit_last_window_hidden);

-- 


Reply via email to