fix: make window.flashFrame(bool) flash continuously on macOS (#41391)
fix: window.flashFrame to flash continuously on mac This brings the behavior to parity with Windows and Linux. Prior behavior: The first `flashFrame(true)` bounces the dock icon only once (using the [NSInformationalRequest](https://developer.apple.com/documentation/appkit/nsrequestuserattentiontype/nsinformationalrequest) level) and `flashFrame(false)` does nothing. New behavior: Flash continuously until `flashFrame(false)` is called. This uses the [NSCriticalRequest](https://developer.apple.com/documentation/appkit/nsrequestuserattentiontype/nscriticalrequest) level instead. To explicitly use `NSInformationalRequest` to cause a single dock icon bounce, it is still possible to use [`dock.bounce('informational')`](https://www.electronjs.org/docs/latest/api/dock#dockbouncetype-macos).
This commit is contained in:
parent
7120c58297
commit
bf754a3cae
2 changed files with 5 additions and 1 deletions
|
@ -21,6 +21,10 @@ encoded data returned from this function now matches it.
|
||||||
|
|
||||||
See [crbug.com/332584706](https://issues.chromium.org/issues/332584706) for more information.
|
See [crbug.com/332584706](https://issues.chromium.org/issues/332584706) for more information.
|
||||||
|
|
||||||
|
### Behavior Changed: `window.flashFrame(bool)` will flash dock icon continuously on macOS
|
||||||
|
|
||||||
|
This brings the behavior to parity with Windows and Linux. Prior behavior: The first `flashFrame(true)` bounces the dock icon only once (using the [NSInformationalRequest](https://developer.apple.com/documentation/appkit/nsrequestuserattentiontype/nsinformationalrequest) level) and `flashFrame(false)` does nothing. New behavior: Flash continuously until `flashFrame(false)` is called. This uses the [NSCriticalRequest](https://developer.apple.com/documentation/appkit/nsrequestuserattentiontype/nscriticalrequest) level instead. To explicitly use `NSInformationalRequest` to cause a single dock icon bounce, it is still possible to use [`dock.bounce('informational')`](https://www.electronjs.org/docs/latest/api/dock#dockbouncetype-macos).
|
||||||
|
|
||||||
## Planned Breaking API Changes (30.0)
|
## Planned Breaking API Changes (30.0)
|
||||||
|
|
||||||
### Behavior Changed: cross-origin iframes now use Permission Policy to access features
|
### Behavior Changed: cross-origin iframes now use Permission Policy to access features
|
||||||
|
|
|
@ -1004,7 +1004,7 @@ std::string NativeWindowMac::GetTitle() const {
|
||||||
|
|
||||||
void NativeWindowMac::FlashFrame(bool flash) {
|
void NativeWindowMac::FlashFrame(bool flash) {
|
||||||
if (flash) {
|
if (flash) {
|
||||||
attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest];
|
attention_request_id_ = [NSApp requestUserAttention:NSCriticalRequest];
|
||||||
} else {
|
} else {
|
||||||
[NSApp cancelUserAttentionRequest:attention_request_id_];
|
[NSApp cancelUserAttentionRequest:attention_request_id_];
|
||||||
attention_request_id_ = 0;
|
attention_request_id_ = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue