summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-03-25 10:33:29 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-25 11:36:14 +0100
commit476010b018e3f7d76f3ed198ad2657fc18cc50c8 (patch)
tree3a90588aa94655905711805187867ed3aded812c
parent2b9278c984be3e8b629b0c3e1392396d98bd95ff (diff)
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 <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8464
-rw-r--r--src/lib/elementary/efl_ui_win.c5
-rw-r--r--src/tests/elementary/elm_test_win.c14
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
213 int norender; 213 int norender;
214 int modal_count; 214 int modal_count;
215 int response; 215 int response;
216 int rotation;
217 Eina_Bool req_wh : 1; 216 Eina_Bool req_wh : 1;
218 Eina_Bool req_xy : 1; 217 Eina_Bool req_xy : 1;
219 218
@@ -1676,7 +1675,7 @@ _efl_ui_win_win_rotation_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, int rotat
1676 it = efl_ui_widget_tree_widget_iterator(obj); 1675 it = efl_ui_widget_tree_widget_iterator(obj);
1677 EINA_ITERATOR_FOREACH(it, widget) 1676 EINA_ITERATOR_FOREACH(it, widget)
1678 { 1677 {
1679 if (!efl_isa(widget, EFL_UI_LAYOUT_CLASS)) continue; 1678 if (!efl_isa(widget, EFL_UI_LAYOUT_BASE_CLASS)) continue;
1680 1679
1681 if (efl_ui_layout_automatic_theme_rotation_get(widget)) 1680 if (efl_ui_layout_automatic_theme_rotation_get(widget))
1682 efl_ui_layout_theme_rotation_apply(widget, rot); 1681 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
1686EOLIAN static int 1685EOLIAN static int
1687_efl_ui_win_win_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) 1686_efl_ui_win_win_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
1688{ 1687{
1689 return pd->rotation; 1688 return pd->rot;
1690} 1689}
1691 1690
1692EAPI void 1691EAPI 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)
449} 449}
450EFL_END_TEST 450EFL_END_TEST
451 451
452EFL_START_TEST(elm_win_test_rotation)
453{
454 Evas_Object *win;
455
456 win = win_add(NULL, "win", ELM_WIN_BASIC);
457
458 elm_win_rotation_set(win, 90);
459 ck_assert_int_eq(elm_win_rotation_get(win), 90);
460 elm_win_rotation_with_resize_set(win, 180);
461 ck_assert_int_eq(elm_win_rotation_get(win), 180);
462}
463EFL_END_TEST
464
452void elm_test_win(TCase *tc) 465void elm_test_win(TCase *tc)
453{ 466{
454 tcase_add_test(tc, elm_win_legacy_type_check); 467 tcase_add_test(tc, elm_win_legacy_type_check);
@@ -458,6 +471,7 @@ void elm_test_win(TCase *tc)
458 tcase_add_test(tc, elm_win_test_exit_on_close); 471 tcase_add_test(tc, elm_win_test_exit_on_close);
459 tcase_add_test(tc, elm_win_test_app_exit_on_windows_close); 472 tcase_add_test(tc, elm_win_test_app_exit_on_windows_close);
460 tcase_add_test(tc, efl_ui_win_multi_touch_inputs); 473 tcase_add_test(tc, efl_ui_win_multi_touch_inputs);
474 tcase_add_test(tc, elm_win_test_rotation);
461#ifdef HAVE_ELEMENTARY_X 475#ifdef HAVE_ELEMENTARY_X
462 tcase_add_test(tc, elm_win_autohide); 476 tcase_add_test(tc, elm_win_autohide);
463 tcase_add_test(tc, elm_win_autohide_and_policy_quit_last_window_hidden); 477 tcase_add_test(tc, elm_win_autohide_and_policy_quit_last_window_hidden);