Gtk2: create FDrawable on demand, only when FDrawable is nil and widget unmapped yet (usually happens only for TCustomForm). issue #27821

git-svn-id: trunk@48697 -
This commit is contained in:
zeljko 2015-04-10 12:05:48 +00:00
parent 23b4170169
commit 894fe3d7d4

View File

@ -527,7 +527,7 @@ begin
FWidget := AWidget;
FPixbuf := nil;
if (AWidget = nil) or not GTK_WIDGET_MAPPED(AWidget) then
if (AWidget = nil) then
begin
// screen: ToDo: multiple desktops
FDrawable := gdk_screen_get_root_window(gdk_screen_get_default);
@ -573,6 +573,8 @@ begin
FDrawable := AWindow;
// GC is created on demand
if (FDrawable = nil) and not GTK_WIDGET_MAPPED(AWidget) then
FDrawable := gdk_screen_get_root_window(gdk_screen_get_default);
end;
end;