diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-05-07 08:08:49 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-05-07 16:16:33 +0200 |
commit | f44b1cf1fc2925d54512f1f04361ac2c2fc7d276 (patch) | |
tree | a5734f42e3869d9a317ac1cb118d2bb8d4e96977 /vcl | |
parent | 6517ce70e50e61441484e7ee7a4be0e265020175 (diff) |
gtk3 a11y: Drop VclEventId::ToolboxHighlight{,Off} processing
Drop the manual processing of `VclEventId::ToolboxHighlight`
in the gtk3 a11y bridge.
As mentioned in
commit c45c64aeb57dce91965d7be54601128946455c90
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Mon May 6 14:44:36 2024 +0200
tdf#160806 tdf#160837 gtk3 a11y: Drop handling of some VclEventIds
, the a11y bridge should not have to handle VCL events itself,
but all relevant events should be forwarded to the a11y
event listener as appropriate `AccessibleEventObject` and be handled
by the a11y event listener instead, see `AtkListener::notifyEvent`
for the gtk3 implementation.
In a quick test, toolbar items were still announced
just fine by the Orca screen reader when using the
gtk3 VCL plugin with this commit in place.
`VCLXAccessibleToolBox::ProcessWindowEvent` handles
`VclEventId::ToolboxHighlight` and
`VclEventId::ToolboxHighlightOff` whose manual processing
is now dropped from gtk3, so the former might be a good place
to further look into if anything is still missing after
this commit.
The now dropped handling was originally added in
commit e9816343cd71dfe556e6ace12d67c642a8dde635
Author: Jens-Heiner Rechtien <hr@openoffice.org>
Date: Thu May 11 12:32:22 2006 +0000
INTEGRATION: CWS atkbridge2 (1.2.4); FILE MERGED
2006/05/08 13:45:15 obr 1.2.4.1: #135353# fixed crashes when closing sub-toolbars and application exit
Change-Id: Ib6cfafbc3711fce6a48120439654dc6e6c15971a
Change-Id: I87061fdc595a0a29c2a3dce88ab13c9d7d7ba1b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167253
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/a11y/atkutil.cxx | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/vcl/unx/gtk3/a11y/atkutil.cxx b/vcl/unx/gtk3/a11y/atkutil.cxx index 6d550341b669..6cc52a56ba6c 100644 --- a/vcl/unx/gtk3/a11y/atkutil.cxx +++ b/vcl/unx/gtk3/a11y/atkutil.cxx @@ -295,55 +295,6 @@ static void handle_tabpage_activated(vcl::Window *pWindow) atk_wrapper_notify_focus_change(xSelection->getSelectedAccessibleChild(0)); } -/*****************************************************************************/ - -/* - * toolbar items in gtk are widgets, so we need to simulate focus events for those - */ - -static void notify_toolbox_item_focus(ToolBox *pToolBox) -{ - uno::Reference< accessibility::XAccessible > xAccessible = - pToolBox->GetAccessible(); - - if( ! xAccessible.is() ) - return; - - uno::Reference< accessibility::XAccessibleContext > xContext = - xAccessible->getAccessibleContext(); - - if( ! xContext.is() ) - return; - - ToolBox::ImplToolItems::size_type nPos = pToolBox->GetItemPos( pToolBox->GetHighlightItemId() ); - if( nPos != ToolBox::ITEM_NOTFOUND ) - atk_wrapper_notify_focus_change(xContext->getAccessibleChild(nPos)); -} - -static void handle_toolbox_highlight(vcl::Window *pWindow) -{ - ToolBox *pToolBox = static_cast <ToolBox *> (pWindow); - - // Make sure either the toolbox or its parent toolbox has the focus - if ( ! pToolBox->HasFocus() ) - { - ToolBox* pToolBoxParent = dynamic_cast< ToolBox* >( pToolBox->GetParent() ); - if ( ! pToolBoxParent || ! pToolBoxParent->HasFocus() ) - return; - } - - notify_toolbox_item_focus(pToolBox); -} - -static void handle_toolbox_highlightoff(vcl::Window const *pWindow) -{ - ToolBox* pToolBoxParent = dynamic_cast< ToolBox* >( pWindow->GetParent() ); - - // Notify when leaving sub toolboxes - if( pToolBoxParent && pToolBoxParent->HasFocus() ) - notify_toolbox_item_focus( pToolBoxParent ); -} - rtl::Reference<DocumentFocusListener> GtkSalData::GetDocumentFocusListener() { rtl::Reference<DocumentFocusListener> xDFL = m_xDocumentFocusListener.get(); @@ -396,14 +347,6 @@ static void WindowEventHandler(void *, VclSimpleEvent& rEvent) } break; - case VclEventId::ToolboxHighlight: - handle_toolbox_highlight(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow()); - break; - - case VclEventId::ToolboxHighlightOff: - handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow()); - break; - case VclEventId::TabpageActivate: handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow()); break; |