Those property features don't seem to be in use anywhere.
They are redundant since the docs cover the same information
and more. They also created unnecessary translation work.
Closes#4904
We were looking at GtkWidget:has-focus from
event controller signal handlers here, but
the widget property is only changed after
the event controllers.
Currently when the widget is realized after the focus in event the input
method isn't activated as enable is never sent. The call trace is
gtk_text_focus_changed ->
gtk_im_context_focus_in ->
gtk_im_context_wayland_focus_in
which returns early as self->widget is NULL since it's set up in
gtk_text_realize() via gtk_im_context_set_client_widget(). Handle that
case by invoking gtk_im_context_focus_in() from gtk_text_realize() too.
A case where the above happens is a GtkSearchEntry in a GtkSearchBar.
E.g. in gtk4-demo when starting the demo and then hitting the search
button right away.
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
All possible ramifications after button1 press (move cursor,
begin drag, begin dnd, select word/line, ...) result in user
actions. The right thing after that is consuming the events,
set the gesture state for that.
Currently we use layout coordinates and widget height when determining
where a click or drag has happened. If the widget has top padding (which it
does inside a GtkEntry, for example), the area where it's possible to select
text is shifted down, so the part of GtkText above the layout is not counted
as the draggable area and instead the equal area below the widget is counted.
Since GtkText is always single-line, there's no need to do any of that and
we can use widget coordinates. Then the draggable area matches the widget
and the problems goes away.
In many cases, we have an "extra-menu" property that is used to allow
applications to join menus into the native menu for the widget. Previously,
this was done by nesting that menu in a section.
Doing so increases the complexity of the rules for GtkMenuTracker as you
may want different handling from inside of the section vs toplevel
sections.
If instead we synthetically glue the menus together, we have a much more
natural joining of menus as the application developer would expect for
their menu.
This also ports GtkLabel, GtkText, GtkPasswordEntry, and GtkTextView to
use the joined menu helper.
The joined menu helper comes originally from GNOME Builder and has had
extensive use there.
Fixes#4094
We need to update the visibility of the placeholder
label when we create it, otherwise we can end up
with placeholder text on top of entry content.
Fixes: #4066
Remove a boatload of "or %NULL" from nullable parameters
and return values. gi-docgen generates suitable text from
the annotation that we don't need to duplicate.
This adds a few missing nullable annotations too.
Stash away the device timestamp when obscuring
the pointer, and compare it when we decice whether
to unobscure it. This fixes a problem where synthetic
motion events would make the cursor reappear
prematurely.
In some cases, we were inadvertedly merging the
preedit attributes into priv->attrs, instead of
keeping them separate. This was causing the underlines
to grow beyond the preedit and never go away. One
place where this was showing up is the fontchooser
preview.
Fixes: #3679
If multiple nested widgets have drag sources on them, both using bubble
phase, we need to reliably pick the inner one. Both of them will try to
start dragging, and we need to make sure there are no situations where the
outer widget starts drag earlier and cancels the inner one.
Currently, this can easily happen via integer rounding: start and current
coordinates passed into gtk_drag_check_threshold() are initially doubles
(other than in GtkNotebook and GtkIconView), and are casted to ints. Then
those rounded values are used to calculate deltas to compare to the drag
threshold, losing quite a lot of precision along the way, and often
resulting in the outer widget getting larger deltas.
To avoid it, just don't round it. Introduce a variant of the function that
operates on doubles: gtk_drag_check_threshold_double() and use it instead
of the original everywhere.
Recompute the layout when the css style change
affects text attributes. This matches what we do
in GtkLabel, and without this, changing the
font-features-setting css property in the Inspector
does not have immediate effect.
Since the big editable reorg, GtkText was not emitting
::insert-text and ::delete-text, as is expected of
editables. We want to use those signals for a11y
change notification, so make them work again.
To discriminate between is-focus and contains-focus,
we need to use notify::is-focus. This makes sure
we don't get annoying warnings when the blink_cb
gets triggered on an unfocused entry.
Fixes: #2979