summaryrefslogtreecommitdiff
path: root/winaccessibility
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-09-19 14:45:05 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2022-09-26 16:15:06 +0200
commit995d17697d1e46f66df67ca3132369d76caea29e (patch)
tree4967975d74e6d35087c391bc7894f2b203268f58 /winaccessibility
parentc26d6cc3c4878d356328a538b5bf11e4e6a0e7dc (diff)
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>
Diffstat (limited to 'winaccessibility')
-rw-r--r--winaccessibility/source/service/AccComponentEventListener.cxx1
-rw-r--r--winaccessibility/source/service/AccObjectWinManager.cxx5
2 files changed, 6 insertions, 0 deletions
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;