toast_popup: restrict popup rotations 93/93493/2
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 24 Oct 2016 12:29:19 +0000 (14:29 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 24 Oct 2016 13:22:16 +0000 (15:22 +0200)
Previously toast popup handled all possible rotations: 0, 90, 180, 270.
Now popup rotation is restricted only to rotation of current top window.

Change-Id: Ie2bdac84db47caef5b73a83295ebdd453581bda0

src/main.c
src/modules/information/toast_popup.c
src/ticker.c

index 798611a81bd27bf806a45f6c014f17ce8b37db97..aecf55664c31601882cbda600c916eba18b26a83 100644 (file)
@@ -323,7 +323,9 @@ static void _indicator_service_cb(void *data, tzsh_indicator_service_h service,
                        break;
                default:
                        _E("Unahandled rotation value");
+                       return;
        }
+       info->angle = angle;
 }
 
 int indicator_tzsh_init(win_info *info)
index fa34d3376eaa55550b323b1d44b21575e29c1614..0fdd697d7b3abfe561f7d2562bc55fd11ec59b98 100644 (file)
@@ -88,8 +88,9 @@ static void _post_toast_message(char *message)
        elm_win_title_set(toast_window, "toast");
 
        if (elm_win_wm_rotation_supported_get(toast_window)) {
-               int rots[4] = { 0, 90, 180, 270 };
-               elm_win_wm_rotation_available_rotations_set(toast_window, (const int *)(&rots), 4);
+               int rots[1] = { s_info.app_data->win.angle };
+               elm_win_wm_rotation_available_rotations_set(toast_window,
+                               (const int *)(&rots), ARRAY_SIZE(rots));
        }
        evas_object_show(toast_window);
 
index 5491048720f8bf0ab2601f6050163260d7d8056b..b6bcc4132f8d6c3d3a5fe3f9064b3e32b7eb41b1 100644 (file)
@@ -874,8 +874,8 @@ static Evas_Object *_create_ticker_window(Evas_Object *parent, struct appdata *a
        evas_object_hide(win);
 
        if (elm_win_wm_rotation_supported_get(win)) {
-               int rots[4] = { 0, 90, 180, 270 };
-               elm_win_wm_rotation_available_rotations_set(win, rots, 4);
+               int rots[1] = { ad->win.angle };
+               elm_win_wm_rotation_available_rotations_set(win, rots, ARRAY_SIZE(rots));
        }
        evas_object_smart_callback_add(win, "wm,rotation,changed", _rotate_cb, ad);