[darwin] Support Ignore mouse events

[darwin] Support applicationSupportsSecureRestorableState
Update video example
This commit is contained in:
Lea Anthony
2023-10-29 20:29:45 +11:00
parent daec8a9a64
commit 985c5bf8e2
7 changed files with 24 additions and 19 deletions
@@ -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)});
+9 -1
View File
@@ -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))