LCL-GTK2: Fix SpeedButton freeze after closing popup menu without choosing menu item. Issue #38401, patch from Andrzej Kilijanski.

git-svn-id: trunk@64430 -
This commit is contained in:
juha 2021-01-28 08:19:10 +00:00
parent 1e99ef0453
commit 5a0bf2ed29
2 changed files with 9 additions and 10 deletions

View File

@ -742,16 +742,6 @@ begin
GtkWindow := {%H-}PGtkWindow(AForm.Handle);
if AForm.HandleObjectShouldBeVisible then
begin
LastMouse.Button := 0;
LastMouse.ClickCount := 0;
LastMouse.Down := False;
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));

View File

@ -612,7 +612,16 @@ var
begin
Result := False;
if PopupMenu is TPopupMenu then
begin
PopupMenu.Close;
// Fix freezing some controls (eg SpeedButton) when close PopupMenu
LastMouse.Button := 0;
LastMouse.ClickCount := 0;
LastMouse.Down := False;
LastMouse.MousePos := Point(0, 0);
LastMouse.Time := 0;
LastMouse.WinControl := nil;
end;
end;
procedure gtkWSPopupMenuDeactivate(widget: PGtkWidget; data: gPointer); cdecl;