=== modified file 'src/com/goldencode/p2j/ui/client/gui/WindowGuiImpl.java' --- src/com/goldencode/p2j/ui/client/gui/WindowGuiImpl.java 2015-09-18 13:47:36 +0000 +++ src/com/goldencode/p2j/ui/client/gui/WindowGuiImpl.java 2015-09-18 15:27:22 +0000 @@ -1428,19 +1428,19 @@ gd.registerMoveableWidget(titleBar.config().id.asInt()); gd.registerResizeableWidget(this.config().id.asInt()); - Menu popup = createPopup(); - reg.addWidgetsRecursive(popup); - moveToBottom(popup); +// Menu popup = createPopup(); +// reg.addWidgetsRecursive(popup); +// moveToBottom(popup); - gd.registerWidgetPopup(((AbstractWidget) titleBar.icon).getId().asInt(), - MouseEvent.BUTTON1, - popup.config().id.asInt()); - gd.registerWidgetPopup(titleBar.config().id.asInt(), - MouseEvent.BUTTON3, - popup.config().id.asInt()); - gd.registerWidgetPopup(((AbstractWidget) titleBar.title).getId().asInt(), - MouseEvent.BUTTON3, - popup.config().id.asInt()); +// gd.registerWidgetPopup(((AbstractWidget) titleBar.icon).getId().asInt(), +// MouseEvent.BUTTON1, +// popup.config().id.asInt()); +// gd.registerWidgetPopup(titleBar.config().id.asInt(), +// MouseEvent.BUTTON3, +// popup.config().id.asInt()); +// gd.registerWidgetPopup(((AbstractWidget) titleBar.title).getId().asInt(), +// MouseEvent.BUTTON3, +// popup.config().id.asInt()); gd.setWindowVisible(config.visible); } === modified file 'src/com/goldencode/p2j/ui/client/gui/driver/EmulatedWindowState.java' --- src/com/goldencode/p2j/ui/client/gui/driver/EmulatedWindowState.java 2015-09-08 10:15:53 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/EmulatedWindowState.java 2015-09-18 16:43:17 +0000 @@ -451,6 +451,13 @@ case SET_LOCATION: extra = String.format(" x = %d; y = %d", ps.x, ps.y); break; + case SET_WINDOW_BOUNDS: + extra = String.format(" x = %d; y = %d; width = %d; height = %d", + ps.x, + ps.y, + ps.width, + ps.height); + break; case DRAW_STRING: extra = String.format(" text = %s; x = %d; y = %d; centered = %b", ps.text, === modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebEmulatedWindow.java' --- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebEmulatedWindow.java 2015-09-01 18:27:30 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebEmulatedWindow.java 2015-09-18 16:27:57 +0000 @@ -378,6 +378,16 @@ websock.setWindowLocation(x, y); } break; + case SET_WINDOW_BOUNDS: + if (x != ps.x || y != ps.y || width != ps.width || height != ps.height) + { + x = ps.x; + y = ps.y; + width = ps.width; + height = ps.height; + websock.setWindowBounds(x, y, width, height); + } + break; case RESIZE_WINDOW: if (width != ps.width || height != ps.height) { === modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java' --- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java 2015-09-18 11:10:16 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java 2015-09-18 16:39:02 +0000 @@ -440,6 +440,23 @@ } /** + * Set the window bounds. + * + * @param x + * The X coordinate in pixels. + * @param y + * The Y coordinate in pixels. + * @param width + * The window width in pixels. + * @param height + * The window height in pixels. + */ + public void setWindowBounds(int x, int y, int width, int height) + { + allocateAndSend(PaintPrimitives.SET_WINDOW_BOUNDS, x, y, width, height); + } + + /** * Force the list of all GUI windows to be stacked as in the specified order. * * @param windowIds === modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js' --- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-09-18 11:10:16 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-09-18 16:32:57 +0000 @@ -73,12 +73,13 @@ FLUSH : 22, SET_LOCATION : 23, RESIZE_WINDOW : 24, - DRAW_HIGHLIGHT : 25, - CLEAR_HIGHLIGHT : 26, - START_BATCH : 27, - END_BATCH : 28, - SET_TITLE : 29, - SET_ICON : 30, + SET_WINDOW_BOUNDS : 25, + DRAW_HIGHLIGHT : 26, + CLEAR_HIGHLIGHT : 27, + START_BATCH : 28, + END_BATCH : 29, + SET_TITLE : 30, + SET_ICON : 31, }; // reverse map the types to their property names @@ -843,6 +844,16 @@ extra = " " + this.clips.toString(); this.canvasRenderer.unclip(); break; + case ops.SET_WINDOW_BOUNDS: + x = p2j.socket.readInt32BinaryMessage(message, idx + 1); + y = p2j.socket.readInt32BinaryMessage(message, idx + 5); + this.canvas.style.left = x.toString() + "px"; + this.canvas.style.top = y.toString() + "px"; + width = p2j.socket.readInt32BinaryMessage(message, idx + 1); + height = p2j.socket.readInt32BinaryMessage(message, idx + 5); + this.resize(width, height); + extra = " x = " + x + "; y = " + y + "; width = " + width + "; height = " + height; + break; case ops.SET_LOCATION: x = p2j.socket.readInt32BinaryMessage(message, idx + 1); y = p2j.socket.readInt32BinaryMessage(message, idx + 5);