瀏覽代碼

Merged revisions 10590-10591 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r10590 | hajny | 2008-03-30 12:31:48 -0700 (ne, 30 III 2008) | 1 line

* (slightly modified) patch by Laaca - avoid disappearing mouse cursor
........
r10591 | hajny | 2008-03-30 13:51:48 -0700 (ne, 30 III 2008) | 1 line

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

git-svn-id: branches/fixes_2_2@10675 -

Tomas Hajny 17 年之前
父節點
當前提交
f0986c2413
共有 4 個文件被更改,包括 28 次插入5 次删除
  1. 5 1
      rtl/go32v2/mouse.pp
  2. 7 0
      rtl/go32v2/video.pp
  3. 7 1
      rtl/os2/mouse.pp
  4. 9 3
      rtl/os2/video.pp

+ 5 - 1
rtl/go32v2/mouse.pp

@@ -21,6 +21,9 @@ interface
 { tells the mouse unit to draw the mouse cursor itself }
 procedure DoCustomMouse(b : boolean);
 
+const
+  MouseIsVisible: boolean = false;
+
 
 implementation
 
@@ -55,7 +58,6 @@ const
   CallCounter  : longint = 0;
 {$endif DEBUG}
   drawmousecursor : boolean = false;
-  mouseisvisible : boolean = false;
   { position where the mouse was drawn the last time }
   oldmousex : longint = -1;
   oldmousey : longint = -1;
@@ -586,6 +588,7 @@ begin
              popl    %ebp
      .LShowMouseExit:
      end;
+  MouseIsVisible := true;
 end;
 
 
@@ -615,6 +618,7 @@ begin
              popl    %ebp
      .LHideMouseExit:
      end;
+  MouseIsVisible := false;
 end;
 
 

+ 7 - 0
rtl/go32v2/video.pp

@@ -194,7 +194,12 @@ begin
 end;
 
 procedure SysUpdateScreen(Force: Boolean);
+var
+  Is_Mouse_Vis: boolean;
 begin
+  Is_Mouse_Vis := MouseIsVisible;     {MouseIsVisible is from Mouse unit}
+  if Is_Mouse_Vis then
+   HideMouse;
   if not force then
    begin
      asm
@@ -216,6 +221,8 @@ begin
      dosmemput(videoseg,0,videobuf^,VideoBufSize);
      move(videobuf^,oldvideobuf^,VideoBufSize);
    end;
+  if Is_Mouse_Vis then
+   ShowMouse;
 end;
 
 Procedure DoSetVideoMode(Params: Longint);

+ 7 - 1
rtl/os2/mouse.pp

@@ -3,7 +3,7 @@
     Copyright (c) 1999-2000 by Florian Klaempfl
     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,
     for details about the copyright.
@@ -18,6 +18,9 @@ interface
 
 {$i mouseh.inc}
 
+const
+  MouseIsVisible: boolean = false;
+
 implementation
 
 uses
@@ -68,6 +71,7 @@ begin
 *)
 
   MouDrawPtr (Handle);
+  MouseIsVisible := true;
  end;
 end;
 
@@ -115,6 +119,7 @@ begin
   begin
    Dec (HideCounter);
    if HideCounter = 0 then MouDrawPtr (Handle);
+   MouseIsVisible := true;
   end;
  end;
 end;
@@ -134,6 +139,7 @@ begin
        PtrRect.cRow := Pred (ScreenHeight);
        PtrRect.cCol := Pred (ScreenWidth);
        MouRemovePtr (PtrRect, Handle);
+       MouseIsVisible := false;
       end;
   end;
  end;

+ 9 - 3
rtl/os2/video.pp

@@ -22,7 +22,7 @@ interface
 implementation
 
 uses
-  DosCalls, VioCalls;
+  DosCalls, VioCalls, Mouse;
 
 {$i video.inc}
 
@@ -352,6 +352,7 @@ end;
 procedure SysUpdateScreen (Force: boolean);
 
 var SOfs, CLen: cardinal;
+    Mouse_Visible: boolean;
 
 begin
   if not (Force) then
@@ -407,9 +408,14 @@ begin
   Move(VideoBuf^,SysVideoBuf^,VideoBufSize);
   if Force then
     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);
+      if Mouse_Visible then
+        ShowMouse;
     end;
 end;