From 581515d8e582e3fd1bd924b76b370e0620a2cb4e Mon Sep 17 00:00:00 2001 From: Tomas Hajny Date: Tue, 3 Jul 2007 21:00:01 +0000 Subject: [PATCH] * give up timeslices while waiting in SysGetMouseEvent, compilation fix plus change of pointer conversion to unsigned git-svn-id: trunk@7937 - --- rtl/go32v2/mouse.pp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rtl/go32v2/mouse.pp b/rtl/go32v2/mouse.pp index 9952254575..cd17436dab 100644 --- a/rtl/go32v2/mouse.pp +++ b/rtl/go32v2/mouse.pp @@ -740,6 +740,8 @@ const LastCallcounter : longint = 0; procedure SysGetMouseEvent(var MouseEvent: TMouseEvent); +var + RR: TRealRegs; begin if not MousePresent then begin @@ -754,11 +756,15 @@ begin {$endif EXTMOUSEDEBUG} LastCallcounter:=Callcounter; {$endif DEBUG} - repeat until PendingMouseEvents>0; + while PendingMouseEvents = 0 do + begin +(* Give up time slices while waiting for mouse events. *) + RealIntr ($28, RR); + end; MouseEvent:=PendingMouseHead^; inc(PendingMouseHead); - if longint(PendingMouseHead)=longint(@PendingMouseEvent)+sizeof(PendingMouseEvent) then - PendingMouseHead:=@PendingMouseEvent; + if ptruint(PendingMouseHead)=ptruint(@PendingMouseEvent)+sizeof(PendingMouseEvent) then + PendingMouseHead:=PMouseEvent(@PendingMouseEvent); dec(PendingMouseEvents); if (LastMouseEvent.x<>MouseEvent.x) or (LastMouseEvent.y<>MouseEvent.y) then MouseEvent.Action:=MouseActionMove;