Commit Graph

72692 Commits

Author SHA1 Message Date
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 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
Matthias Clasen
2f138ce93b Merge branch 'cherrypick-for-4-6' into 'gtk-4-6'
Cherry-pick changes from main for gtk-4-6

See merge request GNOME/gtk!4894
2022-07-28 18:10:14 +00:00
Matthias Clasen
a6d22b3af1 Merge branch 'cherry-pick-09da4db8' into 'gtk-4-6'
Merge branch 'dnd' into 'main'

See merge request GNOME/gtk!4891
2022-07-28 18:05:51 +00:00
Benjamin Otte
6479495fbf Merge branch 'cherry-pick-0c052c9a' into 'gtk-4-6'
Merge branch 'gridview' into 'main'

See merge request GNOME/gtk!4904
2022-07-26 17:25:49 +00:00
Benjamin Otte
1ea2643aa9 Merge branch 'gridview' into 'main'
Gridview fix rubberbanding issues

Closes #3462 and #3445

See merge request GNOME/gtk!4688

(cherry picked from commit 0c052c9a37)

2bcae546 gridview: Move gtk_grid_view_computer_total_height() up for reuse
c6f357e4 gridview: Limit rectangle to gridview columns
1e9a36ff gridview: Allow starting rubberband in empty space below last row
ba909cf9 gridview: Fix get_items_in_rect() selection
f3fc8f5b gridview: Return an empty bitset when selecting only empty space
57c032e6 listbase: Clear selection if rubberband selected an empty set
aba2d994 gridview: Fix typo in docstring for gtk_grid_view_get_cell_at_y()
e14b84ff listview: Return an empty bitset when selecting only empty space
d6fab140 listview: Allow starting rubberband in empty space below last row
a7bbc258 listview: Fix selection for last item in get_items_in_rect
2022-07-26 16:37:40 +00:00
Luca Bacci
a241b4480e Merge branch 'backport-mr-4674-to-gtk-4-6' into 'gtk-4-6'
GtkFileChooserWidget: Propagate captured key events when the location entry is focused

See merge request GNOME/gtk!4714
2022-07-20 07:04:59 +00:00
Mat
f8231cf1a7 treepopover: Add support for scrolling
Add support for scrolling large tree popovers in a similar fashion to GtkPopoverMenu.

Fixes #3674
Fixes #4877
2022-07-18 18:56:18 +03:00
Mat
a730012006 droptarget: Provide a unique action for gdk_drop_finish
gdk_drop_finish() requires a unique drop action. Reuse the existing
make_action_unique() function to get one.

Fixes #5051
2022-07-18 18:55:59 +03:00
Mat
977a69ab84 treeview: Check for column header area in row click/drag gestures
Bail out if a row click/drag gesture is performed in the column header area,
since separate gestures handle column headers.

Fixes #4453
2022-07-18 18:55:38 +03:00
Mat
7e4d6b556c tree/iconview: Use a unique drag action in drag_enter/motion callbacks
Functions already exist for providing a unique drag action for gdk_drop_finish().
Reuse these functions in the drag_enter/motion callbacks, since they require
a unique action as the return value.

Fixes #3187
2022-07-18 18:55:09 +03:00
Benjamin Otte
45ff81848f Merge branch 'dnd' into 'main'
DnD Fix Preferred Action for X11

Closes #4259

See merge request GNOME/gtk!4785

(cherry picked from commit 09da4db81f)

c9c48d78 gdkdrop-x11: Fix preferred action
16fd2608 gdkdrop-x11: Use the preferred action if possible
2022-07-18 14:21:45 +00:00
Luca Bacci
73afd4976a Propagate key events when the location entry is focused
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4880
2022-07-13 13:38:01 +02:00
Matthias Clasen
07c115a383 Merge branch 'fix-gtk-stack-get-page-annotation' into 'gtk-4-6'
Fix gi-docgen comments for gtk_stack_get_page.

See merge request GNOME/gtk!4794
2022-07-11 18:18:26 +00:00
Hugo Parente Lima
a9f658ab8f Fix gi-docgen comments for gtk_stack_get_page. 2022-07-11 18:18:25 +00:00
Andika Triwidada
9c258a5441 Update Indonesian translation 2022-07-03 08:20:41 +00:00
Мирослав Николић
7c0cf9e0c9 Update Serbian translation 2022-07-03 02:18:43 +00:00
Matthias Clasen
57ba5ad39e 4.6.6 4.6.6 2022-07-02 14:38:25 -04:00
Sabri Ünal
1ba946d3ba Update Turkish translation 2022-06-10 05:53:37 +00:00
Rafael Fontenelle
d43ddcb2e8 Update Brazilian Portuguese translation 2022-06-09 23:44:08 +00:00
Matthias Clasen
05e4079682 Merge branch 'hc-icontheme-for-4-6' into 'gtk-4-6'
Don't use the HighContrast icon theme

See merge request GNOME/gtk!4805
2022-06-08 18:48:15 +00:00