This isn't really useful, as it totally changes the API. But it serves as a
base to play around with scrolling using partial pixels for smoother
deceleration.
GtkAdjustment have values that are often tied to the "virtual" allocation
size of a widget, such as a GtkScrollable. Thusly, when size_allocate() is
called on GtkScrollable, the adjustment will emit ::changed. But a
size_allocate() indicates we're in the GDK_FRAME_CLOCK_PHASE_LAYOUT and
that is too late to perform changes that will affect allocation.
Therefore, this defers handling of the changed signal to the next frame so
that we do not perform operations that can cause widgets within the
hierarchy to loose their allocation.
This fixes a very common issue, where we see something like:
Trying to snapshot GtkGizmo 0x... without a current allocation
which was caused by GtkViewport changing it's adjustment in size_allocate()
and cascading to a GtkScrolledWindow->GtkScrollbar->GtkRange->GtkGizmo.
# Conflicts:
# gtk/gtkrange.c
We no longer need to make much distinction between multiple logical
devices, plus it breaks esp. with the Xwayland input device distribution.
Just iterate across all devices and reset their scroll valuators.
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4160
This is a bit spaghetti right now, since seats and devices were
heavily entangled there are a number of crossed private API calls that
should ideally not be there.
Let this be a first step, so more bits may move from the seat
implementation to devices.
This commit implements the idea brought up in #5032, and provides a
simple function for GtkEditable implementations using a delegate object.
The accessible state is proxied from the outher GtkEditable to the
delegate.
This file, event though a clump of input-y objects, has more of
seats than anything else. Rename it so that we can start splitting
these objects out of it.
The `get_child_at_index()` API model comes from AT-SPI, and it's not an
efficient design, especially when coupled with large widgets.
Replace `get_child_at_index()` with `get_first_accessible_child()` and
`get_next_accessible_sibling()`.
That allows efficiently retrieving all the children, simplifies the
implementation of GtkAccessible in GtkWidget and closely resembeles the
GtkWidget API.
Getting the last child and previous sibling for iterating backwards is
not a part of the interface at the moment, but they can be added at a
later date.
Note that this change required tracking the next stack page in
GtkStackPage.
Reduce our dependency on linked lists; pointer arrays are better at
cache locality.
Additionally, we can avoid quadratic behaviors when finding a child at a
given index.