mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Tabs opened from links on AppKit can be created before their URL is loaded. That left background open-url tabs with the location field as their stored responder, so switching to them later restored address-bar focus instead of web content focus. Track each tab's preferred responder, restore it when AppKit makes the tab key, and mark page-backed open-url tabs to prefer the web view. Blank new-tab pages still keep the location field focused.
22 lines
463 B
Objective-C
22 lines
463 B
Objective-C
/*
|
|
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
@class LadybirdWebView;
|
|
|
|
@interface LadybirdWebViewWindow : NSWindow
|
|
|
|
- (instancetype)initWithWebView:(LadybirdWebView*)web_view
|
|
windowRect:(NSRect)window_rect;
|
|
|
|
@property (nonatomic, strong) LadybirdWebView* web_view;
|
|
@property (nonatomic, weak) NSResponder* preferred_first_responder;
|
|
|
|
@end
|