View Issue Details

IDProjectCategoryView StatusLast Update
0035720LazarusLCLpublic2020-05-22 11:11
Reporterchronos Assigned ToMichl  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSLinux 
Product Version2.0.2 
Fixed in Version2.0.10 
Summary0035720: First mouse event is lost in new modal form shown from MouseDown event
DescriptionThere is MouseDown handler in Form1 from which new Form2 is shown using ShowModal method. After Form2 is shown then its first MouseDown event is not captured. Second and consecutive events works ok. From user usability perspective it leads to unresponsive form for first mouse click. So user needs to click again after first click has no effect.

Under Windows it works correctly but under Linux/Gtk2 first event is not fired up. It may be limitation of Gtk2 framework but it may be problem in Gtk2 widgetset.

Usually response to click is handled by OnClick or OnMouseUp events. But in this case same functionality is required in OnMouseDown event. So workaround would be to execute ShowModal method from OnMouseUp or OnClick events. But as the behavior between Windows and Gtk2 is different then it should be better fixed. I tried to investigate this little bit but I didn't found cause of this problem.
Steps To ReproduceExtract and open attached demo. Left click on all three panels OnMouseDown, OnMouseUp and OnClick to show new modal form. In modal form click inside form area and observe captured events in text memo. Execute demo under Windows where everything works ok and under Gtk2 where first mouse click is lost in modal form if it is executed from MouseDown event handler.
TagsNo tags attached.
Fixed in Revision63203
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0035094 resolvedMichl Lazarus TSpeedButton, TStringGrid and TDBGrid do not react to left mouse click with first time 
related to 0032199 closedMichl Packages Sparta form designer component event and delete problems on gtk2 

Activities

chronos

2019-06-15 11:19

reporter  

MouseDown.zip (3,109 bytes)

chronos

2019-06-15 11:54

reporter   ~0116733

I tested that under Lazarus 1.6 and it works ok. So it was working previously. Under Lazarus 2.1.0 trunk it is also not working. So perhaps I would be able to identify which commit broke that.

chronos

2019-06-15 12:35

reporter   ~0116734

So faulty commit is rev 56053.

sembit

2019-06-15 13:30

reporter   ~0116735

Last edited: 2019-06-15 13:31

View 2 revisions

Similar problem: https://bugs.freepascal.org/view.php?id=35094

Juha Manninen

2019-06-15 18:57

developer   ~0116737

r56053 was committed 2017-10-14.
 "Sparta_DockedFormEditor: GTK2: Fixed mouse default event handler creation."

Michl

2020-05-21 23:27

developer   ~0122997

Fixed in revision 63203. Please test and close if ok.

chronos

2020-05-22 11:11

reporter   ~0123004

Working ok. Thanks.

Issue History

Date Modified Username Field Change
2019-06-15 11:19 chronos New Issue
2019-06-15 11:19 chronos File Added: MouseDown.zip
2019-06-15 11:54 chronos Note Added: 0116733
2019-06-15 12:35 chronos Note Added: 0116734
2019-06-15 13:30 sembit Note Added: 0116735
2019-06-15 13:31 sembit Note Edited: 0116735 View Revisions
2019-06-15 18:50 Juha Manninen Relationship added related to 0035094
2019-06-15 18:53 Juha Manninen Relationship added related to 0032199
2019-06-15 18:55 Juha Manninen Assigned To => Michl
2019-06-15 18:55 Juha Manninen Status new => assigned
2019-06-15 18:57 Juha Manninen Note Added: 0116737
2020-05-21 23:27 Michl Status assigned => resolved
2020-05-21 23:27 Michl Resolution open => fixed
2020-05-21 23:27 Michl Fixed in Version => 2.0.10
2020-05-21 23:27 Michl Fixed in Revision => 63203
2020-05-21 23:27 Michl LazTarget => -
2020-05-21 23:27 Michl Widgetset GTK 2 => GTK 2
2020-05-21 23:27 Michl Note Added: 0122997
2020-05-22 11:11 chronos Status resolved => closed
2020-05-22 11:11 chronos Note Added: 0123004