Make IME Selector popup rotate with the caller application 56/49656/1
authorSungmin Kwak <sungmin.kwak@samsung.com>
Fri, 16 Oct 2015 08:29:33 +0000 (17:29 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 16 Oct 2015 13:08:02 +0000 (22:08 +0900)
If the caller application supports only portrait mode, the popup would not rotate.

Change-Id: Ide999eb2499ba14a9d8bd8cf04ad86e4fc1fb5a5

im_setting_selector/input_method_setting_selector.h
im_setting_selector/input_method_setting_selector_ui.cpp

index 73fe5e7..00b91c0 100644 (file)
@@ -34,9 +34,7 @@ enum {
 };
 
 enum {
-    APP_TYPE_SETTING = 1,
-    APP_TYPE_SETTING_NO_ROTATION,
-    APP_TYPE_NORMAL,
+    APP_TYPE_NORMAL = 1,
 };
 
 typedef struct _appdata {
index e3e1e88..c800b99 100644 (file)
@@ -56,18 +56,29 @@ static void im_setting_selector_text_domain_set(void)
 static Evas_Object *
 im_setting_selector_main_window_create(const char *name)
 {
-    int rots[4] = {0, 90, 180, 270};
-    Evas_Object *eo = NULL;
-    int w = -1, h = -1;
-    eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
-
+    Evas_Object *eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
     if (eo) {
+        Evas *e;
+        Ecore_Evas *ee;
+        Evas_Coord w = -1, h = -1;
+
         elm_win_title_set(eo, name);
         elm_win_borderless_set(eo, EINA_TRUE);
         elm_win_alpha_set(eo, EINA_TRUE);
         elm_win_conformant_set(eo, EINA_TRUE);
         elm_win_autodel_set(eo, EINA_TRUE);
-        elm_win_wm_rotation_available_rotations_set(eo, rots, 4);
+        if (elm_win_wm_rotation_supported_get (eo)) {
+            int rots[4] = {0, 90, 180, 270};
+            elm_win_wm_rotation_available_rotations_set(eo, rots, 4);
+        }
+        e = evas_object_evas_get(eo);
+        if (e) {
+            ee = ecore_evas_ecore_evas_get(e);
+            if (ee) {
+                ecore_evas_name_class_set(ee, "SYSTEM_POPUP", "SYSTEM_POPUP");
+            }
+        }
+
         elm_win_screen_size_get(eo, NULL, NULL, &w, &h);
         if (w > 0 && h > 0) {
             evas_object_resize(eo, w, h);