diff --git a/components/opengl/openglcontext.pas b/components/opengl/openglcontext.pas index 0a0b937bfa..e22a4de820 100644 --- a/components/opengl/openglcontext.pas +++ b/components/opengl/openglcontext.pas @@ -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); diff --git a/lcl/interfaces/gtk2/gtk2int.pas b/lcl/interfaces/gtk2/gtk2int.pas index 6b1e3dce58..10134a92c1 100644 --- a/lcl/interfaces/gtk2/gtk2int.pas +++ b/lcl/interfaces/gtk2/gtk2int.pas @@ -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; diff --git a/lcl/interfaces/gtk2/gtk2winapi.inc b/lcl/interfaces/gtk2/gtk2winapi.inc index 28a392415d..23cd57c25d 100644 --- a/lcl/interfaces/gtk2/gtk2winapi.inc +++ b/lcl/interfaces/gtk2/gtk2winapi.inc @@ -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;