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
(cherry picked from commit 6be352f4468b4dbbb1d71f427948dda154b9a658)
Starting from GLib 2.76, the standard attribute getters in the GFileInfo
object will warn if the attribute is unset, instead of silently bailing
out and returning a default value.
Fixes Evince showing a dark caret when using
dark theme, which makes it almost invisible.
This is in css node "textview text" of Evince
annotation window (a GtkScrolledWindow).
We create a new $caret_color var based on
$text_color and use it accordingly.
Fixes evince#1842
The iter may be invalid, so we may not read from it.
testsuite/gtk/treemodel tests this and valgrind is shouting about it,
but it never crashed until I just ran it...
This bug is from 2004 and the test is from 2007. I guess invalid memory
accesses don't get caught by CI much.
When activating a window, avoid the "old" gdk_notify_startup_complete*()
API that does not fallback into xdg_activation on wayland (as this is still
deferred here until show vs present happens on the surface). This was
mistakenly changed wrt the original commit backported from GTK4.
Fixes: a067938589 ("gtkwindow: Minor refactor")
Failure is allowed by nature of GInitable, and this avoids unnecessary
crashing of programs running with G_DEBUG=fatal-criticals.
(cherry picked from commit 6215b38e645f5047d52e625562efccc1e4f85867)
This should do nothing worthwhile anymore, the X11/Wayland GtkApplication
implementations do already pass the startup ID from the platform_data
via windowing specific APIs, and the application handling the request
via show()/present() should trigger the activation request.
(cherry-picked from commit 3526d8b299becb7cd1e970ea5228a141eae20257)
While this used to be tangential to windows showing or requesting
focus, the xdg-activation Wayland protocol does merge both concepts
together.
But also, for a correct interaction with the compositor, the
toolkit should ideally merge the activation request resulting from
both into the same one, so that the gdk_window_focus() request
replies to the startup token that started the application and
correct focus-stealing prevention/etc happens, instead making up
one just in time for the focus request.
This kind of requires doing things in the right order, a show()
request on the GtkWindow should activate any pending activation
token on the toplevel, a present() request should additionally
create a new token if there was none pending. And
xdg_activation_v1_activate() should happen once on both.
Shuffle the gdk_window_set_startup_id() calls so that this
happens in the right order for Wayland, while making X11 happy
too.
(cherry-picked from commit e8adfa2a889cd45ee0ce0727d7eae0a61fdb7dce)
Move the handling of the startup ID to a separate function, since
this will be called from several places.
(cherry-picked from commit 6f01f846dc66a6359a1524ace13377536821dbb0)
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
The @filename@ directive will use the full path of the file being parsed
for enumeration types; we should use @basename@, instead, as it improves
the reproducibility of the build by using only the file name.
Backport of 4040f76529bbf6d3310a71df2d37c9d95af83892 from main.
The loop sets empty = FALSE when there are emojis but for that
to work we need to initialize the value to TRUE initially.
Fixes: 7928532bc5c33b2c6a10bae138ebc6dca1843cb0
(cherry picked from commit 89c816a614db4083e80862b631f4b3e44aa17eae)
CI and downstream packagers have been using the Meson build for a while
now, and we checked that it's idempotent to the Autotools build.
Having two build systems in tree doesn't make maintaining and releasing
GTK any easier, even if it's the stable/frozen branch.
Arrange for double-click-followed-by-drag to do
select by words, not select-and-dnd. This matches
the behavior in GtkTextView better and feels
intuitive.
Fixes: #2024
mouse_location can be set to NULL in gtk_range_update_mouse_location(). This
causes a match with stepper_?_gadget in gtk_range_multipress_gesture_pressed(),
as both are NULL. This leads to a grab being added internally and as well, a
critical error message, and a subsequent rejection of touch inputs. Returning
early when mouse_location is NULL prevents this.
Closes#4947
GtkSettings/X11 takes the values as provided by
XSettings. Unlike other backends, the values of
XSettings are in physical size (that's because
X11 doesn't support mixed-DPI setups anyway).
Take that in account when retrieving the cursor
size in gtk_tooltip_position ().
Note that this discrepancy between the X11 and
other backends has been fixed in GTK4.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5223
Doing reset() on the text widgets after commit and delete_surrounding
is still too eager for some IMs (e.g. those that expect being able
to commit text while keeping a preedit buffer shown).
However, reset() is more of a "synchronize state" action on Wayland,
and it is still desirable to do that after changes that do come from
the IM (e.g. requesting the new surrounding text and cursor/anchor
positions). Notably here, the text_input protocol may still come up
with a preedit string after this state synchronization happens.
Shuffle the code so that the text widgets do not reset() the IM
context after text is deleted or committed, but the Wayland IM does
apply its practical effects after these actions happen. This keeps
the Wayland IM fully up-to-date wrt text widget state, while not
altering the ::commit and ::delete-surrounding-text behavior for
other IM context implementations.
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.
Fixes backspace key behavior in the GNOME Shell OSK, since that relies
on the surrounding text being properly updated for the next iteration.
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.
Fixes backspace key behavior in the GNOME Shell OSK, since that relies
on the surrounding text being properly updated for the next iteration.
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.
We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.
Since there is going to be an actual IM reset anyways, it does
no longer make sense to try to preserve the old priv->need_im_reset
status during commit handling.
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.
We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.
During entry widget manipulation (inserting or deleting text via keyboard)
the IM context is reset somewhat early, before the actual change took place.
This makes IM lag behind in terms of surrounding text and cursor position.
Shuffle these IM reset calls so that they happen after the changes, and
ensure that the IM is actually reset, since that is currently toggled on
a pretty narrow set of circumstances.
During text widget manipulation (inserting or deleting text via keyboard)
the IM context is reset somewhat early, before the actual change took place.
This makes IM lag behind in terms of surrounding text and cursor position.
Shuffle these IM reset calls so that they happen after the changes, and
ensure that the IM is actually reset, since that is currently toggled on
a pretty narrow set of circumstances.
Also, fix a bug during GtkEventControllerKey::im-update where the condition
on cursor position editability to reset the IM context was inverted.