If we've already done the tracking into the parent muxer, there is no need
to do it again. This can save a great deal of recursive work when adding
items to the muxer.
This makes showing the context menu in gnome-text-editor repeatedly fast
even as spelling corrections are changed.
It is likely that this could fix#4422 as well.
Fixes#4519
Fixes https://gitlab.gnome.org/GNOME/gnome-text-editor/-/issues/220
When handling action-added callbacks the code was previously using a
freeze_notify/thaw_notify in all cases. This turns out to allocate a
significant amount of memory when called a lot.
That said, it shouldn't be getting called this much but given the current
state of affairs elsewhere in GtkActionMuxer, this brought temporary
allocations down from 9MiB to 9KiB in gnome-text-editor after showing
the context menu a few times.
Related #4422
Instead of allocation width for height for width for height or whatever
that code was doing, actually allocate the size we were given or the
requested size, whatever is larger.
Don't just pass on measure() calls, but actually behave in the way we
behave during size allocate.
This should improve cases where GtkScrolledWindow is used with GTK_POLICY_NEVER.
We want this to take precedence in the wayland platform to other
modules that might be loaded via the IO extension point. None of
those is going to bode well in this platform.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4443
This adds a new row to the Global/Information section which displays the
GTK im-module that is likely to be in use unless changed by an application.
It responds to updates of GtkSettings:gtk-im-module unless the
GTK_IM_MODULE environment variable is set.
Fixes#4512
When returning surrounding context to input methods,
include at least 2 words before and after the insertion
point.
Update the affected input method tests.
If we set the placeholder text before setting a buffer, we end up with
both the placeholder *and* the buffer's contents visible at the same
time.
Fixes: #4376
We use gtk_gesture_get_last_event() underneath at places that need to
work during ::proximity emission. Since GtkGesture only tracks events
while there are button/touch presses involved, this is not going to
bring the right result there.
Use gtk_event_controller_get_current_event() consistently inside,
which always pokes at the event being handled (which is the correct
intent here).
The idea of within-margin is to scroll as little
as possible to bring the mark within the margins
defined by the factor. The code was achieving
that when scrolling down, but not when scrolling
up. This change makes things symmetrical.
Fixes: #4325
It turns out we can't just use the size returned
by the memory stream as-is, since it may contain
unfilled garbage at the end, which utf8 validation
will choke on. So, cut it off at the first '\0'
we find.
When the iter is at the end of the buffer,
gtk_text_view_get_iter_location returns a
rectangle with width 0, which in turn makes
gdk_rectangle_intersect return FALSE.
Avoid that by always giving the rectangle
non-empty dimensions.
Fixes: #4503
Setting variations to their default value causes
them to show up in the serialization of the font
description - a font description has no idea about
the default values, so can't filter them out.
Avoid that.
Try to compute a min size that matches the current aspect ratio.
This means that when interactively resizing, we adapt the min size to
the current window area dynamically.
And that means that we always have a min size that is large enough, but
users can interactively cause it to be small-width x large-height,
large-width x small-width or anything inbetween.
Printing the affected widget leads people to assume that it is to blame
for the error. However, the widget is the object the function is being
called on, not the caller. And the caller is doing it wrong.
Usually the caller is the parent widget, so we could print that one, but
it's only usually, it can be an issue propagating from a grandparent and
it doesn't tell you from where the function is called (allocation or
measuring), so you need a debugger anyway.
So don't put anything there instead.