summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-17 16:04:13 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-17 16:04:13 +0000
commit7f8a52344107eb6c0631f21039b9ee9b21bab6ea (patch)
tree66a790fb5f21f8f0f4a5226c6d356adcb16af849 /src
parent0a049a0d913a548cd327542320bc8c22f5184f91 (diff)
downloadvaadin-framework-7f8a52344107eb6c0631f21039b9ee9b21bab6ea.tar.gz
vaadin-framework-7f8a52344107eb6c0631f21039b9ee9b21bab6ea.zip
fixes #4362 + test case
svn changeset:11939/svn branch:6.3
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VWindow.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
index 78a9b9eda5..6005556fff 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
@@ -278,15 +278,16 @@ public class VWindow extends VOverlay implements Container, ScrollListener {
setClosable(!uidl.getBooleanAttribute("readonly"));
// Initialize the position form UIDL
- try {
- final int positionx = uidl.getIntVariable("positionx");
- final int positiony = uidl.getIntVariable("positiony");
- if (positionx >= 0 && positiony >= 0) {
- setPopupPosition(positionx, positiony);
+ int positionx = uidl.getIntVariable("positionx");
+ int positiony = uidl.getIntVariable("positiony");
+ if (positionx >= 0 || positiony >= 0) {
+ if (positionx < 0) {
+ positionx = 0;
}
- } catch (final IllegalArgumentException e) {
- // Silently ignored as positionx and positiony are not required
- // parameters
+ if (positiony < 0) {
+ positiony = 0;
+ }
+ setPopupPosition(positionx, positiony);
}
if (uidl.hasAttribute("caption")) {
@@ -733,6 +734,8 @@ public class VWindow extends VOverlay implements Container, ScrollListener {
@Override
public void setPopupPosition(int left, int top) {
if (top < 0) {
+ // ensure window is not moved out of browser window from top of the
+ // screen
top = 0;
}
super.setPopupPosition(left, top);