Commit Graph

72711 Commits

Author SHA1 Message Date
Carlos Garnacho
452d93c7ea gtktext: Avoid early IM reset on updates
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.

Fixes: 52ac71b972 ("gtktextview: Shuffle the places doing IM reset")
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5133
2022-09-12 22:41:45 +03:00
Carlos Garnacho
c4f5358826 gtktext: Avoid early IM reset on updates
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.

Fixes: 9e29739e66 ("gtktext: Shuffle the places doing IM reset")
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5133
2022-09-12 22:41:27 +03:00
Matthias Clasen
d3e181f7de Make gtk_launch_uri more robust
We were failing to launch the uri if we are on
Wayland, but have no xdg_foreign protocol support.

Fixes: #5152
2022-09-12 22:38:15 +03:00
Mat
cde32368f0 treepopover: Do not propagate natural width of content
Propagating the natural width of the tree popover contents breaks ellipsizing of items
(see 'Unconstrained menu' in tests/testcombo).
2022-09-12 22:37:18 +03:00
Matthias Clasen
da82eb8e1c Merge branch 'cherry-pick-4.6' into 'gtk-4-6'
Cherry-pick changes from main for gtk-4-6

See merge request GNOME/gtk!5001
2022-09-06 20:13:56 +00:00
Balázs Úr
40e639fb6e Update Hungarian translation 2022-09-02 21:27:19 +00:00
Mat
e3a23a9a9d treeview: Don't claim event sequence too early
We want to claim the event sequence in the click gesture when appropriate,
such as activating a row or clicking an editable cell, but this is currently
done too early, preventing other gestures for drag-and-drop and rubberband
selection entirely.

Fixes #3649
Fixes #3985
Fixes #4669
2022-09-02 17:01:37 +03:00
Matthias Clasen
8558560030 Merge branch 'cherry-pick-4.6' into 'gtk-4-6'
Cherry-pick changes from main for gtk-4-6

See merge request GNOME/gtk!4997
2022-09-01 17:24:15 +00:00
Matej Urbančič
52483b88ce Update Slovenian translation 2022-08-31 18:33:51 +00:00
Mat
2bb0d815ee gtknotebook: update arrow button state when reordering tabs
When reordering notebook tabs, updating the sensitivity state of the
arrow buttons is necessary if the tab is moved to the beginning or
end of the tab list.
2022-08-30 16:55:39 +03:00
Mat
887c743e3d gtknotebook: Claim event sequence after pressing notebook arrow buttons
When notebook tabs are reorderable, pressing the notebook arrow buttons to
change the active tab results in tabs reordering unexpectedly.
Claim the event sequence after pressing an arrow button to avoid conflicts
with the motion/drag gesture used for reordering.
2022-08-30 16:55:27 +03:00
Mat
3e5bbfb2a5 gtkatspiselection: Retrieve the correct GtkNotebook tab widget
A typo resulted in the tab container widget being retrieved instead of
the tab widget. If an adjacent action widget was present, an infinite
loop occurred when switching tabs while a screen reader was enabled.
2022-08-30 16:55:11 +03:00
Mat
2ca86eb969 treeview: Always call grab_focus_without_selecting on search entry
The search text entry is always a GtkText widget, not GtkEntry. If a
custom search entry is set, this part of the code is never reached.

Fixes #4551
2022-08-30 16:54:44 +03:00
Piotr Drąg
393dd5a838 Update Polish translation 2022-08-28 23:33:51 +02:00
Goran Vidović
baba8aa9a5 Update Croatian translation 2022-08-28 14:44:55 +00:00
Sveinn í Felli
a27ae5362c Update Icelandic translation 2022-08-23 11:49:37 +00:00
Sveinn í Felli
e6d3c58ccf Update Icelandic translation 2022-08-23 11:38:38 +00:00
Matthias Clasen
59320f4aa1 Merge branch 'gtk46-backports' into 'gtk-4-6'
text: Respect no-emoji hint fully

See merge request GNOME/gtk!4975
2022-08-22 19:55:43 +00:00
Matthias Clasen
dc397fce3c css: Fix freeing of calc values
We were getting our memory allocations mixed
up here.

Fixes: #5130
2022-08-22 15:38:19 -04:00
Matthias Clasen
317d4c8f8d text: Respect no-emoji hint fully
We were disabling the insert-emoji action when the
no-emoji input hint is set, but the Ctrl-. shortcut
was bypassing the action and kept working. Make
the shortcut activate the action instead.

Fixes: #5123
2022-08-22 15:37:35 -04:00
Carlos Garnacho
8d4968afb2 Merge branch 'wip/carlosg/im-fixes-4-6' into 'gtk-4-6'
gtkimcontextwayland: Refactor handling of client updates [4.6]

See merge request GNOME/gtk!4963
2022-08-18 20:56:33 +00:00
Carlos Garnacho
519258c382 gtkimcontextwayland: Refactor handling of client updates
Currently, the wayland IM context sends zwp_text_input_v3.commit from
a number of places, and some of them with partial data. In order to
make client state updates "atomic" and complete, make the communication
happen over an unified notify_im_change() function that happens on
a narrower set of circumstances:

  - The GtkIMContext is reset
  - The GtkIMContext is just focused
  - The gesture to invoke the OSK is triggered
  - The IM context is reacting to changes coming from the compositor

Notably, setting the cursor location or the surrounding text do not try
to commit state on their own, and now will be flushed with the corresponding
IM update or reset. But also, these requests won't be prevented from
happening individually on serial mismatch, instead it will be the whole
state commit which is held off.

With these changes in place, all client-side updates are notified
atomically to the compositor under a single .commit request.

(cherry-picked from commit f66ffde68d)
2022-08-18 20:03:40 +02:00
Carlos Garnacho
34693b0d9f gtktextview: Shuffle the places doing IM reset
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.

(cherry-picked from commit 52ac71b972)
2022-08-18 20:03:13 +02:00
Carlos Garnacho
919128d8c2 gtktext: Shuffle the places doing IM reset
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.

(cherry-picked from commit 9e29739e66)
2022-08-18 20:02:53 +02:00
Zurab Kargareteli
7f26ca0c32 Update Georgian translation 2022-08-18 14:11:38 +00:00
Matthias Clasen
42b14ce5f2 4.6.7 2022-08-17 13:03:24 -04:00
Matthias Clasen
68cff22966 Merge branch 'leak-fixes-46' into 'gtk-4-6'
a11y: Fix a memory leak

See merge request GNOME/gtk!4958
2022-08-17 11:14:48 +00:00
Matthias Clasen
86a137b2ff Merge branch 'cherry-pick-4.6' into 'gtk-4-6'
Cherry-pick changes from main for gtk-4-6

See merge request GNOME/gtk!4959
2022-08-16 21:34:04 +00:00
Mat
65f51d2d16 treeview: Do not set top row adjustment value while animating
gtk_tree_view_top_row_to_dy, which is called from GtkTreeView's
size_allocate function, changes the adjustment value. Since this
conflicts with the animation when changing the active row, bail
out until the animation is finished.

Fixes #4550
2022-08-16 23:29:00 +03:00
Mat
e1dcbd4442 treeview: Use widget coordinates where required
When a GtkTreeView scrolled horizontally, it was not possible to
select rows outside the initial area due to an erroneous comparison
between widget and bin window coordinates.

Original change to widget coordinates occurred in commit
a0de570e47
2022-08-16 23:28:39 +03:00
Matthias Clasen
1722b39f92 gtk4-demo: Fix a memory leak
The gears demo was leaking its vertices.
2022-08-16 08:22:53 -04:00
Matthias Clasen
96d6ff16b6 wayland: Avoid leaking cursor textures
When we fall back to the default cursor and load it
from a resource, we need to free the texture.
2022-08-16 08:22:53 -04:00
Matthias Clasen
4962b76b47 cups printbackend: Plug memory leaks
This loop has many early exits, and all of them
need to free this info object that gets allocated
at the beginning.
2022-08-16 08:22:53 -04:00
Matthias Clasen
981690b12e Add more valgrind suppressions
This gets all GQuark functions out of the logs.
2022-08-16 08:22:53 -04:00
Matthias Clasen
412e77d500 a11y: Fix a memory leak
We need to free the queued context list in dispose
if we didn't get to register the contexts, and we also
need to free the list properly when we do get to
register them.

This showed up in valgrind as leaked GList structs.
2022-08-16 08:22:53 -04:00
Zurab Kargareteli
df1c6956b4 Update Georgian translation 2022-08-15 18:37:05 +00:00
Matthias Clasen
77e0b09efc Merge branch 'improve-css-test-4.6' into 'gtk-4-6'
css: Propagate charset conversion errors

See merge request GNOME/gtk!4944
2022-08-12 16:52:54 +00:00
Goran Vidović
1d6416c12b Update Croatian translation 2022-08-12 14:30:13 +00:00
Matthias Clasen
6b019d4dd0 tests: Check the error first
The error contains useful information when
things fail, so check it first to get useful
output in case of failure.
2022-08-11 20:10:48 -04:00
Matthias Clasen
ac18330f65 css: Propagate charset conversion errors
Lets not throw away informtation that
helps to figure out why things fail.
2022-08-11 20:10:48 -04:00
Matthias Clasen
e93a5479de Merge branch 'wip/carlosg/scroll-speed-4-6' into 'gtk-4-6'
gtkscrolledwindow: Backport scroll speed from 4.7/main

See merge request GNOME/gtk!4946
2022-08-11 23:51:02 +00:00
Carlos Garnacho
9d01189f2f gtkscrolledwindow: Backport scroll speed from 4.7/main
Only the scroll velocity factor is backported here, the scroll unit
event API is notably missing, so this implicitly applies to all smooth
scroll events.

The number also accounts for the 1/10th factor applied in GDK, compared
to the code in main.
2022-08-12 01:10:50 +02:00
Daniel Mustieles
3149f1c934 Updated Spanish translation 2022-08-08 12:45:00 +02:00
Matthias Clasen
e5d3cc20d9 Merge branch 'cherry-pick-c1d6160b' into 'gtk-4-6'
Merge branch 'otte-main-patch-86462' into 'main'

See merge request GNOME/gtk!4920
2022-08-03 11:56:41 +00:00
Matthias Clasen
57f6effa1a Merge branch 'for-gtk-4-6' into 'gtk-4-6'
frameclock: Run paint idle from flush idle (backport  !4858 to 4.6)

See merge request GNOME/gtk!4918
2022-08-01 23:07:08 +00:00
Benjamin Otte
584e9f93a4 Merge branch 'otte-main-patch-86462' into 'main'
Fix g_object_new(GTK_TYPE_SNAPSHOT)

See merge request GNOME/gtk!4919

(cherry picked from commit c1d6160bd4)

09f0c96b Fix g_object_new(GTK_TYPE_SNAPSHOT)
dbab69c4 snapshot: Don't critical on dispose
2022-08-01 20:47:27 +00:00
Benjamin Otte
41396e1344
frameclock: Run paint idle from flush idle
Don't return to the main loop, instead force a run of the paint idle.
The paint idle will know to skip all the phases that aren't requested.

This is critically important becuase gdksurface.c assumes the
FLUSH_EVENTS and RESUME_EVENTS phases are matched, and we cannot
guarantee that if we return to the main loop and let various reentrant
code change the frame clock state.

This would lead to bugs with events being paused and never unpaused
again or even crashes.

Fixes #4941
2022-08-01 19:45:14 +02:00
Aleksandr Melman
36ed85cc9c Update Russian translation 2022-08-01 13:12:35 +00:00
Luca Bacci
d57594c709 Merge branch 'backport-mr-4900-to-gtk-4-6' into 'gtk-4-6'
Fix DnD on Windows

See merge request GNOME/gtk!4908
2022-07-29 13:07:29 +00:00
darkcutler
5b888393e5 Fix DnD on Windows
DnD under Windows needed 3 fixes to work with Gtk.DropTarget.

1. The droptarget_w32format_contentformat_map list never gets
filled so the gdk_win32_drop_read_async throws
"No compatible transfer format found".
This is an easy fix and done the same way in the win32 clipboard code.

2. After a drop no gdk_drop_emit_leave_event gets emitted.
This causes a second drop to trigger a bunch of assertion
'self->drop == drop' failed because the first drop is still active.
This is also an easy fix and done the same way by the macos backend.

3. Handling gdk_drop_status/gdk_drop_get_actions interaction.
In gtk_drop_target_do_drop the code
```gdk_drop_finish (self->drop, gdk_drop_get_actions (self->drop));```
calls the finish operation with the actions of the drop which triggers
```g_return_if_fail (gdk_drag_action_is_unique (action));```
in gdk_drop_finish. The code assumes that GdkDrop::actions gets
narrowed down by calling gdk_drop_status. This is hard to assure
because at the same time gdk_drop_get_actions is used by
gtk_drop_target_accept to figure out if a drag is accepted.
GdkDrop::actions serves a double purpose here as the supported source
actions and the currently agreed on action. Both the x11 and the
wayland backend get this wrong somewhat too. Under wayland/x11 when
a drag coming from a source that supports both MOVE and COPY is
first hovering a drop target that only supports COPY it is afterwards
no longer accepted by other drop targets only accepting MOVE.
Under x11 this is permanent for this drag but with wayland the drag
recovers when hovering other widgets. The win32 backend now sets the
supported source actions before any enter/move/drop and narrows them
down in gdk_win32_drop_status.

The patch only touches the win32 backend and fixes all three issues,
for me restoring DnD under windows.

Closes #4498
2022-07-29 14:44:26 +02:00