=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java' --- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java 2015-09-10 17:38:10 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java 2015-09-14 14:02:55 +0000 @@ -703,6 +703,26 @@ @Override public void windowIconified(int windowId, boolean state) { + //TODO remove it if it will work properly. +// System.err.println("windowIconified(" + windowId + ", " + state + ")"); +// List> windowsList = WindowManager.windowList(); +// boolean emptyScreen = true; +// for(TitledWindow win : windowsList) +// { +// System.err.println("windowId = " + win.getId().asInt() + " visible = " + win.isVisible()); +// if (win.isVisible()) +// { +// emptyScreen = false; +// break; +// } +// } +// System.err.println("current window = " + ((ews != null) ? ews.getWindowId(): "null")); +// if (emptyScreen) +// { +// System.err.println("empty screen for windowIconified(" + windowId + ", " + state + ")"); +// selectWindow(windowId); +// System.err.println("selected current window = " + ((ews != null) ? ews.getWindowId(): "null")); +// } if (state) { iconifyWindow(windowId); @@ -714,6 +734,34 @@ } /** + * Select the window and then iconify it. + * + * @param sourceId + * The root ID of the sub-tree which was iconified, and triggered iconification of + * this window. + */ + @Override + public void iconifyWindow(int sourceId) + { + selectWindow(sourceId); + super.iconifyWindow(sourceId); + } + + /** + * Select the window and then de-iconify the window. + * + * @param sourceId + * The root ID of the sub-tree which was deiconified, and triggered restoration of + * this window. + */ + @Override + public void deiconifyWindow(int sourceId) + { + selectWindow(sourceId); + super.deiconifyWindow(sourceId); + } + + /** * Register all the mouse-aware widgets (in all Windows) with the JS side. *

* To register a widget, it must be visible, displayed and enabled, and part of a visible