Browse Source

* (slightly modified) patch by Laaca originally for GO32v2 - avoid disappearing mouse cursor in full screen sessions

git-svn-id: trunk@10591 -
Tomas Hajny 17 years ago
parent
commit
ed914574e2
2 changed files with 16 additions and 4 deletions
  1. 7 1
      rtl/os2/mouse.pp
  2. 9 3
      rtl/os2/video.pp

+ 7 - 1
rtl/os2/mouse.pp

@@ -3,7 +3,7 @@
     Copyright (c) 1999-2000 by Florian Klaempfl
     Copyright (c) 1999-2000 by Florian Klaempfl
     member of the Free Pascal development team
     member of the Free Pascal development team
 
 
-    Mouse unit for linux
+    Mouse unit for OS/2
 
 
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
@@ -18,6 +18,9 @@ interface
 
 
 {$i mouseh.inc}
 {$i mouseh.inc}
 
 
+const
+  MouseIsVisible: boolean = false;
+
 implementation
 implementation
 
 
 uses
 uses
@@ -68,6 +71,7 @@ begin
 *)
 *)
 
 
   MouDrawPtr (Handle);
   MouDrawPtr (Handle);
+  MouseIsVisible := true;
  end;
  end;
 end;
 end;
 
 
@@ -115,6 +119,7 @@ begin
   begin
   begin
    Dec (HideCounter);
    Dec (HideCounter);
    if HideCounter = 0 then MouDrawPtr (Handle);
    if HideCounter = 0 then MouDrawPtr (Handle);
+   MouseIsVisible := true;
   end;
   end;
  end;
  end;
 end;
 end;
@@ -134,6 +139,7 @@ begin
        PtrRect.cRow := Pred (ScreenHeight);
        PtrRect.cRow := Pred (ScreenHeight);
        PtrRect.cCol := Pred (ScreenWidth);
        PtrRect.cCol := Pred (ScreenWidth);
        MouRemovePtr (PtrRect, Handle);
        MouRemovePtr (PtrRect, Handle);
+       MouseIsVisible := false;
       end;
       end;
   end;
   end;
  end;
  end;

+ 9 - 3
rtl/os2/video.pp

@@ -22,7 +22,7 @@ interface
 implementation
 implementation
 
 
 uses
 uses
-  DosCalls, VioCalls;
+  DosCalls, VioCalls, Mouse;
 
 
 {$i video.inc}
 {$i video.inc}
 
 
@@ -352,6 +352,7 @@ end;
 procedure SysUpdateScreen (Force: boolean);
 procedure SysUpdateScreen (Force: boolean);
 
 
 var SOfs, CLen: cardinal;
 var SOfs, CLen: cardinal;
+    Mouse_Visible: boolean;
 
 
 begin
 begin
   if not (Force) then
   if not (Force) then
@@ -407,9 +408,14 @@ begin
   Move(VideoBuf^,SysVideoBuf^,VideoBufSize);
   Move(VideoBuf^,SysVideoBuf^,VideoBufSize);
   if Force then
   if Force then
     begin
     begin
-    VioShowBuf (SOfs, CLen, 0);
-    Move (VideoBuf^ [SOfs div SizeOf (TVideoCell)],
+      Mouse_Visible := MouseIsVisible; {MouseIsVisible is from Mouse unit}
+      if Mouse_Visible then
+        HideMouse;
+      VioShowBuf (SOfs, CLen, 0);
+      Move (VideoBuf^ [SOfs div SizeOf (TVideoCell)],
           OldVideoBuf^ [SOfs div SizeOf (TVideoCell)], CLen);
           OldVideoBuf^ [SOfs div SizeOf (TVideoCell)], CLen);
+      if Mouse_Visible then
+        ShowMouse;
     end;
     end;
 end;
 end;