onResize is not called after zooming.
Current GWT implementation:
public native void initWindowResizeHandler() /*-{
var oldOnResize = $wnd.onresize;
$wnd.onresize = $entry(function(evt) {
try {
@com.google.gwt.user.client.Window::onResize()();
} finally {
oldOnResize && oldOnResize(evt);
}
});
}-*/;
The only solutions I found for capturing resize events use polling.
Is polling the best (only) way? If so, how can the Scheduler be used for optimal performance?
Once the event is captured, does calling com.google.gwt.user.client.Window::onResize() seem like a good idea?
Thanks
Current solution looking for improvements
@Override
protected void onLoad() {
Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
@Override
public boolean execute() {
if (listOuter.getOffsetWidth() != knownWidth)
onResize();
return SomeListViewImpl.this.isAttached();
}
}, 200);
}
onResize is called on Window.onresize and on zooming.
@Override
public void onResize() {
knownWidth = listOuter.getOffsetWidth();
GWT.log("resize: " + knownWidth);
//some magic
}