зеркало из https://github.com/electron/electron.git
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:
Родитель
7120c58297
Коммит
bf754a3cae
|
@ -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.
|
||||
|
||||
### 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)
|
||||
|
||||
### 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) {
|
||||
if (flash) {
|
||||
attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest];
|
||||
attention_request_id_ = [NSApp requestUserAttention:NSCriticalRequest];
|
||||
} else {
|
||||
[NSApp cancelUserAttentionRequest:attention_request_id_];
|
||||
attention_request_id_ = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче