Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ tagged `vX.Y.Z`.

### Fixed

- **Tapping the Edge dashboard no longer steals the keyboard.** The dashboard window took the
key focus on every tap, so the app you were typing into on the main display lost it and a
shortcut such as ⌘V landed in the dashboard. The window is now a non-activating panel that
never becomes key; touches still reach the page.
- **The clipboard widget masks one-time codes.** A six-digit code copied from a text message or
an authenticator (`482913`, `482 913`, `4829-1375`) showed in full on the Edge and on a paired
iPad; any run of four to eight digits copied on its own is now shown as a secret, and still
Expand Down
23 changes: 13 additions & 10 deletions native/Sources/FremkitHelper/KioskWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ extension NSRect {
}
}

/// Borderless window that can still take the keyboard focus.
/// Borderless non-activating panel that never takes the keyboard focus.
///
/// `NSWindow` refuses to become key or main when it is borderless, which in an accessory
/// (`LSUIElement`) app leaves the dashboard unable to receive clicks and key events at all.
private final class KioskNSWindow: NSWindow {
override var canBecomeKey: Bool { true }
override var canBecomeMain: Bool { true }
/// Touches reach the page through `acceptsFirstMouse` on the web view below, so the window has
/// no need to become key. Refusing it keeps the app the user is typing into frontmost on the
/// primary display when a tap lands on the Edge dashboard.
private final class KioskNSWindow: NSPanel {
override var canBecomeKey: Bool { false }
override var canBecomeMain: Bool { false }
}

/// Web view that lets the very first click reach the page.
Expand Down Expand Up @@ -85,10 +86,12 @@ final class KioskWindow: NSObject, WKNavigationDelegate {
self.url = url
self.access = access

window = KioskNSWindow(contentRect: frame,
styleMask: .borderless,
backing: .buffered,
defer: false)
let panel = KioskNSWindow(contentRect: frame,
styleMask: [.borderless, .nonactivatingPanel],
backing: .buffered,
defer: false)
panel.hidesOnDeactivate = false
window = panel
// Above the menu bar and status items: with "Displays have separate Spaces" macOS draws
// a menu bar on every display, and a floating window would leave it visible on the Edge.
window.level = Self.kioskLevel
Expand Down