зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1772233: Fix macOS screen recording permission check, skip StatusIndicator window. r=jib,spohl
Differential Revision: https://phabricator.services.mozilla.com/D208291
This commit is contained in:
Родитель
b8287a3297
Коммит
66c1cabe15
|
@ -935,12 +935,11 @@ struct KeyConversionData {
|
|||
|
||||
static const KeyConversionData gKeyConversions[] = {
|
||||
|
||||
#define KEYCODE_ENTRY(aStr, aCode) \
|
||||
{ #aStr, sizeof(#aStr) - 1, NS_##aStr, aCode }
|
||||
#define KEYCODE_ENTRY(aStr, aCode) {#aStr, sizeof(#aStr) - 1, NS_##aStr, aCode}
|
||||
|
||||
// Some keycodes may have different name in KeyboardEvent from its key name.
|
||||
#define KEYCODE_ENTRY2(aStr, aNSName, aCode) \
|
||||
{ #aStr, sizeof(#aStr) - 1, NS_##aNSName, aCode }
|
||||
{#aStr, sizeof(#aStr) - 1, NS_##aNSName, aCode}
|
||||
|
||||
KEYCODE_ENTRY(VK_CANCEL, 0x001B),
|
||||
KEYCODE_ENTRY(VK_DELETE, NSDeleteFunctionKey),
|
||||
|
@ -1387,6 +1386,19 @@ nsresult nsCocoaUtils::GetScreenCapturePermissionState(
|
|||
continue;
|
||||
}
|
||||
|
||||
// macOS versions 12.2 (Monterey) or later have a status indicator when the
|
||||
// microphone is in use (an orange dot). This is implemented as a window
|
||||
// owned by the window server process. The permission check logic queries
|
||||
// window server for all windows and assumes it has the required permission
|
||||
// if it can read any window name that is at dock or normal level.
|
||||
// The StatusIndicator window is an exception and needs to be skipped
|
||||
// because it is owned by window server process and therefore when querying
|
||||
// the window server, the name is always readable.
|
||||
if (kCFCompareEqualTo ==
|
||||
CFStringCompare(windowName, CFSTR("StatusIndicator"), 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
CFNumberRef windowLayerRef = reinterpret_cast<CFNumberRef>(
|
||||
CFDictionaryGetValue(windowDict, kCGWindowLayer));
|
||||
int32_t windowLayer;
|
||||
|
|
Загрузка…
Ссылка в новой задаче