-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Suppress warning about secure coding for restorable state in mac…
…OS. (#506)
- Loading branch information
Showing
6 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package editor | ||
|
||
/* | ||
#cgo CFLAGS: -x objective-c | ||
#cgo LDFLAGS: -framework Cocoa | ||
#import <Cocoa/Cocoa.h> | ||
@interface MyApplicationDelegate : NSObject <NSApplicationDelegate> | ||
@end | ||
@implementation MyApplicationDelegate | ||
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app { | ||
return YES; | ||
} | ||
@end | ||
void SetMyApplicationDelegate() { | ||
NSApplication *app = [NSApplication sharedApplication]; | ||
app.delegate = [[MyApplicationDelegate alloc] init]; | ||
[app activateIgnoringOtherApps:YES]; // make application foreground | ||
} | ||
*/ | ||
import "C" | ||
|
||
func setMyApplicationDelegate() { | ||
C.SetMyApplicationDelegate() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build linux || freebsd | ||
// +build linux freebsd | ||
|
||
package editor | ||
|
||
func setMyApplicationDelegate() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package editor | ||
|
||
func setMyApplicationDelegate() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters