Buggy code:
int oldHeight ; int minWidth ; int minHeight ; Control lastActive ; Region region ; 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 gtk_new ( Display display , int handle ) { } static int checkStyle ( int style ) { } public void addShellListener ( ShellListener listener ) { } void adjustTrim ( ) { } void bringToTop ( boolean force ) { } public void close ( ) { } void closeWidget ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( int index ) { } boolean hasBorder ( ) { } void hookEvents ( ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void register ( ) { } void releaseChild ( ) { } int topHandle ( ) { } int filterProc ( int xEvent , int gdkEvent , int data ) { } void fixShell ( Shell newShell , Control control ) { } public Point getLocation ( ) { } public Point getMinimumSize ( ) { } public Point getSize ( ) { } public Region getRegion ( ) { } public int getImeInputMode ( ) { } Shell _getShell ( ) { } public Shell [ ] getShells ( ) { } int gtk_configure_event ( int widget , int event ) { } int gtk_delete_event ( int widget , int event ) { } int gtk_enter_notify_event ( int widget , int event ) { } int gtk_focus ( int widget , int directionType ) { } int gtk_move_focus ( int widget , int directionType ) { } int gtk_focus_in_event ( int widget , int event ) { } int gtk_focus_out_event ( int widget , int event ) { } int gtk_map_event ( int widget , int event ) { } int gtk_size_allocate ( int widget , int allocation ) { } int gtk_unmap_event ( int widget , int event ) { } int gtk_window_state_event ( int widget , int event ) { } public void open ( ) { } public void removeShellListener ( ShellListener listener ) { } public void setActive ( ) { } void setActiveControl ( Control control ) { } void resizeBounds ( int width , int height , boolean notify ) { } boolean setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setCursor ( int cursor ) { } public void setEnabled ( boolean enabled ) { } public void setImeInputMode ( int mode ) { } void setInitialSize ( ) { } public void setMaximized ( boolean maximized ) { } public void setMenuBar ( Menu menu ) { } public void setMinimized ( boolean minimized ) { } public void setMinimumSize ( int width , int height ) { } public void setMinimumSize ( Point size ) { } public void setRegion ( Region region ) { } public void setText ( String string ) { } public void setVisible ( boolean visible ) { checkWidget ( ) ; if ( ( OS . GTK_WIDGET_MAPPED ( shellHandle ) ) == visible ) return ; if ( visible ) { sendEvent ( Show ) ; if ( isDisposed ( ) ) return ; mapped = false ; OS . gtk_widget_show ( shellHandle ) ; display . dispatchEvents = new int [ ] { OS . GDK_EXPOSE , OS . GDK_FOCUS_CHANGE , OS . GDK_CONFIGURE , OS . GDK_MAP , OS . GDK_UNMAP , OS . GDK_NO_EXPOSE } ; display . putGdkEvents ( ) ; boolean iconic = false ; Shell shell = ( ( parent ) != null ) ? parent . getShell ( ) : null ; do { <START_BUG> OS . gtk_main_iteration ( ) ; <END_BUG> if ( isDisposed ( ) ) break ; iconic = ( shell != null ) && ( shell . minimized ) ; } while ( ( ! ( mapped ) ) && ( ! iconic ) ) ; display . dispatchEvents = null ; if ( isDisposed ( ) ) return ; if ( ! iconic ) { update ( true ) ; if ( isDisposed ( ) ) return ; adjustTrim ( ) ; } mapped = true ; int mask = ( ( SWT . PRIMARY_MODAL ) | ( SWT . APPLICATION_MODAL ) ) | ( SWT . SYSTEM_MODAL ) ; if ( ( ( style ) & mask ) != 0 ) { OS . gdk_pointer_ungrab ( GDK_CURRENT_TIME ) ; } if ( ! ( moved ) ) { moved = true ; Point location = getLocation ( ) ; oldX = location . x ; oldY = location . y ; sendEvent ( Move ) ; } if ( ! ( resized ) ) { resized = true ; Point size = getSize ( ) ; oldWidth = ( size . x ) - ( trimWidth ( ) ) ; oldHeight = ( size . y ) - ( trimHeight ( ) ) ; sendEvent ( Resize ) ; if ( ( layout ) != null ) layout . layout ( this , false ) ; } } else { OS . gtk_widget_hide ( shellHandle ) ; sendEvent ( Hide ) ; } } void setZOrder ( Control sibling , boolean above ) { } int shellMapProc ( int handle , int arg0 , int user_data ) { } void showWidget ( ) { } boolean traverseEscape ( ) { } int trimHeight ( ) { } int trimWidth ( ) { }

Fix:
OS . g_main_context_iteration ( 0 , false ) ;