Merged revision(s) 64403 #d7061ea8e8, 64414 #5ee798bb60, 64430-64431 #5a0bf2ed29-#5a0bf2ed29 from trunk:

TAChart: Fix TBarSeries drawing too thick bar border line when Margin is 0.
........
IDE: Load Desktop options correctly from environment. Issue #38376, patch from Uwe Schächterle.
........
LCL-GTK2: Fix SpeedButton freeze after closing popup menu without choosing menu item. Issue #38401, patch from Andrzej Kilijanski.
........
LCL-GTK2: Fix SpeedButton freeze after closing system popup menu without choosing menu item. Issue #38402, patch from Andrzej Kilijanski.
........

git-svn-id: branches/fixes_2_0@64614 -
This commit is contained in:
martin 2021-02-18 01:32:30 +00:00
parent 2961d09e9e
commit 240db20a1d
6 changed files with 42 additions and 17 deletions

View File

@ -1152,7 +1152,7 @@ var
TopLeft := ParentChart.GraphToImage(graphBar.a);
BottomRight := ParentChart.GraphToImage(graphBar.b);
TAGeometry.NormalizeRect(imageBar);
if IsRotated then inc(imageBar.Right) else dec(imageBar.Top);
if IsRotated then inc(imageBar.Right) else inc(imageBar.Bottom);
// Draw a line instead of an empty rectangle.
// if Bottom = Top then Dec(Top);

View File

@ -2986,10 +2986,8 @@ function TEnvironmentOptions.GetActiveDesktop: TDesktopOpt;
end;
var
OldActiveDesktop: TDesktopOpt;
OldActiveDesktopName: string;
lDskTpOpt: TCustomDesktopOpt;
OldActiveDesktop, lDskTpOpt: TCustomDesktopOpt;
begin
Result := nil;
if FActiveDesktopName <> '' then
@ -3019,8 +3017,8 @@ begin
Result.Assign(Desktop);
if Assigned(IDEDockMaster) then
Result.FDockedOpt.LoadDefaults;
OldActiveDesktop := TDesktopOpt(FDesktops.Find(OldActiveDesktopName));
if not Assigned(OldActiveDesktop) then
OldActiveDesktop := FDesktops.Find(OldActiveDesktopName);
if not (OldActiveDesktop is TDesktopOpt) then
begin
lDskTpOpt := FDesktops.Find('default');
if Assigned(lDskTpOpt) and lDskTpOpt.InheritsFrom(TDesktopOpt) and lDskTpOpt.Compatible then
@ -3029,7 +3027,7 @@ begin
OldActiveDesktop := nil;
end;
if Assigned(OldActiveDesktop) then
Result.Assign(OldActiveDesktop, False, False);
Result.Assign(TDesktopOpt(OldActiveDesktop), False, False);
end;
procedure TEnvironmentOptions.SetTestBuildDirectory(const AValue: string);

View File

@ -108,6 +108,9 @@ begin
SignalConnect(AWidgetInfo^.CoreWidget, 'cut-clipboard', @Gtk2WS_MemoCutToClip, AWidgetInfo);
SignalConnect(AWidgetInfo^.CoreWidget, 'copy-clipboard', @Gtk2WS_MemoCopyToClip, AWidgetInfo);
SignalConnect(AWidgetInfo^.CoreWidget, 'paste-clipboard', @Gtk2WS_MemoPasteFromClip, AWidgetInfo);
g_signal_connect_after(PGtkObject(AWidgetInfo^.CoreWidget), 'populate-popup',
gtk_signal_func(@gtkDefaultPopupMenuCloseFix), AWidgetInfo);
end;
class function TGtk2WSCustomMemo.CreateHandle(const AWinControl: TWinControl;

View File

@ -736,16 +736,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

@ -610,7 +610,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;

View File

@ -410,6 +410,25 @@ begin
Result := nil;
end;
procedure gtkDefaultPopupMenuDeactivate(Widget: PGtkWidget; data: gPointer); cdecl;
begin
LastMouse.Button := 0;
LastMouse.ClickCount := 0;
LastMouse.Down := False;
LastMouse.MousePos := Point(0, 0);
LastMouse.Time := 0;
LastMouse.WinControl := nil;
end;
function gtkDefaultPopupMenuCloseFix(Widget: PGtkWidget; Menu: PGtkMenu;
data: gPointer): gboolean; cdecl;
begin
// needed because closing popup menu without clicking on any menu item
// freezes various controls, eg SpeedButton
g_signal_connect(PGtkObject(Menu), 'deactivate',
gtk_signal_func(@gtkDefaultPopupMenuDeactivate), nil);
end;
{$I gtk2memostrings.inc}
{ TGtk2WSCustomListBox }
@ -1067,6 +1086,9 @@ begin
SetCallback(LM_COPY, PGtkObject(AGtkWidget), AWidgetInfo^.LCLObject);
SetCallback(LM_PASTE, PGtkObject(AGtkWidget), AWidgetInfo^.LCLObject);
end;
g_signal_connect_after(PGtkObject(AGtkWidget), 'populate-popup',
gtk_signal_func(@gtkDefaultPopupMenuCloseFix), AWidgetInfo);
end;
class procedure TGtk2WSCustomEdit.GetPreferredSize(const AWinControl: TWinControl;
@ -1796,6 +1818,9 @@ begin
g_signal_connect_after(AMenu, 'selection-done', G_CALLBACK(@GtkPopupHideCB), AWidgetInfo);
end;
g_signal_connect_after(PGtkObject(GTK_BIN(ComboWidget)^.child), 'populate-popup',
gtk_signal_func(@gtkDefaultPopupMenuCloseFix), AWidgetInfo);
if (gtk_major_version >= 2) and (gtk_minor_version >= 10) then
g_signal_connect(ComboWidget, 'notify', TGCallback(@GtkNotifyCB), AWidgetInfo);