Ignore:
Timestamp:
Nov 4, 2021, 4:26:28 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Mouse window move simulation under Linux was not reliable due to incorrect check for mouse coordinates change.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/DrawDlg.pas

    r412 r413  
    128128procedure TDrawDlg.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
    129129  Y: Integer);
     130var
     131  MousePos1: TPoint;
     132  MousePos2: TPoint;
    130133{$IFDEF LINUX}
    131 var
    132134  MousePosNew: TPoint;
    133135  NewFormPos: TPoint;
    134136{$ENDIF}
    135137begin
    136   inherited;
     138  MousePos1 := DpiMouse.CursorPos;
     139  inherited;
     140  MousePos2 := DpiMouse.CursorPos;
    137141  {$IFDEF LINUX}
    138142  // Only if client is not doing own mouse move handling
     
    147151      MousePosNew := DpiMouse.CursorPos;
    148152      // Activate move only if mouse position was not changed during inherited call
    149       if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin
     153      if (MousePos1.X = MousePos2.X) and (MousePos1.Y = MousePos2.Y) then begin
    150154        MoveActive := True;
    151155      end;
     
    193197  {$IFDEF LCLGTK2}
    194198  // GTK2 bug workaround https://bugs.freepascal.org/view.php?id=35720
    195   if Visible then LastMouse.WinControl := Self;
     199  if Visible then LastMouse.WinControl := Self.GetNativeForm;
    196200  {$ENDIF}
    197201end;
Note: See TracChangeset for help on using the changeset viewer.