skin: no need to shell pack while layout changing
authorGiWoong Kim <giwoong.kim@samsung.com>
Fri, 6 Sep 2013 05:16:46 +0000 (14:16 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Fri, 6 Sep 2013 05:16:46 +0000 (14:16 +0900)
no need to shell pack while layout changing
And set Display parent to screenshot shell on Mac

Change-Id: I0746ca1e2df46e1441c2aca5d7610ca7ac7f074f
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java
tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java

index 4b4651b3c13d347faa5a5b5ff37ad48d588aafd8..93c7d867b49603405c2aee3b0d25dd76de4fc347 100644 (file)
@@ -39,7 +39,6 @@ import java.util.Map;
 import java.util.logging.Logger;
 
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.widgets.Display;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.dbi.EmulatorUI;
index 4e24367f6452a441fe352921e83dbe092bb415a7..8d49ae2977848d268193d3c975ec6e88afdfb1b6 100644 (file)
@@ -270,13 +270,6 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                }
 
                /* set window size */
-               if (currentState.getCurrentImage() != null) {
-                       ImageData imageData = currentState.getCurrentImage().getImageData();
-                       shell.setMinimumSize(imageData.width, imageData.height);
-               }
-
-               shell.pack();
-
                if (currentState.getCurrentImage() != null) {
                        ImageData imageData = currentState.getCurrentImage().getImageData();
                        shell.setSize(imageData.width, imageData.height);
@@ -377,15 +370,6 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                        public void paintControl(final PaintEvent e) {
                                if (currentState.isNeedToUpdateDisplay() == true) {
                                        currentState.setNeedToUpdateDisplay(false);
-
-//                                     if (skin.communicator.isSensorDaemonStarted() == true) {
-//                                             /* Let's do one more update for sdl display surface
-//                                             while skipping of framebuffer drawing */
-//                                             DisplayStateData lcdStateData = new DisplayStateData(
-//                                                             currentState.getCurrentScale(), currentState.getCurrentRotationId());
-//                                             skin.communicator.sendToQEMU(
-//                                                             SendCommand.CHANGE_LCD_STATE, lcdStateData, false);
-//                                     }
                                }
 
                                /* set window size once again (for ubuntu 12.04) */
index 7d1fce2e8aeb4319d48455b7c68c873ee5c390f7..04629f4d77052fb2b0d976d94bb7a40553d03e83 100644 (file)
@@ -197,12 +197,9 @@ public class ProfileSpecificSkinComposer implements ISkinComposer {
                                        SWT.ICON_ERROR, config);
                        System.exit(-1);
                }
-               logger.info("lcd bounds : " + lcdBounds);
+               logger.info("display bounds : " + lcdBounds);
 
                currentState.setDisplayBounds(lcdBounds);
-               if (SwtUtil.isMacPlatform() == true) {
-                       lcdCanvas.setBounds(currentState.getDisplayBounds());
-               }
 
                /* arrange the skin image */
                Image tempImage = null;
@@ -227,20 +224,16 @@ public class ProfileSpecificSkinComposer implements ISkinComposer {
                        tempKeyPressedImage.dispose();
                }
 
+               if (SwtUtil.isMacPlatform() == true) {
+                       lcdCanvas.setBounds(currentState.getDisplayBounds());
+               }
+
                /* arrange the progress bar */
                if (skin.bootingProgress != null) {
                        skin.bootingProgress.setBounds(lcdBounds.x,
                                        lcdBounds.y + lcdBounds.height + 1, lcdBounds.width, 2);
                }
 
-               /* set window size */
-               if (currentState.getCurrentImage() != null) {
-                       ImageData imageData = currentState.getCurrentImage().getImageData();
-                       shell.setMinimumSize(imageData.width, imageData.height);
-               }
-
-               shell.pack();
-
                /* set window size */
                if (currentState.getCurrentImage() != null) {
                        ImageData imageData = currentState.getCurrentImage().getImageData();
@@ -292,18 +285,10 @@ public class ProfileSpecificSkinComposer implements ISkinComposer {
                        public void paintControl(final PaintEvent e) {
                                if (currentState.isNeedToUpdateDisplay() == true) {
                                        currentState.setNeedToUpdateDisplay(false);
+
                                        if (SwtUtil.isMacPlatform() == false) {
                                                lcdCanvas.setBounds(currentState.getDisplayBounds());
                                        }
-
-//                                     if (skin.communicator.isSensorDaemonStarted() == true) {
-//                                             /* Let's do one more update for sdl display surface
-//                                             while skipping of framebuffer drawing */
-//                                             DisplayStateData lcdStateData = new DisplayStateData(
-//                                                             currentState.getCurrentScale(), currentState.getCurrentRotationId());
-//                                             skin.communicator.sendToQEMU(
-//                                                             SendCommand.CHANGE_LCD_STATE, lcdStateData, false);
-//                                     }
                                }
 
                                /* set window size once again (for ubuntu 12.04) */
index d1a5bc657bdcffe582b16b8f75304773d5eed1fb..4ca8b43f7e494c85784b0571bca5a2ef487463bd 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
+ * Munkyu Im <munkyu.im@samsung.com>
  * GiWoong Kim <giwoong.kim@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * HyunJun Son
@@ -117,11 +118,15 @@ public class ScreenShotDialog {
                this.config = config;
                this.scaleLevel = 100d;
 
-               shell = new Shell(parent, SWT.SHELL_TRIM);
+               if (SwtUtil.isMacPlatform() == false) {
+                       shell = new Shell(parent, SWT.SHELL_TRIM);
+               } else {
+                       shell = new Shell(parent.getDisplay(), SWT.SHELL_TRIM);
+               }
                shell.setText("Screen Shot - " + SkinUtil.makeEmulatorName(config));
 
                /* To prevent the icon switching on Mac */
-               if (!SwtUtil.isMacPlatform()) {
+               if (SwtUtil.isMacPlatform() == false) {
                        if (icon != null) {
                                shell.setImage(icon);
                        }
@@ -130,6 +135,8 @@ public class ScreenShotDialog {
                shell.addListener(SWT.Close, new Listener() {
                        @Override
                        public void handleEvent(Event event) {
+                               logger.info("ScreenShot Window is closed");
+
                                if (null != image) {
                                        if (!reserveImage) {
                                                image.dispose();