Modified to call elm_win_raise() for mangifier window
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 5 Apr 2013 06:03:15 +0000 (15:03 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 5 Apr 2013 06:03:15 +0000 (15:03 +0900)
packaging/libscl-ui.spec
scl/gwes/efl/sclwindows-efl.cpp
scl/include/sclversion.h

index 4c252be..8d7540d 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:       libscl-ui
 Summary:    A library for developing XML-based software keyboards
-Version:    0.2.6
+Version:    0.2.7
 Release:    1
 Group:      TO BE / FILLED IN
 License:    TO BE / FILLED IN
index bbd299a..11a8c8e 100644 (file)
 #include "scluibuilder.h"
 #include "sclwindows.h"
 
+#include <glib.h>
 #include <Elementary.h>
 #include <Ecore_X.h>
 #include <malloc.h>
 #include <X11/Xlib.h>
+#include <X11/Xatom.h>
 
 using namespace scl;
 
-Ecore_X_Atom ATOM_WM_CLASS = 0;
+static Ecore_X_Atom ATOM_WM_CLASS = 0;
+static Ecore_X_Window app_window = 0;
 
 const sclint rotation_values_EFL[ROTATION_MAX] = {
     0, // ROTATION_0
@@ -400,11 +403,6 @@ CSCLWindowsImplEfl::show_window(const sclwindow window, sclboolean queue)
     CSCLContext *context = CSCLContext::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
     if (windows && context && window) {
-#ifndef APPLY_WINDOW_MANAGER_CHANGE
-        if (windows->get_magnifier_window() == window) {
-            set_parent(windows->get_base_window(), window);
-        }
-#endif
         SclWindowContext *winctx = windows->get_window_context(window);
         if (!(context->get_hidden_state())) {
             if (winctx) {
@@ -421,13 +419,41 @@ CSCLWindowsImplEfl::show_window(const sclwindow window, sclboolean queue)
                 }
             }
         }
-        /*
-         * FIXME a solution to make magnifier window always on top
-         * N_SE-17689: magnifier window showing behind of candidate window
-         */
-        if (window != windows->get_base_window()) {
-            //elm_win_raise((Evas_Object *)window);
+#ifndef APPLY_WINDOW_MANAGER_CHANGE
+        if (windows->get_base_window() == window) {
+            int  ret = 0;
+            Atom type_return;
+            int  format_return;
+            unsigned long    nitems_return;
+            unsigned long    bytes_after_return;
+            unsigned char   *data = NULL;
+
+            Ecore_X_Window win = elm_win_xwindow_get(static_cast<Evas_Object*>(window));
+            ret = XGetWindowProperty ((Display *)ecore_x_display_get (),
+                    ecore_x_window_root_get (win),
+                    ecore_x_atom_get ("_ISF_ACTIVE_WINDOW"),
+                    0, G_MAXLONG, False, XA_WINDOW, &type_return,
+                    &format_return, &nitems_return, &bytes_after_return,
+                    &data);
+
+            if (ret == Success) {
+                if ((type_return == XA_WINDOW) && (format_return == 32) && (data)) {
+                    app_window = *(Window *)data;
+                    if (data)
+                        XFree (data);
+                }
+            }
         }
+        if (windows->get_magnifier_window() == window) {
+            /*
+             * FIXME a solution to make magnifier window always on top
+             * N_SE-17689: magnifier window showing behind of candidate window
+             */
+            ecore_x_icccm_transient_for_set
+                (elm_win_xwindow_get(static_cast<Evas_Object*>(window)), app_window);
+            elm_win_raise((Evas_Object *)window);
+        }
+#endif
         utils->log("%p (basewin %p mag %p)\n", window,
             windows->get_base_window(), windows->get_magnifier_window());
     }
index 4885360..3ef978d 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef __SCL_VERSION_H__
 #define __SCL_VERSION_H__
 
-#define SCL_VERSION "0.2.6-1"
+#define SCL_VERSION "0.2.7-1"
 
 #endif //__SCL_VERSION_H