From 81ce12546eb5825e1edbf62ee01ac25aca4b11ae Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Mon, 25 Mar 2019 10:33:29 +0000 Subject: [PATCH] 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 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 7e432c6..7443cb8 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -256,7 +256,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; @@ -1967,7 +1966,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); @@ -1977,7 +1976,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 e08e0d3..92daf1c 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); -- 2.7.4