Skip to content
Open
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
7 changes: 6 additions & 1 deletion leanring-buddy/OverlayWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,12 @@ class OverlayWindowManager {
)

let hostingView = NSHostingView(rootView: contentView)
hostingView.frame = screen.frame
// Use window-local coordinates (origin .zero), not global screen coordinates.
// The NSPanel is already positioned at screen.frame.origin via OverlayWindow.init.
// NSView.frame is relative to the window's content area, which always starts at (0,0).
// Using screen.frame here (with non-zero origin on secondary monitors) would offset
// the hosting view outside the window bounds, making the overlay invisible.
hostingView.frame = CGRect(origin: .zero, size: screen.frame.size)
window.contentView = hostingView

overlayWindows.append(window)
Expand Down