Buggy code:
public class Shell extends Decorations { Region region ; Control lastActive ; boolean closing ; boolean moved ; boolean resized ; boolean opened ; int oldX ; int oldY ; int oldWidth ; int oldHeight ; public Shell ( ) { } public Shell ( int style ) { } public Shell ( Display display ) { } public Shell ( Display display , int style ) { } Shell ( Display display , Shell parent , int style , int handle ) { } public Shell ( Shell parent ) { } public Shell ( Shell parent , int style ) { } public static Shell wpf_new ( Display display , int handle ) { } static int checkStyle ( int style ) { } public void addShellListener ( ShellListener listener ) { } void addWidget ( ) { } void bringToTop ( ) { } void checkOpen ( ) { } public void close ( ) { } void createHandle ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { checkWidget ( ) ; if ( ( ( style ) & ( SWT . ON_TOP ) ) != 0 ) return new Rectangle ( x , y , width , height ) ; <START_BUG> OS . UIElement_UpdateLayout ( shellHandle ) ; <END_BUG> int clientX = ( ( int ) ( OS . Window_Left ( shellHandle ) ) ) ; int clientY = ( ( int ) ( OS . Window_Top ( shellHandle ) ) ) ; int w = ( ( int ) ( OS . FrameworkElement_ActualWidth ( shellHandle ) ) ) ; int h = ( ( int ) ( OS . FrameworkElement_ActualHeight ( shellHandle ) ) ) ; int clientWidth = ( ( int ) ( OS . FrameworkElement_ActualWidth ( handle ) ) ) ; int clientHeight = ( ( int ) ( OS . FrameworkElement_ActualHeight ( handle ) ) ) ; int point = OS . gcnew_Point ( clientX , clientY ) ; int result = OS . Visual_PointFromScreen ( shellHandle , point ) ; OS . GCHandle_Free ( point ) ; clientX = - ( ( int ) ( OS . Point_X ( result ) ) ) ; clientY = - ( ( int ) ( OS . Point_Y ( result ) ) ) ; OS . GCHandle_Free ( result ) ; x -= clientX ; y -= clientY ; width += w - clientWidth ; height += h - clientHeight ; return new Rectangle ( x , y , width , height ) ; } void deregister ( ) { } void destroyWidget ( ) { } public void dispose ( ) { } Control findBackgroundControl ( ) { } Control findThemeControl ( ) { } public void forceActive ( ) { } public Rectangle getBounds ( ) { } public int getImeInputMode ( ) { } public Point getLocation ( ) { } public Point getMinimumSize ( ) { } public Region getRegion ( ) { } public Shell getShell ( ) { } public Shell [ ] getShells ( ) { } Composite findDeferredControl ( ) { } public static Shell internal_new ( Display display , int handle ) { } public boolean isEnabled ( ) { } void hookEvents ( ) { } void HandleActivated ( int sender , int e ) { } void HandleClosed ( int sender , int e ) { } void HandleClosing ( int sender , int e ) { } void HandleDeactivated ( int sender , int e ) { } void HandleLocationChanged ( int sender , int e ) { } void HandleMouseLeave ( int sender , int e ) { } void HandleSizeChanged ( int sender , int e ) { } public void open ( ) { } void register ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } public void removeShellListener ( ShellListener listener ) { } public void setActive ( ) { } void setActiveControl ( Control control ) { } int setBounds ( int x , int y , int width , int height , int flags ) { } void setClipping ( ) { } public void setEnabled ( boolean enabled ) { } public void setImeInputMode ( int mode ) { } public void setMinimumSize ( int width , int height ) { } public void setMinimumSize ( Point size ) { } void setParent ( ) { } public void setRegion ( Region region ) { } public void setVisible ( boolean visible ) { } int topHandle ( ) { } boolean traverseEscape ( ) { } }

Fix:
updateLayout ( shellHandle ) ;