From 1180fb81d990408decf4d74cac18fd495ba0667d Mon Sep 17 00:00:00 2001
From: Robert Roebling <robert@roebling.de>
Date: Mon, 11 Feb 2002 22:14:34 +0000
Subject: [PATCH]   Found the X11 error in wxDC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/x11/dcclient.cpp | 15 +++++++++------
 src/x11/window.cpp   |  9 +++++----
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp
index 44b06b29b7..f367f145fe 100644
--- a/src/x11/dcclient.cpp
+++ b/src/x11/dcclient.cpp
@@ -290,13 +290,16 @@ void wxWindowDC::SetUpDC()
 
     if (!hatch_bitmap)
     {
+        int xscreen = DefaultScreen( (Display*) m_display );
+        Window xroot = RootWindow( (Display*) m_display, xscreen );
+    
         hatch_bitmap    = hatches;
-        hatch_bitmap[0] = XCreateBitmapFromData( (Display*) m_display, None, bdiag_bits, bdiag_width, bdiag_height );
-        hatch_bitmap[1] = XCreateBitmapFromData( (Display*) m_display, None, cdiag_bits, cdiag_width, cdiag_height );
-        hatch_bitmap[2] = XCreateBitmapFromData( (Display*) m_display, None, fdiag_bits, fdiag_width, fdiag_height );
-        hatch_bitmap[3] = XCreateBitmapFromData( (Display*) m_display, None, cross_bits, cross_width, cross_height );
-        hatch_bitmap[4] = XCreateBitmapFromData( (Display*) m_display, None, horiz_bits, horiz_width, horiz_height );
-        hatch_bitmap[5] = XCreateBitmapFromData( (Display*) m_display, None, verti_bits, verti_width, verti_height );
+        hatch_bitmap[0] = XCreateBitmapFromData( (Display*) m_display, xroot, bdiag_bits, bdiag_width, bdiag_height );
+        hatch_bitmap[1] = XCreateBitmapFromData( (Display*) m_display, xroot, cdiag_bits, cdiag_width, cdiag_height );
+        hatch_bitmap[2] = XCreateBitmapFromData( (Display*) m_display, xroot, fdiag_bits, fdiag_width, fdiag_height );
+        hatch_bitmap[3] = XCreateBitmapFromData( (Display*) m_display, xroot, cross_bits, cross_width, cross_height );
+        hatch_bitmap[4] = XCreateBitmapFromData( (Display*) m_display, xroot, horiz_bits, horiz_width, horiz_height );
+        hatch_bitmap[5] = XCreateBitmapFromData( (Display*) m_display, xroot, verti_bits, verti_width, verti_height );
     }
 }
 
diff --git a/src/x11/window.cpp b/src/x11/window.cpp
index 17509fdf3b..da1a164a6d 100644
--- a/src/x11/window.cpp
+++ b/src/x11/window.cpp
@@ -966,16 +966,17 @@ void wxWindowX11::X11SendPaintEvents()
             wxRegionIterator upd( m_clearRegion );
             while (upd)
             {
-                // XClearArea( ... , upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
+                XClearArea( wxGlobalDisplay(), (Window) m_mainWidget, 
+                            upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight(), False );
                 upd ++;
             }
         }
         m_clearRegion.Clear();
     }
 
-    // wxNcPaintEvent nc_paint_event( GetId() );
-    // nc_paint_event.SetEventObject( this );
-    // GetEventHandler()->ProcessEvent( nc_paint_event );
+    wxNcPaintEvent nc_paint_event( GetId() );
+    nc_paint_event.SetEventObject( this );
+    GetEventHandler()->ProcessEvent( nc_paint_event );
 
     wxPaintEvent paint_event( GetId() );
     paint_event.SetEventObject( this );
-- 
2.47.2