Changeset 413 for trunk/Packages


Ignore:
Timestamp:
Nov 4, 2021, 4:26:28 PM (3 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
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r408 r413  
    102102  else
    103103  begin
    104     Pos := Point(Integer(Msg.LParam and $ffff),
    105       Integer((Msg.LParam shr 16) and $ffff));
     104    Pos := Point(ScaleFromNative(Integer(Msg.LParam and $ffff)),
     105      ScaleFromNative(Integer((Msg.LParam shr 16) and $ffff)));
    106106    if Pos.Y >= Top + TitleHeight then
    107107      Msg.Result := HTCLIENT
     
    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 := Mouse.CursorPos;
     139  inherited;
     140  MousePos2 := Mouse.CursorPos;
    137141  {$IFDEF LINUX}
    138142  // Only if client is not doing own mouse move handling
     
    147151      MousePosNew := Mouse.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;
Note: See TracChangeset for help on using the changeset viewer.