skin: sync up the 'Always On Top'
authorgiwoong.kim <giwoong.kim@samsung.com>
Mon, 3 Dec 2012 10:43:54 +0000 (19:43 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Mon, 3 Dec 2012 10:43:54 +0000 (19:43 +0900)
Sync up the 'Always On Top' between emulator window
and key window.

Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java

index 37ff70d..8ad1686 100644 (file)
@@ -891,6 +891,8 @@ public class EmulatorSkin {
        public void openKeyWindow() {
                if (controlPanel != null) {
                        controlPanel.getShell().setVisible(true);
+                       SkinUtil.setTopMost(controlPanel.getShell(), isOnTop);
+
                        pairTagCanvas.setVisible(true);
                        return;
                }
@@ -909,10 +911,13 @@ public class EmulatorSkin {
 
                try {
                        controlPanel = new ControlPanel(shell, communicator, keyMapList);
+                       SkinUtil.setTopMost(controlPanel.getShell(), isOnTop);
+
                        colorPairTag = controlPanel.getPairTagColor();
                        pairTagCanvas.setVisible(true);
 
                        controlPanel.open();
+                       /* do not add at this line */
                } finally {
                        controlPanel = null;
                }
@@ -956,13 +961,17 @@ public class EmulatorSkin {
                        onTopItem.addSelectionListener(new SelectionAdapter() {
                                @Override
                                public void widgetSelected(SelectionEvent e) {
-                                       final boolean isOnTop = onTopItem.getSelection();
+                                       isOnTop = onTopItem.getSelection();
 
                                        logger.info("Select Always On Top : " + isOnTop);
                                        // readyToReopen(EmulatorSkin.this, isOnTop);
 
                                        if (SkinUtil.setTopMost(shell, isOnTop) == false) {
                                                logger.info("failed to Always On Top");
+                                       } else {
+                                               if (controlPanel != null) {
+                                                       SkinUtil.setTopMost(controlPanel.getShell(), isOnTop);
+                                               }
                                        }
                                }
                        } );
index c85d2cd..a128b11 100644 (file)
@@ -1011,18 +1011,22 @@ public class SkinUtil {
        }
 
        public static boolean setTopMost(Shell shell, boolean isOnTop) {
+               if (shell == null) {
+                       return false;
+               }
+
                /* internal/Library.java::arch() */
                String osArch = System.getProperty("os.arch"); /* $NON-NLS-1$ */
-               logger.info(osArch);
+
                if (osArch.equals("amd64") || osArch.equals("x86_64") ||
                                osArch.equals("IA64W") || osArch.equals("ia64")) {
                        /* $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ */
-                       logger.info("64bit architecture");
+                       logger.info("64bit architecture : " + osArch);
 
                        return setTopMost64(shell, isOnTop); /* 64bit */
                }
 
-               logger.info("32bit architecture");
+               logger.info("32bit architecture : " + osArch);
                return setTopMost32(shell, isOnTop); /* 32bit */
        }
 }