The header in GtkColumnView has multiple event handlers
there is a ::pressed handler in GtkColumnView for
resizing the columns in CAPTURE as well as a motion
and drag controller. The ::release handler is in
GtkColumnViewTitle. We can't claim the event in the
existing handlers because then the ::release handler will
never get called. Currently, however, all clicks get propagated
to the ColumnView from the header which can be problematic.
Since we don't usually want the clicks from the header
handled on the view, claim it in the BUBBLE phase.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5425
Currently nested custom tags work only as long as the element names differ
from the root one. If it's same, for example:
<condition type="any">
<condition type="max-width">600</condition>
<condition type="max-height">600</condition>
</condition>
then it will fail. Meanwhile the same tags wrapped into <conditions> would
work.
The problem is that custom tag parsing is considered finished as soon as we
encounter a closing tag with the same element name. So instead, track the
nesting level.
Reset alloc_needed_on_child *before* allocating the children. This is
because some child's size_allocate() may call queue_allocate(), which
will bubble up alloc_needed_on_child. An example of this happening is
with GtkScrollable implementations, which are supposed to configure
their adjustments in size_allocate(), which will cause GtkScrollbar's
GtkRange to notice and queue_allocate() on itself.
If we reset alloc_needed_on_child after this happens, then our children
will have a lingering alloc_needed_on_child and will not receive an
allocation.
This commit fixes widgets occasionally losing an allocation when this
scenario happens.
Programmatic changes to the entry contents should
not become part of the undo history.
Sadly, the editable implementations are also used
in the code paths that we use for user-initiated changes,
so we have to be careful to only set them as
irreversible if we are not already in a user action.
Fixes: #5622
Keep a separate boolean for enable-undo, and
disable the history if it is false, or the entry
is not using visible text, or isn't editable.
Related to: #5622
The intention of the ui file was to not let
the paned shrink both children down to nothing,
but using <child> for the children effectively
overrides the setting of the shrink properties.
Fix that by using child properties instead of
<child>.
Otherwise, we end up with a single long row
pushing the content of all the other rows
off to the left, which is much worse than
ellipsizing.
Fixes: #4710
Set the label to expand, so it actually fills
the width that we allocated for it, instead
of shrinking back to the minimum width for
its height.
Fixes: #5521
Setting max-width-chars to the number of characters
in the string works ok only as long as the average
char width we get from Pango matches reality. Sadly
that seems not always the case, and this code was
causing short Chinese tooltips to always be broken
into two lines.
Fixes: #4470
When transitioning from internal to malloc, the strings were placed in
the wrong order to g_strconcat(). This fixes an issue with undo where
if you hit the boundary in just the right way, your undo stack will do
unexpected things.
Fixes#5506
When the model button just has a text label and accel text,
the button fills and the accel label is implicitly aigned to end.
When there's also a icon, even though it's not shown (because
icons are only shown if there's no text), the button doesn't fill
and the accel ends up not aligned (assuming one of the other buttons
is longer). Ensure that the accel label is aligned to the end.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5504
Use the fallback logic to generate the base path for the GtkAtSpiRoot
if the GApplication has no DBus object path to guarantee that
the base path will not stay NULL.
`gtk_at_spi_cache_add_context()` checks if the GtkAtSpiContext's path
is NULL before inserting the context object into the hash table.
Do the same in `gtk_at_spi_cache_remove_context()` to avoid a NULL
pointer dereference in `g_str_hash()` during the hash table lookup
if a context with NULL path is removed. That can happen when the
GtkAtSpiRoot::base_path is NULL, which, in turn, can happen if
`g_application_get_dbus_object_path()` returns NULL.
==394047==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd1966f8b84 bp 0x7fff11e3ded0 sp 0x7fff11e3de58 T0)
==394047==The signal is caused by a READ memory access.
==394047==Hint: address points to the zero page.
#0 0x7fd1966f8b84 in g_str_hash (/usr/lib/libglib-2.0.so.0+0x37b84)
#1 0x7fd1966f9c09 in g_hash_table_contains (/usr/lib/libglib-2.0.so.0+0x38c09)
#2 0x7fd196062c10 in gtk_at_spi_cache_remove_context ../gtk/a11y/gtkatspicache.c:447
#3 0x7fd19606e0a9 in gtk_at_spi_root_unregister ../gtk/a11y/gtkatspiroot.c:653
#4 0x7fd196067f58 in gtk_at_spi_context_unrealize ../gtk/a11y/gtkatspicontext.c:1559
#5 0x7fd195ced97f in gtk_at_context_unrealize ../gtk/gtkatcontext.c:668
#6 0x7fd195f5576e in gtk_widget_unroot_at_context ../gtk/gtkwidget.c:2399
#7 0x7fd195f55bd2 in gtk_widget_unroot ../gtk/gtkwidget.c:2499
...
The marked days are set only as part of gtk_calendar_select_day().
This is insufficient, especially because the day-selected signal
is emitted after the marked days are set in gtk_calendar_select_day().
The marked day gets applied to the current month, and either the previous
or subsequent month if they are visible within the current month.
This doesn't make any sense and likely was an accidental regression
in a6f9052cf1. Clarify the docs.
As part of a6f9052cf1, marked days lost
their style, essentially making that function worthless. Previously,
they were simply bolded, but that doesn't give them proper justice.
The value property is only getting notified when it's unset
or when it's set from gdk_drop_real_value_async(). Make sure
to always notify :value when its changed
A screen reader user is not interested in GTK internals, for example,
he does not care whether a button is an image button or not,
and a screen reader will report the fact that it is a button anyway.
Same applies for GtkEntry widgets, for example.
This actually is sufficient to fix gnome-control-center#2244.
And, according to the discussion in #5145, it should be fine.
This was causing animation and transition to stop randomly and reset
their state to initial state.
This issue has existed since commit
7b68bdb831.
Closes#4426
listitemwidget: Setup factory only once the widget is visible
See merge request GNOME/gtk!5374
(cherry picked from commit 188f9269b7)
7ad693f8 gtkcolumnviewcolumn: Only create cells when the column is visible
listbase: Cancel rubberband if not handling drag
See merge request GNOME/gtk!4831
(cherry picked from commit ae097d9674)
efbd2289 listbase: Cancel rubberband if not handling drag
listbase: Use set_focus_child properly
Closes#5433 and #5432
See merge request GNOME/gtk!5169
(cherry picked from commit 1f001a8f6a)
7081bfc6 listbase: Split scroll_to_item for reuse
93e591fd listbase: Use set_focus_child properly
Calling gdk_device_get_direction can trigger a
notify::direction emissions, since the X11 backend
determines the direction on demand. Prevent that by
forcing the direction to be determined ahead of time.
Fixes: #5311
We are caching the bus address as data on the display object when it
exists, but fail to set the data when the bus address doesn't exist.
That causing excessive calls to GetAddress when the accesssbility
bus doesn't exist. Make sure to cache a non-existent accessibility
bus by setting the "" string.
GTK depends on the a11y infrastructure to be in place unless GTK_A11Y is
set to none. It appears that despite that, users attempt to
get around the a11y requirement without setting GTK_A11Y.
This can cause, amongst other issues, performance problems
with gtk applications. Log failure to connect to the a11y
bus.
Even though button 1 (or touch down) presses do most often have
an effect in one way or another (starting drag, moving focus,
starting selection, ...), there is one situation that they do
immediately nothing: When clicking on the entry does not move
the text caret around. Dragging might start a selection, but
the entry did not do anything just yet, and an immediate
button/touch release should remain at "did nothing".
And that is precisely the hint that the Wayland IM context's click
gesture takes, clicks that do not scroll nor move the caret around,
having the GtkText not claim the gesture in that situation makes
the IM gesture able to do its thing without in-fighting.
This is typically not a problem when the GtkText is embedded in
another GtkEditable implementation (e.g. GtkEntry), since the
IM gesture is inactive and capturing from the parent widget, so
gets a pass that it otherwise doesn't get when both gestures are
in the same widget. This makes it work regardless of GtkText not
being a child of a composite widget, like NautilusQueryEditor
and AdwRowEntry.
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5351
(cherry-picked from commit 09b982f0264e42bda3e8471bb25abec5ee742ecc)
8455b9ac74 seems to have introduced a problem where we can wind
up focusing no widget at all if the `while (parent)` loop doesn't
find a widget it can successfully move the focus to. This 'fixes'
that by falling back to doing the previous thing if we make it
all the way through that loop without moving the focus. Thanks to
@coreyberla for a hint to improve the implementation.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
We can get spurious focus-out/-in pairs when
the editable label is in a popover that gets
a Wayland keyboard enter event as a result of
clicking the editable label.
A timeout isn't a great solution, but nothing
better is available right now.
Fixes: #4864
For the same reasoning as the preceding commit.
Also don't make GtkColumnView focusable. Its internal list view
is already focusable, which is enough to take care of the empty
view case.
(cherry picked from commit 9cb8d21cb5)
The container view itself being focusable makes keyboard navigation
slower by adding a useless focus step.
It also means if an item gets removed, the focus jumps back to the view,
instead of jumping to the next item, as seen in nautilus bug report:
https://gitlab.gnome.org/GNOME/nautilus/-/issues/2489
Instead of making the GtkListBase container itself focusable, override
the .grab_focus() vfunc. This way, calling gtk_widget_grab_focus() on
the view container keeps working sucessfully, but focuses the focus
item directly instead.
This is particularly useful to have because applicaiton authors do
not have direct acess to this class's children, so they can't call
gtk_widget_grab_focus() on them directly.
(cherry picked from commit 4fc4298920)
Only clear a queued move_focus if the widget
we are focusing is actually visible.
This was happening in some cases when popovers
are dismissed by clicking outside, and it was
causing us to miss proper focus updates that
were already queued.
This partially undoes changes from 3dbf5038fa.
That commit did two things:
1) Move the focus update to after-paint time
2) Change from grabbing focus to the visible parent
to calling move_focus (TAB)
The second part did have the unintended consequence
of moving focus laterally.
Fixes: #4903