Commit fa3d1940bf added separate grab handling for GtkSearchEntry, but
didn't consider whether the bar was revealed or concealed. The expected
behavior for the latter is that the entry is cleared rather than focused,
fix the condition accordingly.
Add a possible replacement for GtkEntryCompletion
as a demo.
Move the Dropdowns demo to Lists/Selections, and make
it show both GtkDropDown and the suggestion entry, with
some variations.
Now that GtkATContext is explicitly realized and unrealized, we should
always create an instance at widget initialization time, and drop it
during the widget finalization. This should make it easier to set up the
initial accessible state of a widget during the instance initialization,
as well as reduce the chances of accidental creation of GtkATContext
instances during the destruction sequence.
Since GtkATContexts are now lazily realized, we need to go through the
GtkAccessible's implementation to access the :accessible-role property,
in case there are fallbacks.
There's no need to do a lot of work on construction, if we're delaying
all remote work after the GtkATContext is realized.
The GtkAtSpiContext should also keep a reference on the root, and drop
it at unrealize time.
By unrealizing the context we avoid additional work during the dispose
phase, in case widget code updates the accessible state. We use
GtkAccessible's API, to ensure we unrealize the right ATContext, instead
of the one we store inside GtkWidgetPrivate.
We drop the ATContext instance inside GtkWidget during finalization, to
mop up eventual vivifications there.
Making the list row child css depend on the position
is very expensive, and does not acutally work correctly
(since we don't have widgets for all children, so the
position of the child widget does not reflect the actual
model item position).
To make this more palatable, use the bottom border
instead of the top border, since most lists have a natural
border at the top (with headers), and may end up with
empty space at the bottom.
The overarching goal here is to not queue a resize
unless something has actually changed. In columnview
scenarios, we often deal with hundreds of labels.
Labels are cattle, not pets.
This is leftover code from when widgets were hidden
by default, and was setting them back to their initial
state.
This is getting in the way now, as hiding the widget
updates the HIDDEN accessible state, which ends up
re-creating the at context that we've already disposed
of, leading to memory leaks.
For builds that do not have PangoFT2, the demo fails to link because we weren't
building listview_ucd.c. Fix the build by building listview_ucd.c with
script-names.c and unicode-names.c for all builds, as we now require a Pango
version that already always depends on HarfBuzz and those sources do not use
anything from PangoFT2.
gtk-builder-tool simplify --3to4 now produces a
<requires lib="gtk" version="4.0"/>.
Adapt for that, and also add some tests that check that we
actually verify the requires, and accept 3.99 and 4.0, but
not 5.x.
The hypothetical widget that needs to clone ATContext instances
because it needs to control the accessible role post-construction is
really GtkModelButton.
Fixes: #3342
Some widgets might want to override GtkAccessible and create their own
context in order to control the accessible role post-construction time.
To avoid explicitly copying the existing state over from the original
ATContext to the new one, we need a way to clone the context's state
from inside the ATContext itself.