apply new active window rotation guide 15/17815/1
authorHyungdeuk Kim <hd3.kim@samsung.com>
Thu, 27 Jun 2013 12:18:14 +0000 (21:18 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Tue, 11 Mar 2014 07:09:19 +0000 (16:09 +0900)
Change-Id: I3ed2d5b0c1795bccf45a78e0df17f9a9bab6a334

packaging/syspopup.spec
syspopup/syspopup.c
syspopup/syspopup_efl.c

index 422e0bc..a6edc04 100755 (executable)
@@ -3,7 +3,7 @@
 
 Name:           syspopup
 Summary:        Syspopup package
-Version:        0.0.95
+Version:        0.0.96
 Release:        0
 Group:          System/Libraries
 License:        Apache-2.0
index eec3d03..e91b812 100755 (executable)
@@ -280,6 +280,7 @@ int X_syspopup_process_keydown(int id, const char *keyname)
        return 0;
 }
 
+#ifdef ROTATE_USING_X_CLIENT
 int X_syspopup_process_rotate(int id)
 {
 #ifndef WAYLAND
@@ -301,6 +302,7 @@ int X_syspopup_process_rotate(int id)
 
        return 0;
 }
+#endif
 
 #ifndef WAYLAND
 int X_make_syspopup(bundle *b, Display *dpy, Window xwin, void *win,
index 852eb3e..88b2981 100755 (executable)
@@ -33,6 +33,8 @@
 #include <Ecore_X.h>
 #endif
 
+#define WIN_PROP_NAME "SYSTEM_POPUP"
+
 static void __elm_popupwin_del_cb(void *data, Evas * e, Evas_Object * obj,
                                  void *event_info)
 {
@@ -57,6 +59,7 @@ static Eina_Bool __x_keydown_cb(void *data, int type, void *event)
        return ECORE_CALLBACK_DONE;
 }
 
+#ifdef ROTATE_USING_X_CLIENT
 static Eina_Bool __x_rotate_cb(void *data, int type, void *event)
 {
        int id = (int)data;
@@ -91,6 +94,12 @@ static int __efl_rotate(Display *dpy, Window win, syspopup *sp)
        return 0;
 }
 #endif
+#else
+static int __efl_rotate(Display *dpy, Window win, syspopup *sp)
+{
+       return 0;
+}
+#endif
 
 API int syspopup_create(bundle *b, syspopup_handler *handler,
                        Evas_Object *parent, void *user_data)
@@ -125,7 +134,7 @@ API int syspopup_create(bundle *b, syspopup_handler *handler,
 
                id = X_make_syspopup(b, dpy, xwin, parent, __efl_rotate,
                                     handler, user_data);
-               if (id < 0) {   
+               if (id < 0) {
                        _E("fail to make X syspopup");
                        return -1;
                }
@@ -139,8 +148,17 @@ API int syspopup_create(bundle *b, syspopup_handler *handler,
                /* X_syspopup_core should process 2 events */
                /* First, rotate event */
                /* Second, keydown event */
-               ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
-                                       __x_rotate_cb, (void *)id);
+#ifdef ROTATE_USING_X_CLIENT
+               ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,__x_rotate_cb, (void *)id);
+#else
+               ecore_x_icccm_name_class_set(xwin, WIN_PROP_NAME, WIN_PROP_NAME);
+               if (elm_win_wm_rotation_supported_get(parent)) {
+                       int rots[4] = { 0, 90, 180, 270 };
+                       elm_win_wm_rotation_available_rotations_set(parent, &rots, 4);
+               } else {
+                       _E("win rotation no supported");
+               }
+#endif
        }
 #endif