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 <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn 2022-09-19 14:45:05 +02:00
parent c26d6cc3c4
commit 995d17697d
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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;