Project

General

Profile

1811q_20150914_1.txt

Sergey Ivanovskiy, 09/14/2015 10:07 AM

Download (2.28 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	2015-09-10 17:38:10 +0000
3
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java	2015-09-14 14:02:55 +0000
4
@@ -703,6 +703,26 @@
5
    @Override
6
    public void windowIconified(int windowId, boolean state)
7
    {
8
+      //TODO remove it if it will work properly.
9
+//      System.err.println("windowIconified(" + windowId + ", " + state + ")");
10
+//      List<TitledWindow<?>> windowsList = WindowManager.windowList();
11
+//      boolean emptyScreen = true;
12
+//      for(TitledWindow<?> win : windowsList)
13
+//      {
14
+//         System.err.println("windowId = " + win.getId().asInt() + " visible = " + win.isVisible());
15
+//         if (win.isVisible())
16
+//         {
17
+//            emptyScreen = false;
18
+//            break;
19
+//         }
20
+//      }
21
+//      System.err.println("current window = " + ((ews != null) ? ews.getWindowId(): "null"));
22
+//      if (emptyScreen)
23
+//      {
24
+//         System.err.println("empty screen for windowIconified(" + windowId + ", " + state + ")");
25
+//         selectWindow(windowId);
26
+//         System.err.println("selected current window = " + ((ews != null) ? ews.getWindowId(): "null"));
27
+//      }
28
       if (state)
29
       {
30
          iconifyWindow(windowId);
31
@@ -714,6 +734,34 @@
32
    }
33
    
34
    /**
35
+    * Select the window and then iconify it.
36
+    * 
37
+    * @param    sourceId
38
+    *           The root ID of the sub-tree which was iconified, and triggered iconification of 
39
+    *           this window.
40
+    */
41
+   @Override
42
+   public void iconifyWindow(int sourceId)
43
+   {
44
+      selectWindow(sourceId);
45
+      super.iconifyWindow(sourceId);
46
+   }
47
+
48
+   /**
49
+    * Select the window and then de-iconify the window.
50
+    * 
51
+    * @param    sourceId
52
+    *           The root ID of the sub-tree which was deiconified, and triggered restoration of 
53
+    *           this window.
54
+    */
55
+   @Override
56
+   public void deiconifyWindow(int sourceId)
57
+   {
58
+      selectWindow(sourceId);
59
+      super.deiconifyWindow(sourceId);
60
+   }
61
+
62
+   /**
63
     * Register all the mouse-aware widgets (in all Windows) with the JS side.
64
     * <p>
65
     * To register a widget, it must be visible, displayed and enabled, and part of a visible
66