Browse Source

lcl: fixed demo and queue

mattias 1 năm trước cách đây
mục cha
commit
103015eeb5

+ 1 - 1
demo/LCLButton/FreBtnForm.pas

@@ -11,7 +11,7 @@ interface
 
 uses
   Classes, SysUtils, Fresnel.Forms, Fresnel.Controls, Fresnel.Events,
-  FCL.Events, LazLoggerBase;
+  FCL.Events, LazLogger;
 
 type
 

+ 0 - 5
demo/LCLButton/LCLButton.lpi

@@ -68,11 +68,6 @@
         </Win32>
       </Options>
     </Linking>
-    <Other>
-      <ConfigFile>
-        <WriteConfigFilePath Value=""/>
-      </ConfigFile>
-    </Other>
   </CompilerOptions>
   <Debugging>
     <Exceptions>

+ 2 - 1
src/base/fresnel.events.pas

@@ -103,7 +103,6 @@ Const
   mbFifth = mbExtra2;
 
 Type
-  { TFresnelMouseEvent }
 
   { TFresnelMouseEventInit }
 
@@ -117,6 +116,8 @@ Type
     Function Description : String;
   end;
 
+  { TFresnelMouseEvent }
+
   TFresnelMouseEvent = Class(TFresnelUIEvent)
   private
     FInit : TFresnelMouseEventInit;

+ 7 - 5
src/lcl/fresnel.lclapp.pas

@@ -39,7 +39,9 @@ end;
 
 procedure TFresnelLCLApplication.OnLCLQueue(Data: PtrInt);
 begin
-  LCLQueued:=false;
+  EnterCriticalSection(FCritSecQueue);
+  FLCLQueued:=false;
+  LeaveCriticalSection(FCritSecQueue);
   if Data=0 then ;
   ProcessMessages;
 end;
@@ -50,13 +52,13 @@ begin
   try
     if FLCLQueued=AValue then Exit;
     FLCLQueued:=AValue;
-    if AValue then
-      Forms.Application.QueueAsyncCall(@OnLCLQueue,0)
-    else
-      Forms.Application.RemoveAsyncCalls(Self);
   finally
     LeaveCriticalSection(FCritSecQueue);
   end;
+  if AValue then
+    Forms.Application.QueueAsyncCall(@OnLCLQueue,0)
+  else
+    Forms.Application.RemoveAsyncCalls(Self);
 end;
 
 constructor TFresnelLCLApplication.Create(AOwner: TComponent);