Files
ladybird/UI/AppKit/Interface/LadybirdWebViewWindow.h
Andreas Kling 71d92c7298 UI/AppKit: Restore focus when activating a tab
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.
2026-04-17 08:06:24 +02:00

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