// SPDX-License-Identifier: LGPL-2.1-or-later #pragma once #include #include #include #include // Native focus owners can keep keyboard focus while their visible popup // reports accessible item focus. Unrelated windows are never event sources. bool msaa_event_in_foreground(HWND window); struct MsaaEvent { HWND window = nullptr; DWORD event = 0, process = 0, thread = 0; LONG object = 0, child = 0; uint64_t generation = 0, deadline = 0; }; struct MsaaResult { MsaaEvent source; bool available = false, native_client = false, password = false; std::string name, role, value, states, description; LONG count = 0; }; // One COM worker owns native references. The event thread exchanges only // copied requests/results, and never waits for a provider to finish. class MsaaEventReader { public: ~MsaaEventReader(); bool start(); void invalidate(uint64_t generation); void submit(const MsaaEvent &event); bool take(MsaaResult &result); void stop(); private: struct State; std::shared_ptr state_; HANDLE worker_ = nullptr; };