+ /**
+ * Handle window/screen resize events.
+ *
+ * @param event resize event
+ */
+ @Override
+ public void onResize(final TResizeEvent event) {
+ if (event.getType() == TResizeEvent.Type.WIDGET) {
+ int newWidth = event.getWidth() - 2;
+ int newHeight = event.getHeight() - 2;
+ if ((newWidth != otherScreen.getWidth())
+ || (newHeight != otherScreen.getHeight())
+ ) {
+ // I was resized, notify the screen I am watching to match my
+ // new size.
+ synchronized (eventQueue) {
+ eventQueue.add(new TResizeEvent(TResizeEvent.Type.SCREEN,
+ newWidth, newHeight));
+ }
+ synchronized (listener) {
+ listener.notifyAll();
+ }
+ }
+ return;
+ } else {
+ super.onResize(event);
+ }
+ }
+