Buggy code:
String toolTipText ( NMTTDISPINFO hdr ) { } boolean translateMnemonic ( Event event , Control control ) { } boolean translateTraversal ( MSG msg ) { } void updateBackgroundColor ( ) { } void updateBackgroundImage ( ) { } void updateBackgroundMode ( ) { } void updateFont ( Font oldFont , Font newFont ) { } void updateLayout ( boolean resize , boolean all ) { } int widgetStyle ( ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_GETFONT ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_NCPAINT ( int wParam , int lParam ) { } LRESULT WM_PARENTNOTIFY ( int wParam , int lParam ) { } LRESULT WM_PAINT ( int wParam , int lParam ) { if ( ( ( state ) & ( CANVAS ) ) == 0 ) { return super . WM_PAINT ( wParam , lParam ) ; } int oldBits = 0 ; int newBits = 0 ; if ( ! ( OS . IsWinCE ) ) { oldBits = OS . GetWindowLong ( handle , GWL_STYLE ) ; newBits = ( oldBits | ( OS . WS_CLIPSIBLINGS ) ) | ( OS . WS_CLIPCHILDREN ) ; if ( newBits != oldBits ) OS . SetWindowLong ( handle , GWL_STYLE , newBits ) ; } PAINTSTRUCT ps = new PAINTSTRUCT ( ) ; if ( hooks ( Paint ) ) { GCData data = new GCData ( ) ; data . ps = ps ; data . hwnd = handle ; GC gc = GC . win32_new ( this , data ) ; int sysRgn = 0 ; if ( ( ( style ) & ( ( SWT . NO_MERGE_PAINTS ) | ( SWT . DOUBLE_BUFFERED ) ) ) != 0 ) { sysRgn = OS . CreateRectRgn ( 0 , 0 , 0 , 0 ) ; if ( ( OS . GetRandomRgn ( gc . handle , sysRgn , SYSRGN ) ) == 1 ) { if ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 4 , 10 ) ) ) { if ( ( ( OS . GetLayout ( gc . handle ) ) & ( OS . LAYOUT_RTL ) ) != 0 ) { int nBytes = OS . GetRegionData ( sysRgn , 0 , null ) ; int [ ] lpRgnData = new int [ nBytes // 4 ] ; OS . GetRegionData ( sysRgn , nBytes , lpRgnData ) ; int newSysRgn = OS . ExtCreateRegion ( new float [ ] { - 1 , 0 , 0 , 1 , 0 , 0 } , nBytes , lpRgnData ) ; OS . DeleteObject ( sysRgn ) ; sysRgn = newSysRgn ; } } if ( OS . IsWinNT ) { POINT pt = new POINT ( ) ; OS . MapWindowPoints ( 0 , handle , pt , 1 ) ; OS . OffsetRgn ( sysRgn , pt . x , pt . y ) ; } } } int width = ( ps . right ) - ( ps . left ) ; int height = ( ps . bottom ) - ( ps . top ) ; if ( ( width != 0 ) && ( height != 0 ) ) { GC paintGC = null ; Image image = null ; if ( ( ( style ) & ( SWT . DOUBLE_BUFFERED ) ) != 0 ) { image = new Image ( display , width , height ) ; paintGC = gc ; <START_BUG> gc = new GC ( image , ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) ) ; <END_BUG> gc . setForeground ( getForeground ( ) ) ; gc . setBackground ( getBackground ( ) ) ; gc . setFont ( getFont ( ) ) ; OS . OffsetRgn ( sysRgn , ( - ( ps . left ) ) , ( - ( ps . top ) ) ) ; OS . SelectClipRgn ( gc . handle , sysRgn ) ; OS . OffsetRgn ( sysRgn , ps . left , ps . top ) ; OS . SetMetaRgn ( gc . handle ) ; OS . SetWindowOrgEx ( gc . handle , ps . left , ps . top , null ) ; OS . SetBrushOrgEx ( gc . handle , ps . left , ps . top , null ) ; if ( ( ( style ) & ( SWT . NO_BACKGROUND ) ) != 0 ) { } else { RECT rect = new RECT ( ) ; OS . SetRect ( rect , ps . left , ps . top , ps . right , ps . bottom ) ; drawBackground ( gc . handle , rect ) ; } } Event event = new Event ( ) ; event . gc = gc ; RECT rect = null ; if ( ( ( ( style ) & ( SWT . NO_MERGE_PAINTS ) ) != 0 ) && ( ( OS . GetRgnBox ( sysRgn , ( rect = new RECT ( ) ) ) ) == ( OS . COMPLEXREGION ) ) ) { int nBytes = OS . GetRegionData ( sysRgn , 0 , null ) ; int [ ] lpRgnData = new int [ nBytes // 4 ] ; OS . GetRegionData ( sysRgn , nBytes , lpRgnData ) ; int count = lpRgnData [ 2 ] ; for ( int i = 0 ; i < count ; i ++ ) { int offset = 8 + ( i << 2 ) ; OS . SetRect ( rect , lpRgnData [ offset ] , lpRgnData [ ( offset + 1 ) ] , lpRgnData [ ( offset + 2 ) ] , lpRgnData [ ( offset + 3 ) ] ) ;

Fix:
gc = new GC ( image , ( ( paintGC . getStyle ( ) ) & ( SWT . RIGHT_TO_LEFT ) ) ) ;