summaryrefslogtreecommitdiff
path: root/src/corelib/gdi
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index fec0c511..196e467a 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -207,6 +207,7 @@ type
TfpgGDIApplication = class(TfpgApplicationBase)
private
FDrag: TfpgGDIDrag;
+ procedure DoWakeMainThread(Sender: TObject);
procedure SetDrag(const AValue: TfpgGDIDrag);
property Drag: TfpgGDIDrag read FDrag write SetDrag;
protected
@@ -1233,6 +1234,12 @@ begin
Result.Sort;
end;
+procedure TfpgGDIApplication.DoWakeMainThread(Sender: TObject);
+begin
+ // WakeMainThread is called during TThread.Synchronize.
+ Windows.PostMessage(TfpgGDIWindow(MainForm).WinHandle, WM_NULL, 0, 0);
+end;
+
procedure TfpgGDIApplication.SetDrag(const AValue: TfpgGDIDrag);
begin
if Assigned(FDrag) then
@@ -1313,10 +1320,12 @@ begin
FIsInitialized := True;
wapplication := TfpgApplication(self);
+ WakeMainThread := @DoWakeMainThread;
end;
destructor TfpgGDIApplication.Destroy;
begin
+ WakeMainThread := nil;
if Assigned(FDrag) then
FDrag.Free;
UnhookWindowsHookEx(ActivationHook);