mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 02:00:30 +01:00
Cocoa: Workaround crash on closing a parented form
git-svn-id: trunk@44114 -
This commit is contained in:
parent
2bafcb57b1
commit
240ff3398d
@ -373,6 +373,7 @@ type
|
||||
protected
|
||||
procedure didBecomeKeyNotification(sender: NSNotification); message 'didBecomeKeyNotification:';
|
||||
procedure didResignKeyNotification(sender: NSNotification); message 'didResignKeyNotification:';
|
||||
|
||||
public
|
||||
isembedded: Boolean; // true - if the content is inside of another control, false - if the content is in its own window;
|
||||
ownwin: NSWindow;
|
||||
|
||||
@ -437,15 +437,16 @@ var
|
||||
NSView(APArams.WndParent).addSubView(cnt);
|
||||
cnt.window.setAcceptsMouseMovedEvents(True);
|
||||
cnt.callback.IsOpaque:=true;
|
||||
NSNotificationCenter.defaultCenter.addObserver_selector_name_object(cnt, objcselector('didBecomeKeyNotification:'), NSWindowDidBecomeKeyNotification, cnt.window);
|
||||
NSNotificationCenter.defaultCenter.addObserver_selector_name_object(cnt, objcselector('didResignKeyNotification:'), NSWindowDidResignKeyNotification, cnt.window);
|
||||
|
||||
// todo: We have to find a way to remove the following notifications save before cnt will be released
|
||||
// NSNotificationCenter.defaultCenter.addObserver_selector_name_object(cnt, objcselector('didBecomeKeyNotification:'), NSWindowDidBecomeKeyNotification, cnt.window);
|
||||
// NSNotificationCenter.defaultCenter.addObserver_selector_name_object(cnt, objcselector('didResignKeyNotification:'), NSWindowDidResignKeyNotification, cnt.window);
|
||||
end;
|
||||
end;
|
||||
|
||||
Result := TLCLIntfHandle(cnt);
|
||||
end;
|
||||
|
||||
|
||||
class function TCocoaWSCustomForm.GetText(const AWinControl: TWinControl; var AText: String): Boolean;
|
||||
var
|
||||
win : NSWindow;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user