Project

General

Profile

3066_4.txt

Sergey Ivanovskiy, 04/18/2016 07:38 AM

Download (2.02 KB)

 
1
=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java'
2
--- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java	2016-04-12 16:24:51 +0000
3
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java	2016-04-18 11:29:43 +0000
4
@@ -53,7 +53,8 @@
5
 ** 017 HC  20160407 Overhaul of window-activation logic. Removed setOverlayWindowLocation(), the
6
 **                  method was unnecessary and was causing the COMBO-BOX drop-down location
7
 **                  incorrect.
8
-** 018 SBI 20160412 Added openURL(String path) to open the target page in the browser.
9
+** 018 SBI 20160418 Added openURL(String path) to open the target page in the browser. Fixed
10
+**                  maximal window's width and height values if they are not set by the server.
11
 */
12
 
13
 package com.goldencode.p2j.ui.client.gui.driver.web;
14
@@ -1368,13 +1369,25 @@
15
       }
16
       
17
       WindowConfig wcfg = window.config();
18
+      // get actual size
19
+      NativeDimension size = window.physicalDimension();
20
+      
21
+      // if the actual size is greater than the configuration size, then let the maximal size be
22
+      // equal to its actual size.
23
+      int maxWidthPixels  = Math.max(ConfigHelper.getMaxWidthPixels(wcfg), size.width);
24
+      
25
+      int maxHeightPixels = Math.max(ConfigHelper.getMaxHeightPixels(wcfg), size.height);
26
+      
27
+      int minWidthPixels  = ConfigHelper.getMinWidthPixels(wcfg);
28
+      
29
+      int minHeightPixels = ConfigHelper.getMinHeightPixels(wcfg);
30
 
31
       websock.setResizeableWindow(ews.getWindowId(), 
32
                                   wcfg.resize,
33
-                                  wcfg.minWidthPixels,
34
-                                  wcfg.minHeightPixels,
35
-                                  wcfg.maxWidthPixels,
36
-                                  wcfg.maxHeightPixels);
37
+                                  minWidthPixels,
38
+                                  minHeightPixels,
39
+                                  maxWidthPixels,
40
+                                  maxHeightPixels);
41
    }
42
 
43
    /**
44