mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Even though this call is probably fast, it can potentially happen a lot, make it _really_ fast
This commit is contained in:
@@ -199,6 +199,10 @@ class NativeWindowViews : public NativeWindow,
|
||||
|
||||
// In charge of running taskbar related APIs.
|
||||
TaskbarHost taskbar_host_;
|
||||
|
||||
// If true we have enabled a11y
|
||||
bool enabled_a11y_support_;
|
||||
|
||||
#endif
|
||||
|
||||
// Handles unhandled keyboard messages coming back from the renderer process.
|
||||
|
||||
@@ -91,11 +91,16 @@ bool NativeWindowViews::PreHandleMSG(
|
||||
// accessibility object.
|
||||
case WM_GETOBJECT: {
|
||||
const DWORD obj_id = static_cast<DWORD>(l_param);
|
||||
if (enabled_a11y_support_) return false;
|
||||
|
||||
if (obj_id == OBJID_CLIENT) {
|
||||
const auto axState = content::BrowserAccessibilityState::GetInstance();
|
||||
if (axState && !axState->IsAccessibleBrowser())
|
||||
if (axState && !axState->IsAccessibleBrowser()) {
|
||||
axState->OnScreenReaderDetected();
|
||||
enabled_a11y_support_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
case WM_COMMAND:
|
||||
|
||||
Reference in New Issue
Block a user