mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 01:30:32 +08:00

* [v3, darwin] Fix leaking WebKit processes on Window close * [v3] Remove window from window map if closed [v3] Implement `HideOnClose` and ensure it isn't removed when closed --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
36 lines
1.1 KiB
Objective-C
36 lines
1.1 KiB
Objective-C
//go:build darwin
|
|
|
|
#ifndef WebviewWindowDelegate_h
|
|
#define WebviewWindowDelegate_h
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
#import <WebKit/WebKit.h>
|
|
|
|
@interface WebviewWindow : NSWindow
|
|
- (BOOL) canBecomeKeyWindow;
|
|
- (BOOL) canBecomeMainWindow;
|
|
- (BOOL) acceptsFirstResponder;
|
|
- (BOOL) becomeFirstResponder;
|
|
- (BOOL) resignFirstResponder;
|
|
- (WebviewWindow*) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation;
|
|
|
|
@property (assign) WKWebView* webView; // We already retain WKWebView since it's part of the Window.
|
|
|
|
@end
|
|
|
|
@interface WebviewWindowDelegate : NSObject <NSWindowDelegate, WKScriptMessageHandler, WKNavigationDelegate, WKURLSchemeHandler, NSDraggingDestination>
|
|
|
|
@property bool hideOnClose;
|
|
@property unsigned int windowId;
|
|
@property (retain) NSEvent* leftMouseEvent;
|
|
@property unsigned int invisibleTitleBarHeight;
|
|
@property NSWindowStyleMask previousStyleMask; // Used to restore the window style mask when using frameless
|
|
|
|
- (void)handleLeftMouseUp:(NSWindow *)window;
|
|
- (void)handleLeftMouseDown:(NSEvent*)event;
|
|
|
|
@end
|
|
|
|
|
|
#endif /* WebviewWindowDelegate_h */
|