vcl/unx/gtk4/gtkaccessibleeventlistener.cxx |    4 ++++
 vcl/unx/gtk4/gtkaccessibleregistry.cxx      |    4 ++++
 2 files changed, 8 insertions(+)

New commits:
commit f557e22a675164a1b9b0286a263a81d634959733
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Dec 22 08:45:26 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Dec 22 10:14:47 2023 +0100

    gtk4 a11y: Fix build for Gtk < 4.9
    
    The code in `vcl/unx/gtk4/a11y.cxx` is
    
        #if GTK_CHECK_VERSION(4, 9, 0)
    
    , so should the code using that be.
    
    Should fix this issue reported in [1]:
    
    > Hi, building on Linux (Debian 12) breaks with the following error:
    >
    > [LNK] Library/libvclplug_gtk4lo.so
    > ld.lld: error: undefined symbol: lo_accessible_new(_GdkDisplay*, 
_GtkAccessible*, 
com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible> 
const&)
    > >>> referenced by gtkaccessibleregistry.cxx
    > >>>               
/home/etna/Tmpdir/libreoffice/build/workdir/CxxObject/vcl/unx/gtk4/gtkaccessibleregistry.o:(GtkAccessibleRegistry::getLOAccessible(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>,
 _GdkDisplay*, _GtkAccessible*))
    > clang-15: error: linker command failed with exit code 1 (use -v to see 
invocation)
    > make[1]: *** 
[/home/etna/Tmpdir/libreoffice/vcl/Library_vclplug_gtk4.mk:20: 
/home/etna/Tmpdir/libreoffice/build/instdir/program/libvclplug_gtk4lo.so] Error 
1
    > make[1]: *** Waiting for unfinished jobs....
    >
    > I was able to get the build to succeed by rolling back commit 70ef230 ( 
https://github.com/LibreOffice/core/commit/70ef230aae4f961c8197cc11a7ff5feaf1d96c20
 )
    
    [1] 
https://lists.freedesktop.org/archives/libreoffice/2023-December/091330.html
    
    Change-Id: Ifc359bd8b96af8eaa5427a7949259beb607e105d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161144
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx 
b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
index 256073805e7c..4211340d7ee3 100644
--- a/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
+++ b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
@@ -14,6 +14,8 @@
 #include "gtkaccessibleeventlistener.hxx"
 #include "gtkaccessibleregistry.hxx"
 
+#if GTK_CHECK_VERSION(4, 9, 0)
+
 GtkAccessibleEventListener::GtkAccessibleEventListener(LoAccessible* 
pLoAccessible)
     : m_pLoAccessible(pLoAccessible)
 {
@@ -65,4 +67,6 @@ void GtkAccessibleEventListener::notifyEvent(
     }
 }
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk4/gtkaccessibleregistry.cxx 
b/vcl/unx/gtk4/gtkaccessibleregistry.cxx
index 3f5df43ed40e..e29a86bdb648 100644
--- a/vcl/unx/gtk4/gtkaccessibleregistry.cxx
+++ b/vcl/unx/gtk4/gtkaccessibleregistry.cxx
@@ -12,6 +12,8 @@
 
 #include <cassert>
 
+#if GTK_CHECK_VERSION(4, 9, 0)
+
 std::map<css::accessibility::XAccessible*, LoAccessible*> 
GtkAccessibleRegistry::m_aMapping = {};
 
 LoAccessible*
@@ -38,4 +40,6 @@ void 
GtkAccessibleRegistry::remove(css::uno::Reference<css::accessibility::XAcce
     m_aMapping.erase(xAcc.get());
 }
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to