@@ -2634,27 +2634,32 @@ private void PerformViewPaint(Graphics g, Rectangle rect)
26342634 }
26352635 }
26362636
2637- private void UpdateRegionForMaximized ( )
2638- {
2639- if ( MdiParent == null )
2640- {
2641- // Fix for #2457 / #3012: Do not apply a clipping region when maximized.
2642- // For RTL layout mode, disable region clipping to prevent border issues (#2457).
2643- // For all maximized forms, skip region so the title bar, control box, and left/top/bottom
2644- // edges are not cut off (#3012 - controlbox and buttonspace not show full when maximized).
2645- SuspendPaint ( ) ;
2646- _regionWindowState = FormWindowState . Maximized ;
2647- UpdateBorderRegion ( null ) ;
2648- ResumePaint ( ) ;
2649- }
2650- else
2651- {
2652- // As a maximized Mdi Child we do not need any border region
2653- UpdateBorderRegion ( null ) ;
2654- }
2655- }
2656-
2657- private void UpdateBorderRegion ( Region ? newRegion )
2637+ // Fix for #3013 : This change restores the original implementation of UpdateRegionForMaximized.
2638+ private void UpdateRegionForMaximized ( )
2639+ {
2640+ if ( MdiParent == null )
2641+ {
2642+ // Get the size of each window border
2643+ Padding padding = RealWindowBorders ;
2644+
2645+ // Reduce the Bounds by the padding on all but the top
2646+ var maximizedRect = new Rectangle ( padding . Left , padding . Left , Width - padding . Horizontal ,
2647+ Height - padding . Left - padding . Bottom ) ;
2648+
2649+ // Use this as the new region
2650+ SuspendPaint ( ) ;
2651+ _regionWindowState = FormWindowState . Maximized ;
2652+ UpdateBorderRegion ( new Region ( maximizedRect ) ) ;
2653+ ResumePaint ( ) ;
2654+ }
2655+ else
2656+ {
2657+ // As a maximized Mdi Child we do not need any border region
2658+ UpdateBorderRegion ( null ) ;
2659+ }
2660+ }
2661+
2662+ private void UpdateBorderRegion ( Region ? newRegion )
26582663 {
26592664 if ( ( newRegion != null )
26602665 && ( newRegion . IsEmpty ( CreateGraphics ( ) ) )
0 commit comments