[Lazarus] BUG: Gtk MouseExit, MouseUp

Anthony Walter sysrpl at gmail.com
Tue Apr 7 23:15:14 CEST 2015


I can't believe this bug hasn't been reported,so I think I'll ask before
submitting a mantis report.

On Linux Gtk2 with TGraphicControl derived classes there seems to be a
problem with reliable MouseExit and MouseUp firing.

I had to write some work arounds which are still unreliable, but here's the
basic gist of the problem.

With TGraphicControl derived classes on Gtk2 sometimes MouseExit or MouseUp
do not fire.

If you mouse the mouse over a graphic control, press the left mouse button,
mouse out of the control and release the left button, the OnMouseUp event
is not invoked nor is the virtual MouseUp method.

Example:

procedure TForm1.Shape1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Tag := Tag + 1;
  Caption := IntToStr(Tag);
end;

With a TShape the MouseUp will only fire if the mouse is released while
over the control. On Windows and Macintosh this is not the standard
behavior. MouseCapture has no effect in fixing this problem. Curiously
TSpeedButton seems to have some special logic that gets around the problem
on Gtk2 which I've copied to my TGraphicControls but the problem still
exists with other graphic controls.

And then there is the MouseExit problem. It's not reliably being fired on
Gtk2 graphic controls. If you have 2 graphic controls close together or you
mouse the mouse too fast between controls one of them occasionally doesn't
receive the MouseExit. This causes issues with graphic controls which might
display different states based on whether the mouse is in them or out of
them.

Have these issues been reported before? They seem to be quite obvious and
I'm struggling to find that these problems haven't been reported or
discussed before.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150407/0a345f02/attachment-0002.html>


More information about the Lazarus mailing list