Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions crates/gpui_macos/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,6 @@ unsafe fn build_classes() {
sel!(characterIndexForPoint:),
character_index_for_point as extern "C" fn(&Object, Sel, NSPoint) -> u64,
);

// Undocumented SPI, also implemented by Chromium's content view. This
// lets full size content windows mark our Metal view as app owned title
// bar content, avoiding AppKit's title bar click-delay behavior.
decl.add_method(
sel!(_opaqueRectForWindowMoveWhenInTitlebar),
opaque_rect_for_window_move_when_in_titlebar
as extern "C" fn(&Object, Sel) -> NSRect,
);
decl.register()
};
BLURRED_VIEW_CLASS = {
Expand Down Expand Up @@ -2762,25 +2753,6 @@ extern "C" fn accepts_first_mouse(this: &Object, _: Sel, _: id) -> BOOL {
YES
}

extern "C" fn opaque_rect_for_window_move_when_in_titlebar(this: &Object, _: Sel) -> NSRect {
unsafe {
let window: id = msg_send![this, window];
if window == nil {
return NSRect::new(NSPoint::new(0., 0.), NSSize::new(0., 0.));
}

let style_mask: NSWindowStyleMask = msg_send![window, styleMask];
if style_mask.contains(NSWindowStyleMask::NSFullSizeContentViewWindowMask) {
// Declare the entire view as opaque content for window move purposes
// when using a custom titlebar, so AppKit doesn't wait for double click
// disambiguation before delivering clicks to titlebar controls.
msg_send![this, bounds]
} else {
NSRect::new(NSPoint::new(0., 0.), NSSize::new(0., 0.))
}
}
}

extern "C" fn character_index_for_point(this: &Object, _: Sel, position: NSPoint) -> u64 {
let position = screen_point_to_gpui_point(this, position);
with_input_handler(this, |input_handler| {
Expand Down
Loading