Changeset 228


Ignore:
Timestamp:
May 14, 2020, 9:35:35 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Use custom Linux HitTest replacement only if OnMouseDown is not handled by client.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r222 r228  
    127127  inherited;
    128128  {$IFDEF LINUX}
    129   // HitTest is not supported under Linux GTK2 so use form inside move mechanizm
    130   NewFormPos := ScreenToClient(Mouse.CursorPos);
    131   if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and
    132     (NewFormPos.Y >= 0) and (NewFormPos.Y < Height) then begin
    133     MoveMousePos := ClientToScreen(Point(X, Y));
    134     MoveFormPos := Point(Left, Top);
    135     MousePosNew := Mouse.CursorPos;
    136     // Activate move only if mouse position was not changed during inherited call
    137     if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin
    138       MoveActive := True;
    139     end;
    140   end else MoveActive := False;
     129  if not Assigned(OnMouseDown) then begin
     130    // HitTest is not supported under Linux GTK2 so use form inside move mechanizm
     131    NewFormPos := ScreenToClient(Mouse.CursorPos);
     132    if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and
     133      (NewFormPos.Y >= 0) and (NewFormPos.Y < Height) then begin
     134      MoveMousePos := ClientToScreen(Point(X, Y));
     135      MoveFormPos := Point(Left, Top);
     136      MousePosNew := Mouse.CursorPos;
     137      // Activate move only if mouse position was not changed during inherited call
     138      if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin
     139        MoveActive := True;
     140      end;
     141    end else MoveActive := False;
     142  end;
    141143  {$ENDIF}
    142144end;
Note: See TracChangeset for help on using the changeset viewer.