diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-03-09 12:24:00 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-03-10 10:48:36 +0000 |
commit | 1255e9b3c0ed82014a8c0832c40e4c7d8f9c5756 (patch) | |
tree | 99ca35dd3c913307279a0c16eb5f42aebaae3222 /vcl/unx/gtk3 | |
parent | ba0e36e607d1c380fd09b6725a4ebcb69ff399de (diff) |
tdf#140659 gtk a11y: Don't unset model when freezing icon view
As described in Change-Id I10249bbd8c684e89174ba91ce4690d37c24b5d5c
("tdf#153657 gtk3 a11y: Use IconView item tooltip as a11y desc"),
freezing the gtk3 icon view previously resulted in the accessible
child objects not being created at the time of insertion,
so setting the accessible description on them doesn't work.
As a result, e.g. the Orca screen reader would not properly
announce the focused item in Math's elements dock window when using
the gtk3 VCL plugin.
This was caused by clearing the model in
`GtkInstanceIconView::freeze` (and resetting it in
`GtkInstanceIconView::thaw`).
Stop doing that to fix the problem.
Thanks to Caolán for this suggestion!
This also allows to revert
commit 4e8331b77a2dcad2b10d3ca5b788711ea4e83a1b
Date: Wed Dec 7 13:20:03 2022 +0000
Resolves: tdf#152411 clear before freeze to let gtk a11y drop reference
in a follow-up commit since the problem described in
tdf#152411 also no longer happens with this in place.
Also switch the previous check + SAL_WARN to an assert
now that the underlying cause has been addressed.
Change-Id: Id0c241d68ec4fbf933312008f7d0ee86bd3eab0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148535
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index fd1124e6cb00..6be688f06b93 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -16837,16 +16837,8 @@ private: assert(gtk_tree_path_get_depth(pPath) == 1); int* indices = gtk_tree_path_get_indices(pPath); const int nIndex = indices[0]; - const int nChildCount = atk_object_get_n_accessible_children(pAtkObject); - if (nIndex >= nChildCount) - { - SAL_WARN("vcl.gtk", - "item index " - << nIndex << " greater than ItemView's accessible child count " - << nChildCount - << ". Is the IconView frozen, preventing creation of a11y children?"); - return; - } + assert(nIndex < atk_object_get_n_accessible_children(pAtkObject) + && "item index too high for ItemView's accessible child count"); const OUString sTooltipText = signal_query_tooltip(GtkInstanceTreeIter(iter)); AtkObject* pChild = atk_object_ref_accessible_child(pAtkObject, nIndex); @@ -17013,11 +17005,7 @@ public: bool bIsFirstFreeze = IsFirstFreeze(); GtkInstanceWidget::freeze(); if (bIsFirstFreeze) - { - g_object_ref(m_pTreeStore); - gtk_icon_view_set_model(m_pIconView, nullptr); g_object_freeze_notify(G_OBJECT(m_pTreeStore)); - } enable_notify_events(); } @@ -17025,11 +17013,7 @@ public: { disable_notify_events(); if (IsLastThaw()) - { g_object_thaw_notify(G_OBJECT(m_pTreeStore)); - gtk_icon_view_set_model(m_pIconView, GTK_TREE_MODEL(m_pTreeStore)); - g_object_unref(m_pTreeStore); - } GtkInstanceWidget::thaw(); enable_notify_events(); } |