Skip to content
Open
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
3 changes: 2 additions & 1 deletion v3/pkg/application/webview_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,8 @@ func (w *WebviewWindow) SetFullscreenButtonState(state ButtonState) Window {
}

// Flash flashes the window's taskbar button/icon.
// Useful to indicate that attention is required. Windows only.
// Useful to indicate that attention is required. On Windows this flashes the
// taskbar button; on macOS it bounces the app's Dock icon (Linux: no-op).
func (w *WebviewWindow) Flash(enabled bool) {
if w.impl == nil || w.isDestroyed() {
return
Expand Down
13 changes: 11 additions & 2 deletions v3/pkg/application/webview_window_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,15 @@ static void windowMinimise(void *window) {
[(WebviewWindow*)window miniaturize:nil];
}

// windowFlash requests user attention so the app's Dock icon bounces, drawing
// the user back to a window that needs them. NSInformationalRequest bounces the
// icon once; the request completes on its own, so disabling is a no-op.
static void windowFlash(void *window, bool enabled) {
if (enabled) {
[NSApp requestUserAttention:NSInformationalRequest];
}
}

// zoom maximizes the window to the screen dimensions
static void windowMaximise(void *window) {
[(WebviewWindow*)window zoom:nil];
Expand Down Expand Up @@ -1335,8 +1344,8 @@ func (w *macosWebviewWindow) setTitle(title string) {
}
}

func (w *macosWebviewWindow) flash(_ bool) {
// Not supported on macOS
func (w *macosWebviewWindow) flash(enabled bool) {
C.windowFlash(w.nsWindow, C.bool(enabled))
}

func (w *macosWebviewWindow) setSize(width, height int) {
Expand Down