skin: The negative bounds of monitor is considered
authorgiwoong.kim <giwoong.kim@samsung.com>
Tue, 18 Jun 2013 10:14:05 +0000 (19:14 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Tue, 18 Jun 2013 10:41:02 +0000 (19:41 +0900)
The negative bounds of monotor is considered
for window position

Change-Id: Ia1dc7a658aa5bdc2a25a5f97fbc4c5bb052b23cd
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/custom/SkinWindow.java

index 10106e2c98101555639f3f3f754cb95df2c1a4c1..cf5fbca2e1de5c1f9af64f0385bc4709b3213ef6 100644 (file)
@@ -1448,10 +1448,11 @@ public class EmulatorSkin {
 //                                             }
 
                                                /* location correction */
-                                               Rectangle emulatorBound = shell.getBounds();
+                                               Rectangle monitorBounds = Display.getDefault().getBounds();
+                                               Rectangle emulatorBounds = shell.getBounds();
                                                shell.setLocation(
-                                                               Math.max(emulatorBound.x, 0),
-                                                               Math.max(emulatorBound.y, 0));
+                                                               Math.max(emulatorBounds.x, monitorBounds.x),
+                                                               Math.max(emulatorBounds.y, monitorBounds.y));
                                        }
                                });
 
@@ -1528,10 +1529,11 @@ public class EmulatorSkin {
 //                                             }
 
                                                /* location correction */
-                                               Rectangle emulatorBound = shell.getBounds();
+                                               Rectangle monitorBounds = Display.getDefault().getBounds();
+                                               Rectangle emulatorBounds = shell.getBounds();
                                                shell.setLocation(
-                                                               Math.max(emulatorBound.x, 0),
-                                                               Math.max(emulatorBound.y, 0));
+                                                               Math.max(emulatorBounds.x, monitorBounds.x),
+                                                               Math.max(emulatorBounds.y, monitorBounds.y));
                                        }
                                });
 
index dadac594dcf42600d6ba087c2839d030754cb805..77618eda7a967a70cf92fd34952768e3f5b66d79 100644 (file)
@@ -1,7 +1,7 @@
 /**
+ * child window of skin
  *
- *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * GiWoong Kim <giwoong.kim@samsung.com>
@@ -10,7 +10,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or ( at your option ) any later version.
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -134,8 +134,8 @@ public class SkinWindow {
                        }
 
                        /* for left side */
-                       if (x < 0) {
-                               shift = x * (-1);
+                       shift = monitorBounds.x - x;
+                       if (shift > 0) {
                                x += shift;
                                parent.setLocation(parentBounds.x + shift, parentBounds.y);
                        }