mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 07:58:07 +02:00
gtk2 intf: enabled direct drawing, because it has working event area and double buffering
git-svn-id: trunk@9507 -
This commit is contained in:
parent
8027a9738d
commit
125ffee4cb
@ -3375,7 +3375,6 @@ var
|
||||
DlgResult: TModalResult;
|
||||
begin
|
||||
DlgResult:=ShowConfigureBuildLazarusDlg(MiscellaneousOptions.BuildLazOpts);
|
||||
DebugLn(['TMainIDE.mnuToolConfigBuildLazClicked ',DlgResult]);
|
||||
if DlgResult in [mrOk,mrYes] then begin
|
||||
MiscellaneousOptions.Save;
|
||||
LazSrcTemplate:=CodeToolBoss.DefineTree.FindDefineTemplateByName(
|
||||
|
@ -67,6 +67,10 @@ end;
|
||||
|
||||
function DeliverGtkPaintMessage(Target: Pointer; Widget: PGtkWidget;
|
||||
Area: PGDKRectangle; RepaintAll: boolean): GBoolean;
|
||||
{$IFDEF Gtk2}
|
||||
// the gtk2 has a working double buffering and expose event area
|
||||
{$DEFINE DirectPaintMsg}
|
||||
{$ENDIF}
|
||||
var
|
||||
MSG: TLMGtkPaint;
|
||||
{$IFDEF DirectPaintMsg}
|
||||
@ -462,6 +466,8 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
//DebugLn(['gtkExposeEventAfter ',GetWidgetDebugReport(Widget),' ',dbgGRect(@Event^.Area)]);
|
||||
|
||||
// the expose area is ok, but some gtk widgets repaints everything on expose
|
||||
// -> maximize the area
|
||||
DeliverGtkPaintMessage(Data,Widget,@Event^.Area,true);
|
||||
|
@ -381,7 +381,7 @@ begin
|
||||
Widget:=GetStyleWidget(lgsVScale);
|
||||
MinWidth:=Widget^.requisition.width;
|
||||
end;
|
||||
DebugLn(['TGtkWidgetSet.GetControlConstraints ',DbgSName(SizeConstraints.Control),' ',MinWidth,',',MinHeight]);
|
||||
//DebugLn(['TGtkWidgetSet.GetControlConstraints ',DbgSName(SizeConstraints.Control),' ',MinWidth,',',MinHeight]);
|
||||
end;
|
||||
|
||||
SizeConstraints.SetInterfaceConstraints(MinWidth,MinHeight,
|
||||
|
@ -519,6 +519,16 @@ begin
|
||||
{$EndIf}
|
||||
end;
|
||||
|
||||
function dbgGRect(const ARect: PGDKRectangle): string;
|
||||
begin
|
||||
if ARect=nil then begin
|
||||
Result:='nil';
|
||||
end else begin
|
||||
Result:='x='+dbgs(ARect^.x)+',y='+dbgs(ARect^.y)
|
||||
+',w='+dbgs(ARect^.width)+',h='+dbgs(ARect^.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
procedure RaiseException(const Msg: string);
|
||||
|
@ -355,6 +355,7 @@ function GdkColorToStr(Color: PGDKColor): string;
|
||||
function GetWidgetStyleReport(Widget: PGtkWidget): string;
|
||||
procedure BeginGDKErrorTrap;
|
||||
procedure EndGDKErrorTrap;
|
||||
function dbgGRect(const ARect: PGDKRectangle): string; overload;
|
||||
|
||||
|
||||
// gtk resources
|
||||
|
@ -35,6 +35,9 @@
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<SearchPaths>
|
||||
<LCLWidgetType Value="gtk2"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
|
Loading…
Reference in New Issue
Block a user