mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[darwin] Support Ignore mouse events
[darwin] Support applicationSupportsSecureRestorableState Update video example
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
@property bool shouldTerminateWhenLastWindowClosed;
|
||||
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,13 @@ extern bool hasListeners(unsigned int);
|
||||
processApplicationEvent(EventApplicationDidChangeTheme, NULL);
|
||||
}
|
||||
}
|
||||
- (BOOL)applicationShouldHandleReopen:(NSNotification *)notification
|
||||
|
||||
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)applicationShouldHandleReopen:(NSNotification *)notification
|
||||
hasVisibleWindows:(BOOL)flag {
|
||||
if( hasListeners(EventApplicationShouldHandleReopen) ) {
|
||||
processApplicationEvent(EventApplicationShouldHandleReopen, @{@"hasVisibleWindows": @(flag)});
|
||||
|
||||
@@ -649,7 +649,11 @@ static void windowShowMenu(void *window, void *menu, int x, int y) {
|
||||
[nsMenu popUpMenuPositioningItem:nil atLocation:point inView:webView];
|
||||
}
|
||||
|
||||
|
||||
// windowIgnoreMouseEvents makes the window ignore mouse events
|
||||
static void windowIgnoreMouseEvents(void *window, bool ignore) {
|
||||
WebviewWindow* nsWindow = (WebviewWindow*)window;
|
||||
[nsWindow setIgnoresMouseEvents:ignore];
|
||||
}
|
||||
|
||||
// Make the given window frameless
|
||||
static void windowSetFrameless(void *window, bool frameless) {
|
||||
@@ -1112,6 +1116,10 @@ func (w *macosWebviewWindow) run() {
|
||||
C.webviewSetTransparent(w.nsWindow)
|
||||
}
|
||||
|
||||
if options.IgnoreMouseEvents {
|
||||
C.windowIgnoreMouseEvents(w.nsWindow, C.bool(true))
|
||||
}
|
||||
|
||||
titleBarOptions := macOptions.TitleBar
|
||||
if !w.parent.options.Frameless {
|
||||
C.windowSetTitleBarAppearsTransparent(w.nsWindow, C.bool(titleBarOptions.AppearsTransparent))
|
||||
|
||||
Reference in New Issue
Block a user