mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-25 22:22:43 +02:00
LCL-GTK2: Prevent flickering in TOpenGLControl. Turn DoubleBuffered off. Issue #33864, patch from accorp.
git-svn-id: trunk@59111 -
This commit is contained in:
parent
fd64c39c73
commit
2ee72166e4
@ -275,6 +275,7 @@ type
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): HWND; override;
|
||||
class procedure DestroyHandle(const AWinControl: TWinControl); override;
|
||||
class function GetDoubleBuffered(const AWinControl: TWinControl): Boolean; override;
|
||||
end;
|
||||
|
||||
|
||||
@ -723,6 +724,11 @@ begin
|
||||
TWSWinControlClass(ClassParent).DestroyHandle(AWinControl);
|
||||
end;
|
||||
|
||||
class function TWSOpenGLControl.GetDoubleBuffered(const AWinControl: TWinControl): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterWSComponent(TCustomOpenGLControl,TWSOpenGLControl);
|
||||
|
||||
|
@ -45,7 +45,7 @@ uses
|
||||
LMessages, LCLProc, LCLIntf, LCLType, GraphType, GraphMath,
|
||||
Graphics, Menus, Themes, Buttons, StdCtrls, CheckLst, ComCtrls, Spin, ExtCtrls,
|
||||
LCLPlatformDef, InterfaceBase,
|
||||
WSLCLClasses,
|
||||
WSLCLClasses, WSControls,
|
||||
Gtk2WinApiWindow, Gtk2Globals, Gtk2Proc, Gtk2Def, Gtk2FontCache, Gtk2Extra,
|
||||
Gtk2MsgQueue;
|
||||
|
||||
|
@ -138,7 +138,7 @@ begin
|
||||
else Control := nil;
|
||||
|
||||
if (Control <> nil)
|
||||
and Control.DoubleBuffered
|
||||
and TWSWinControlClass(Control.WidgetSetClass).GetDoubleBuffered(Control)
|
||||
and not GTK_WIDGET_DOUBLE_BUFFERED({%H-}PGTKWidget(Handle))
|
||||
then begin
|
||||
//DebugLn(['TGtk2WidgetSet.BeginPaint ',DbgSName(Control)]);
|
||||
@ -2837,8 +2837,10 @@ begin
|
||||
then Control := TWinControl(GetLCLObject({%H-}Pointer(Handle)))
|
||||
else Control := nil;
|
||||
|
||||
If (Control <> nil) and (not GTK_WIDGET_DOUBLE_BUFFERED(({%H-}PGTKWidget(Handle)))) and (Control.DoubleBuffered) then
|
||||
begin
|
||||
if (Control <> nil)
|
||||
and TWSWinControlClass(Control.WidgetSetClass).GetDoubleBuffered(Control)
|
||||
and not GTK_WIDGET_DOUBLE_BUFFERED({%H-}PGTKWidget(Handle))
|
||||
then begin
|
||||
gdk_window_thaw_updates(TGtkDeviceContext(PS.HDC).Drawable);
|
||||
gdk_window_end_paint (TGtkDeviceContext(PS.HDC).Drawable);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user