Browse Source

+ added critical section protection for putmouseevent, just in case
* typo fixed

git-svn-id: trunk@8802 -

florian 18 years ago
parent
commit
e4fdb15e3f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      rtl/win/mouse.pp

+ 3 - 1
rtl/win/mouse.pp

@@ -78,7 +78,7 @@ procedure MouseEventHandler(var ir:INPUT_RECORD);
            begin
              LastHandlermouseEvent:=e;
 
-             { what till there is again space in the mouse event queue }
+             { wait till there is again space in the mouse event queue }
              while PendingMouseEvents>=MouseEventBufSize do
                begin
                  LeaveCriticalSection(ChangeMouseEvents);
@@ -200,6 +200,7 @@ end;
 
 procedure SysPutMouseEvent(const MouseEvent: TMouseEvent);
 begin
+  EnterCriticalSection(ChangeMouseEvents);
   if PendingMouseEvents<MouseEventBufSize then
    begin
      PendingMouseTail^:=MouseEvent;
@@ -210,6 +211,7 @@ begin
         so the win32 version do this by hand:}
        inc(PendingMouseEvents);
    end;
+  LeaveCriticalSection(ChangeMouseEvents);
 end;