vcl/Library_vclplug_gtk3.mk                    |    1 
 vcl/Library_vclplug_gtk3_kde5.mk               |    1 
 vcl/inc/unx/gtk/atkbridge.hxx                  |   25 ---------
 vcl/unx/gtk3/a11y/atkbridge.cxx                |   32 -----------
 vcl/unx/gtk3/a11y/atkutil.cxx                  |   67 -------------------------
 vcl/unx/gtk3/a11y/atkutil.hxx                  |   26 ---------
 vcl/unx/gtk3/gtkinst.cxx                       |    8 --
 vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkbridge.cxx |   12 ----
 8 files changed, 172 deletions(-)

New commits:
commit 26e7ddb2c87642099f1320279c96a9176ef18dfe
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue May 7 08:38:29 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue May 7 16:16:55 2024 +0200

    gtk3 a11y: Drop WindowEventHandler completely
    
    As mentioned in
    
        commit c45c64aeb57dce91965d7be54601128946455c90
        Author: Michael Weghorn <m.wegh...@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.
    
    Now that handling of all VCL events has been dropped in
    previous commits, drop the `WindowEventHandler` completely.
    This also means that the call to `InitAtkBridge` when initializing
    the `GtkInstance` and the `DeInitAtkBridge` on destruction
    is no longer necessary.
    
    In a quick test with the Orca screen reader and the gtk3
    VCL plugin, nothing suspicious showed up, things were
    still working as expected and experienced prior to the
    change series dropping the VCL event handling from the
    gtk3 a11y bridge.
    
    Change-Id: Ieed270b636f361c57cd4e78aceaecc7d174409d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167256
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk
index 0809edd770a7..ff631f17b450 100644
--- a/vcl/Library_vclplug_gtk3.mk
+++ b/vcl/Library_vclplug_gtk3.mk
@@ -82,7 +82,6 @@ $(eval $(call gb_Library_use_externals,vclplug_gtk3,\
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3,\
     vcl/unx/gtk3/a11y/atkaction \
-    vcl/unx/gtk3/a11y/atkbridge \
     vcl/unx/gtk3/a11y/atkcomponent \
     vcl/unx/gtk3/a11y/atkeditabletext \
     vcl/unx/gtk3/a11y/atkfactory \
diff --git a/vcl/Library_vclplug_gtk3_kde5.mk b/vcl/Library_vclplug_gtk3_kde5.mk
index 853ec7aafa4e..c58619af8c5d 100644
--- a/vcl/Library_vclplug_gtk3_kde5.mk
+++ b/vcl/Library_vclplug_gtk3_kde5.mk
@@ -88,7 +88,6 @@ $(eval $(call gb_Library_use_externals,vclplug_gtk3_kde5,\
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3_kde5,\
        vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkaction \
-       vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkbridge \
        vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkcomponent \
        vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkeditabletext \
        vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkfactory \
diff --git a/vcl/inc/unx/gtk/atkbridge.hxx b/vcl/inc/unx/gtk/atkbridge.hxx
deleted file mode 100644
index e77a9ab571e3..000000000000
--- a/vcl/inc/unx/gtk/atkbridge.hxx
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-bool InitAtkBridge();
-void DeInitAtkBridge();
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk3/a11y/atkbridge.cxx b/vcl/unx/gtk3/a11y/atkbridge.cxx
deleted file mode 100644
index c7cb32ca3ce2..000000000000
--- a/vcl/unx/gtk3/a11y/atkbridge.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <unx/gtk/atkbridge.hxx>
-
-#include "atkutil.hxx"
-
-bool InitAtkBridge()
-{
-    ooo_atk_util_ensure_event_listener();
-    return true;
-}
-
-void DeInitAtkBridge() {}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk3/a11y/atkutil.cxx b/vcl/unx/gtk3/a11y/atkutil.cxx
index 51b783b2d4fd..971cad08fc9c 100644
--- a/vcl/unx/gtk3/a11y/atkutil.cxx
+++ b/vcl/unx/gtk3/a11y/atkutil.cxx
@@ -34,10 +34,6 @@
 
 #include <unx/gtk/gtkdata.hxx>
 #include "atkwrapper.hxx"
-#include "atkutil.hxx"
-
-#include <cassert>
-#include <set>
 
 using namespace ::com::sun::star;
 
@@ -285,43 +281,4 @@ rtl::Reference<DocumentFocusListener> 
GtkSalData::GetDocumentFocusListener()
     return xDFL;
 }
 
-static void WindowEventHandler(void *, VclSimpleEvent& rEvent)
-{
-    try
-    {
-        switch (rEvent.GetId())
-        {
-
-        case VclEventId::ComboboxSetText:
-            // This looks quite strange to me. Stumbled over this when fixing 
#i104290#.
-            // This kicked in when leaving the combobox in the toolbar, after 
that the events worked.
-            // I guess this was a try to work around missing combobox events, 
which didn't do the full job, and shouldn't be necessary anymore.
-            // Fix for #i104290# was done in 
toolkit/source/awt/vclxaccessiblecomponent, FOCUSED state for compound controls 
in general.
-            // create_wrapper_for_children(static_cast< ::VclWindowEvent const 
* >(pEvent)->GetWindow());
-            break;
-
-        default:
-            break;
-        }
-    }
-    catch (const lang::IndexOutOfBoundsException&)
-    {
-        g_warning("WindowEventHandler: Focused object has invalid index in 
parent");
-    }
-}
-
-static Link<VclSimpleEvent&,void> g_aEventListenerLink( nullptr, 
WindowEventHandler );
-
-/*****************************************************************************/
-
-void ooo_atk_util_ensure_event_listener()
-{
-    static bool bInited;
-    if (!bInited)
-    {
-        Application::AddEventListener( g_aEventListenerLink );
-        bInited = true;
-    }
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk3/a11y/atkutil.hxx b/vcl/unx/gtk3/a11y/atkutil.hxx
deleted file mode 100644
index bc3d9d73b936..000000000000
--- a/vcl/unx/gtk3/a11y/atkutil.hxx
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include <atk/atk.h>
-
-void ooo_atk_util_ensure_event_listener();
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 41aa48dbed7f..8089c88467e3 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -25,7 +25,6 @@
 #include <unx/gtk/gtkgdi.hxx>
 #include <unx/gtk/gtkframe.hxx>
 #include <unx/gtk/gtkobject.hxx>
-#include <unx/gtk/atkbridge.hxx>
 #include <unx/gtk/gtksalmenu.hxx>
 #include <headless/svpvd.hxx>
 #include <headless/svpbmp.hxx>
@@ -244,10 +243,6 @@ void GtkInstance::EnsureInit()
     pSalData->Init();
     GtkSalData::initNWF();
 
-#if !GTK_CHECK_VERSION(4, 0, 0)
-    InitAtkBridge();
-#endif
-
     ImplSVData* pSVData = ImplGetSVData();
 #ifdef GTK_TOOLKIT_NAME
     pSVData->maAppData.mxToolkitName = OUString(GTK_TOOLKIT_NAME);
@@ -261,9 +256,6 @@ void GtkInstance::EnsureInit()
 GtkInstance::~GtkInstance()
 {
     assert( nullptr == m_pTimer );
-#if !GTK_CHECK_VERSION(4, 0, 0)
-    DeInitAtkBridge();
-#endif
     ResetLastSeenCairoFontOptions(nullptr);
 }
 
diff --git a/vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkbridge.cxx 
b/vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkbridge.cxx
deleted file mode 100644
index e07fc6c29571..000000000000
--- a/vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkbridge.cxx
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "../../gtk3/a11y/atkbridge.cxx"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 047475fb4c50f0c99aa283c3a882763ae57b8c85
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue May 7 08:28:52 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue May 7 16:16:49 2024 +0200

    gtk3 a11y: Drop VclEventId::TabpageActivate processing
    
    Drop the manual processing of `VclEventId::TabpageActivate`
    in the gtk3 a11y bridge.
    
    As mentioned in
    
        commit c45c64aeb57dce91965d7be54601128946455c90
        Author: Michael Weghorn <m.wegh...@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.
    
    By now, most if not all tab pages should be native GTK widgets
    anyway.
    For non-native ones, `VCLXAccessibleTabControl::ProcessWindowEvent`
    contains handling for the `VclEventId::TabpageActivate` event that
    should be taking care of forwarding that as the corresponding
    a11y event to the a11y bridges. If anything is still missing after
    this commit, that's probably a good starting point for further
    analysis.
    
    Change-Id: I5b3f64c973d4030d2b68be6dff1d771bc0cef405
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167255
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/unx/gtk3/a11y/atkutil.cxx b/vcl/unx/gtk3/a11y/atkutil.cxx
index d10bc3b27967..51b783b2d4fd 100644
--- a/vcl/unx/gtk3/a11y/atkutil.cxx
+++ b/vcl/unx/gtk3/a11y/atkutil.cxx
@@ -274,27 +274,6 @@ void DocumentFocusListener::detachRecursive(
     }
 }
 
-/*****************************************************************************/
-
-/*
- * page tabs in gtk are widgets, so we need to simulate focus events for those
- */
-
-static void handle_tabpage_activated(vcl::Window *pWindow)
-{
-    uno::Reference< accessibility::XAccessible > xAccessible =
-        pWindow->GetAccessible();
-
-    if( ! xAccessible.is() )
-        return;
-
-    uno::Reference< accessibility::XAccessibleSelection > xSelection(
-        xAccessible->getAccessibleContext(), uno::UNO_QUERY);
-
-    if( xSelection.is() )
-        
atk_wrapper_notify_focus_change(xSelection->getSelectedAccessibleChild(0));
-}
-
 rtl::Reference<DocumentFocusListener> GtkSalData::GetDocumentFocusListener()
 {
     rtl::Reference<DocumentFocusListener> xDFL = 
m_xDocumentFocusListener.get();
@@ -312,9 +291,6 @@ static void WindowEventHandler(void *, VclSimpleEvent& 
rEvent)
     {
         switch (rEvent.GetId())
         {
-        case VclEventId::TabpageActivate:
-            handle_tabpage_activated(static_cast< ::VclWindowEvent const * 
>(&rEvent)->GetWindow());
-            break;
 
         case VclEventId::ComboboxSetText:
             // This looks quite strange to me. Stumbled over this when fixing 
#i104290#.

Reply via email to