Merged revision(s) 61064 #09945b4668, 61113 #a897a24acc, 61223 #298236df33, 61621 #1dec469350, 61624 #b915700854 from trunk:

LCL: Use "try finally" block for function DefaultInputDialog. Issue , patch from Serge Anvarov.
........
LCL-Win32: Add support for ofForceShowHidden flag in dialog options. Issue , patch from Serge Anvarov.
........
Patch from jmpessoa for IDE crash when closing some forms (highly visible for LAMW)
........
LCL-GTK2: Use libappindicator3 for System Tray Icon. Issue , patch from David.
........
LCL: Fix a memory leak in TImageList.GetIcon. Issue , patch from BrunoK.
........

git-svn-id: branches/fixes_2_0@61634 -
This commit is contained in:
martin 2019-07-27 15:35:44 +00:00
parent 8f6c6395fb
commit 351d1ed8a2
5 changed files with 19 additions and 20 deletions
components/sparta/dockedformeditor/source
lcl

View File

@ -1345,6 +1345,7 @@ var
LPageCtrl: TModulePageControl;
begin
Result := nil;
Application.ProcessMessages;
if (FormEditingHook = nil) or (GlobalDesignHook = nil) then
Exit;
LForm := FormEditingHook.GetDesignerForm(GlobalDesignHook.LookupRoot);

View File

@ -565,8 +565,8 @@ begin
GetRawImage(Index, RawImg);
RawImg.PerformEffect(AEffect, True);
FillChar(IconInfo, sizeof(TIconInfo), 0);
IconInfo.fIcon := True;
IconInfo.hbmMask := 0;
if not CreateCompatibleBitmaps(RawImg, IconInfo.hbmColor, IconInfo.hbmMask, True)
then begin
// bummer, the widgetset doesn't support our 32bit format, try device
@ -580,6 +580,10 @@ begin
ListImg.Free;
end;
Image.Handle := CreateIconIndirect(@IconInfo);
if IconInfo.hbmColor<>0 then
DeleteObject(IconInfo.hbmColor);
if IconInfo.hbmMask<>0 then
DeleteObject(IconInfo.hbmMask);
RawImg.FreeData;
end;

View File

@ -33,7 +33,7 @@ begin
Form.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('ShowInputDialog'){$ENDIF};
Form.CreateNew(nil, 0);
with Form do
begin
try
PopupMode := pmAuto;
BorderStyle := bsDialog;
Caption := InputCaption;
@ -95,6 +95,7 @@ begin
Value := Edit.Text;
Result := True;
end;
finally
Form.Free;
end;
end;

View File

@ -12,10 +12,12 @@ uses
Classes, SysUtils, dynlibs,
Graphics, Controls, Forms, ExtCtrls, WSExtCtrls, LCLType, LazUTF8;
{ Very minor changes suggested May 2018 so that -
1. Tries a later version of libappindicator library if old one not present
2. Now defaults to try and use this unit if above lib is present.
3. Still resorts to System Tray model if all else fails.
{ Changed priority, now use libappindicator_3 if available. ~_3 is, nominally
a Unity thing but Ubuntu and several other distros ship it (and support it) with
Gnome desktops.
As of U19.04, libappindicator_1, even if present, does not seem to work.
DRB
}
@ -49,14 +51,13 @@ type
class function GetPosition(const {%H-}ATrayIcon: TCustomTrayIcon): TPoint; override;
end;
{ UnityAppIndicatorInit returns true if appindicator libraries can be loaded }
{ UnityAppIndicatorInit returns true if libappindicator_3 library can be loaded }
function UnityAppIndicatorInit: Boolean;
implementation
const
libappindicator_1 = 'libappindicator.so.1';
libappindicator_3 = 'libappindicator3.so.1';
{const
@ -266,20 +267,11 @@ begin
if Loaded then
Exit(Initialized);
Loaded:= True;
{ if GetEnvironmentVariableUTF8('XDG_CURRENT_DESKTOP') <> 'Unity' then
begin
Initialized := False;
Exit;
end; }
if Initialized then
Exit(True);
// we'll reject if _3 not present or if both present, accept if ONLY _3 is present.
Module := LoadLibrary(libappindicator_1);
if Module <> 0 then // if _1 present, will probably work with old SystemTray
exit; // and may not work with this Unit. So let SystemTray do it.
Module := LoadLibrary(libappindicator_3); // thats the one we want here.
if Module = 0 then // no libappindicator ....
Exit; // hope SystemTray can help you ....
if Module = 0 then // no libappindicator_3
Exit; // hope libappindicator_1 can help you ....
Result :=
TryLoad('app_indicator_get_type', @app_indicator_get_type) and
TryLoad('app_indicator_new', @app_indicator_new) and

View File

@ -605,6 +605,7 @@ function CreateFileDialogHandle(AOpenDialog: TOpenDialog): THandle;
if ofShareAware in Options then Result := Result or OFN_SHAREAWARE;
if ofShowHelp in Options then Result := Result or OFN_SHOWHELP;
if ofDontAddToRecent in Options then Result := Result or OFN_DONTADDTORECENT;
if ofForceShowHidden in Options then Result := Result or OFN_FORCESHOWHIDDEN;
end;
procedure ReplacePipe(var AFilter:string);
@ -820,7 +821,6 @@ FOS_FORCEFILESYSTEM
FOS_ALLNONSTORAGEITEMS
FOS_HIDEMRUPLACES
FOS_HIDEPINNEDPLACES
FOS_DONTADDTORECENT
FOS_DEFAULTNOMINIMODE
FOS_FORCEPREVIEWPANEON}
@ -840,6 +840,7 @@ begin
if ofShareAware in Options then Result := Result or FOS_SHAREAWARE;
if ofDontAddToRecent in Options then Result := Result or FOS_DONTADDTORECENT;
if SelectFolder then Result := Result or FOS_PICKFOLDERS;
if ofForceShowHidden in Options then Result := Result or FOS_FORCESHOWHIDDEN;
{ unavailable options:
ofHideReadOnly
ofEnableSizing