gtk: all custom controls need EraseBackground (not only those who don't have csOpaque) (fixes #0013224)

git-svn-id: trunk@18825 -
This commit is contained in:
paul 2009-02-26 02:07:07 +00:00
parent 8c52991db1
commit 9d9c9448c5

View File

@ -30,17 +30,15 @@
function DoDeliverPaintMessage(const Target: TObject; var PaintMsg: TLMPaint): PtrInt; function DoDeliverPaintMessage(const Target: TObject; var PaintMsg: TLMPaint): PtrInt;
begin begin
{ {
erase backgound of not csOpaque custom controls erase backgound of custom controls
use only for real custom controls for gtk1 - that are GTKAPIWidget use only for real custom controls for gtk1 - that are GTKAPIWidget
} }
if (TObject(Target) is TCustomControl) and if (TObject(Target) is TCustomControl)
{$ifdef gtk1} {$ifdef gtk1}
GtkWidgetIsA(PGtkWidget(TCustomControl(Target).Handle), GTKAPIWidget_Type) and and GtkWidgetIsA(PGtkWidget(TCustomControl(Target).Handle), GTKAPIWidget_Type)
{$endif} {$endif}
not (csOpaque in TWinControl(Target).ControlStyle) then then begin
begin
//DebugLn('LM_ERASEBKGND for: ', dbgsName(TCustomControl(Target))); //DebugLn('LM_ERASEBKGND for: ', dbgsName(TCustomControl(Target)));
Include(TWinControlAccess(Target).FWinControlFlags, wcfEraseBackground); Include(TWinControlAccess(Target).FWinControlFlags, wcfEraseBackground);
TWinControl(Target).Perform(LM_ERASEBKGND, PaintMsg.DC, 0); TWinControl(Target).Perform(LM_ERASEBKGND, PaintMsg.DC, 0);