View Issue Details

IDProjectCategoryView StatusLast Update
0038345PatchesWidgetsetpublic2021-01-27 10:43
ReporterAndrzej Kilijanski Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSLinux 
Product Version2.1 (SVN) 
Summary0038345: GTK2: When open non-modal form by popup menu SpeedButtons don't work
DescriptionGTK2: When open non-modal form popup menu SpeedButtons don't work. You need click it twice to start working. I think this issue is related to https://bugs.freepascal.org/view.php?id=35094.

On Windows everything works OK. Simple patch attached (gtk2speedbuttonfix.diff).
Steps To Reproduce1. Open Form from popup menu
2. Try click Speed button

See attached example code (actiontest_spedbtn_gtk2.tar.bz2).
TagsNo tags attached.
Fixed in Revisionr64377
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 0038401 resolvedJuha Manninen Lazarus GTK2: SpeedButton freezes (need extra click) after close popup menu without choosing any popup menu item (Fix 1). 

Activities

Andrzej Kilijanski

2021-01-11 12:36

reporter  

gtk2speedbuttonfix.diff (932 bytes)   
Index: lcl/interfaces/gtk2/gtk2wsforms.pp
===================================================================
--- lcl/interfaces/gtk2/gtk2wsforms.pp	(wersja 64375)
+++ lcl/interfaces/gtk2/gtk2wsforms.pp	(kopia robocza)
@@ -741,7 +741,8 @@
   end;
 
   GtkWindow := {%H-}PGtkWindow(AForm.Handle);
-  if (fsModal in AForm.FormState) and AForm.HandleObjectShouldBeVisible then
+
+  if AForm.HandleObjectShouldBeVisible then
   begin
     LastMouse.Button := 0;
     LastMouse.ClickCount := 0;
@@ -749,6 +750,10 @@
     LastMouse.MousePos := Point(0, 0);
     LastMouse.Time := 0;
     LastMouse.WinControl := nil;
+  end;
+
+  if (fsModal in AForm.FormState) and AForm.HandleObjectShouldBeVisible then
+  begin
     gtk_window_set_default_size(GtkWindow, Max(1,AForm.Width), Max(1,AForm.Height));
     gtk_widget_set_uposition(PGtkWidget(GtkWindow), AForm.Left, AForm.Top);
     gtk_window_set_type_hint({%H-}PGtkWindow(AForm.Handle),
gtk2speedbuttonfix.diff (932 bytes)   

Juha Manninen

2021-01-11 17:39

developer   ~0128269

Applied, thanks. I could reproduce the problem and the patch fixes it. Good.
BTW, the demo has dependency to Castle engine but it was easy to remove. It was not needed for compilation.

Andrzej Kilijanski

2021-01-11 18:59

reporter   ~0128272

Sorry for that, I found this issue when working on Castle Game Engine Editor, so I tested a lot of things before I found where is the problem (and how to fix it). And I forget remove this dependency. Thanks for quick response.

Issue History

Date Modified Username Field Change
2021-01-11 12:36 Andrzej Kilijanski New Issue
2021-01-11 12:36 Andrzej Kilijanski File Added: actiontest_spedbtn_gtk2.tar.bz2
2021-01-11 12:36 Andrzej Kilijanski File Added: gtk2speedbuttonfix.diff
2021-01-11 12:45 Bart Broersma Relationship added related to 0035094
2021-01-11 17:38 Juha Manninen Assigned To => Juha Manninen
2021-01-11 17:38 Juha Manninen Status new => assigned
2021-01-11 17:39 Juha Manninen Status assigned => resolved
2021-01-11 17:39 Juha Manninen Resolution open => fixed
2021-01-11 17:39 Juha Manninen Fixed in Revision => r64377
2021-01-11 17:39 Juha Manninen LazTarget => -
2021-01-11 17:39 Juha Manninen Widgetset GTK 2 => GTK 2
2021-01-11 17:39 Juha Manninen Note Added: 0128269
2021-01-11 18:59 Andrzej Kilijanski Note Added: 0128272
2021-01-27 10:43 Juha Manninen Relationship added related to 0038401