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 798611a..aecf556 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 fa34d33..0fdd697 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 5491048..b6bcc41 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);