Control: tag -1 unreproducible On Sat, Aug 10, 2019 at 04:51:08PM +0200, Gunter Königsmann wrote: > If a draw context is used and wxWidgets 3.0 (3.1 isn't affected, but > isn't packaged with debian as it is the development version) uses GTK3 > the background is likely not to be cleared before a redraw as > wxDC::Clear() doesn't work under these circumstances.
I tried to reproduce your bug by patching the drawing sample in the wx source code using the attached patch, but it seems to work fine for me. If you cd to the drawing subdirectory and run: make -f makefile.unx WX_PORT=gtk3 Then double-check that it's linked to the GTK3 version: ldd drawing|grep libwx_gtk And then run it: ./drawing This prints "Clear()" to the console (so we are running the patched code) but the window doesn't have a hatching on the background. If you remove the dc.Clear() just after where I've patched and rerun the make command above then the window has hatching over it. So clearly wxDC::Clear() is working in this case. So I'm afraid I don't seem to be able to reproduce your problem. Please can you come up with a small reproducer (upstream like a patch against one of their samples) and file a bug upstream? Cheers, Olly
diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index b0715c08..3149ca13 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -1574,6 +1574,13 @@ void MyCanvas::Draw(wxDC& pdc) if ( m_clip ) dc.SetClippingRegion(100, 100, 100, 100); + { + dc.SetPen(*wxBLACK_PEN); + for ( int i = 0; i < 400; i++ ) + dc.DrawLine(i*5, 0, 0, i*5); + } + + printf("Clear()\n"); dc.Clear(); if ( m_owner->m_textureBackground )