From 995d17697d1e46f66df67ca3132369d76caea29e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 19 Sep 2022 14:45:05 +0200 Subject: tdf#117173 wina11y: Send EVENT_SYSTEM_ALERT when notification shows Together with Change-Id Ifcf9304883e2e824ea1b7998d7767e474b87c8b6 ("tdf#119788 tdf#117173 add accessibility NOTIFICATION role") and Change-Id Id62b3942dc17c3a1ed6a08d23438406e5a19c39d ("tdf#117173 a11y: Send SHOWING state change event on Window{Show,Hide}"), this makes NVDA announce the notification in the Search and Replace dialog as an alert, similar to what browsers do e.g. in the alert on empty input for the input validation example at https://www.w3.org/WAI/tutorials/forms/validation/ . Change-Id: I3263df4711f84a6dd9e178aaaaad340b128aa074 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140091 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- winaccessibility/source/service/AccComponentEventListener.cxx | 1 + winaccessibility/source/service/AccObjectWinManager.cxx | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'winaccessibility') diff --git a/winaccessibility/source/service/AccComponentEventListener.cxx b/winaccessibility/source/service/AccComponentEventListener.cxx index ca0dec0fa311..060fb201136c 100644 --- a/winaccessibility/source/service/AccComponentEventListener.cxx +++ b/winaccessibility/source/service/AccComponentEventListener.cxx @@ -237,6 +237,7 @@ void AccComponentEventListener::FireStatePropertyChange(sal_Int64 state, bool se pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); // UNO !SHOWING == MSAA OFFSCREEN pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING ); + pAgent->NotifyAccEvent(UnoMSAAEvent::STATE_SHOWING, m_xAccessible.get()); break; case AccessibleStateType::VISIBLE: // UNO !VISIBLE == MSAA INVISIBLE diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index 44dbcb98ac3a..de527270a8e0 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -198,6 +198,11 @@ bool AccObjectWinManager::NotifyAccEvent(XAccessible* pXAcc, UnoMSAAEvent eEvent UpdateAccFocus(pXAcc); NotifyWinEvent( EVENT_OBJECT_FOCUS,hAcc, OBJID_CLIENT,dChildID ); break; + case UnoMSAAEvent::STATE_SHOWING: + // send EVENT_SYSTEM_ALERT when notification gets shown + if (pRContext->getAccessibleRole() == AccessibleRole::NOTIFICATION) + NotifyWinEvent(EVENT_SYSTEM_ALERT, hAcc, OBJID_CLIENT, dChildID); + break; case UnoMSAAEvent::MENU_START: NotifyWinEvent( EVENT_SYSTEM_MENUSTART,hAcc, OBJID_CLIENT,dChildID ); break; -- cgit