mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:19:37 +02:00
IDE: Detach desktop selection button from its action by Application.QueueAsyncCall. Prevents an AV. Patch from Ondrej Pokorny.
git-svn-id: trunk@49793 -
This commit is contained in:
parent
0da4587e23
commit
ad00be4b12
@ -62,8 +62,11 @@ type
|
||||
end;
|
||||
|
||||
TShowDesktopsToolButton = class(TIDEToolButton)
|
||||
private class var
|
||||
DoChangeDesktopName: string;
|
||||
private
|
||||
procedure ChangeDesktop(Sender: TObject);
|
||||
class procedure DoChangeDesktop({%H-}Data: PtrInt);
|
||||
procedure SaveAsDesktop(Sender: TObject);
|
||||
procedure MenuOnPopup(Sender: TObject);
|
||||
|
||||
@ -143,11 +146,17 @@ begin
|
||||
end;
|
||||
|
||||
procedure TShowDesktopsToolButton.ChangeDesktop(Sender: TObject);
|
||||
begin
|
||||
DoChangeDesktopName := (Sender as TShowDesktopItem).DesktopName;
|
||||
Application.QueueAsyncCall(@DoChangeDesktop, 1);
|
||||
end;
|
||||
|
||||
class procedure TShowDesktopsToolButton.DoChangeDesktop(Data: PtrInt);
|
||||
var
|
||||
xDesktopName: string;
|
||||
xDesktop: TDesktopOpt;
|
||||
begin
|
||||
xDesktopName := (Sender as TShowDesktopItem).DesktopName;
|
||||
xDesktopName := DoChangeDesktopName;
|
||||
if xDesktopName = '' then
|
||||
Exit;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user