gtk4.git
3 years agogdk/wayland: Drop surface checks on wl_pointer.leave handling
Carlos Garnacho [Fri, 5 Aug 2022 16:33:50 +0000 (18:33 +0200)]
gdk/wayland: Drop surface checks on wl_pointer.leave handling

Even though the argument is non-nullable, GTK sometimes incurs in that
by itself by destroying the surface while the event is in flight. This
is the case of popping down a GtkDropdown. When this happens we simply
ignore the crossing event, but we should let it through instead, the
compositor did not send it in vain and we possibly still have pointer
state to undo.

Drop the surface checks, so that the event is propagated along GTK.

3 years agogtkeventcontroller: Fix internal enum documentation
Carlos Garnacho [Fri, 5 Aug 2022 14:38:56 +0000 (16:38 +0200)]
gtkeventcontroller: Fix internal enum documentation

Copy and paste typo.

3 years agogtkgesturerotate: Filter touchpad holds events
Carlos Garnacho [Fri, 5 Aug 2022 08:53:22 +0000 (10:53 +0200)]
gtkgesturerotate: Filter touchpad holds events

Since the pinch touchpad gestures already have begin/update/end phases,
this gesture has no actual use for these events.

3 years agogtkgesturerotate: Filter touchpad holds events
Carlos Garnacho [Fri, 5 Aug 2022 08:50:45 +0000 (10:50 +0200)]
gtkgesturerotate: Filter touchpad holds events

Since the pinch touchpad gestures already have begin/update/end phases,
this gesture has no actual use for these events.

3 years agogdkevent: Give touchpad hold events a sequence
Carlos Garnacho [Fri, 5 Aug 2022 09:35:28 +0000 (11:35 +0200)]
gdkevent: Give touchpad hold events a sequence

Following what was done for pinch/swipe events, give hold gestures their
own distinct sequence as well. Without this it was NULL, which was already
distinct to other touchpad gestures.

3 years agogtkgesture: Do not coalesce hold events with other touchpad gestures
Carlos Garnacho [Fri, 5 Aug 2022 09:24:58 +0000 (11:24 +0200)]
gtkgesture: Do not coalesce hold events with other touchpad gestures

This delaying of the cancel event was made to avoid intermediate cancellation
for >=2fg hold gestures followed by pinch/swipe gestures, and it worked as
long as everything was considered to have the same sequence.

Since each pinch/swipe pointer gesture now gets its own sequence, this no
longer applies, nor works. This results in zoom/rotate/swipe gestures being
stuck since the sequence for the touchpad events changes mid-gesture.

Sticking to this pattern of giving touchpad gestures their own sequence,
these hold events cannot be assumed to coalesce with other touchpad gestures,
it is better to let it propagate altogether so that both the hold gesture
and the incoming gesture trigger coherent begin and end/cancel phases.

In the worst case, this results in "::begin, ::cancel, ::begin , ..." before
triggering a touchpad gesture, but the extra begin/cancel ought to be a safe
no-op in widgets.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5003
3 years agoMerge branch 'ebassi/textbuffer-private-api' into 'main'
Matthias Clasen [Fri, 5 Aug 2022 12:01:27 +0000 (12:01 +0000)]
Merge branch 'ebassi/textbuffer-private-api' into 'main'

Move private function out of the AT-SPI a11y backend

See merge request GNOME/gtk!4924

3 years agoRe-enable the TextBuffer wrap-mode serialization test
Emmanuele Bassi [Thu, 4 Aug 2022 22:39:54 +0000 (23:39 +0100)]
Re-enable the TextBuffer wrap-mode serialization test

The private serialization function is now available on all platforms.

3 years agoMove private function out of the AT-SPI a11y backend
Emmanuele Bassi [Thu, 4 Aug 2022 22:34:41 +0000 (23:34 +0100)]
Move private function out of the AT-SPI a11y backend

The textbuffer test is calling into a function defined by the AT-SPI
accessibility backend. As of commit 4ddf1b70 we only build and run the
test on Linux, but the function in question isn't really
accessibility-related: it's just a serialization function.

3 years agoUpdate Ukrainian translation
Yuri Chornoivan [Thu, 4 Aug 2022 14:33:50 +0000 (14:33 +0000)]
Update Ukrainian translation

3 years agoMerge branch 'cleanup-ffmpeg' into 'main'
Matthias Clasen [Thu, 4 Aug 2022 10:49:45 +0000 (10:49 +0000)]
Merge branch 'cleanup-ffmpeg' into 'main'

ffmpeg: add audio playback through avdevice

See merge request GNOME/gtk!4852

3 years agoffmpeg: add audio playback through avdevice
Stephan Vedder [Thu, 4 Aug 2022 10:49:44 +0000 (10:49 +0000)]
ffmpeg: add audio playback through avdevice

3 years agoMerge branch 'mount_operation' into 'main'
Matthias Clasen [Wed, 3 Aug 2022 11:56:25 +0000 (11:56 +0000)]
Merge branch 'mount_operation' into 'main'

mountoperation: Fix authentication dialog

Closes #5059 and #5058

See merge request GNOME/gtk!4899

3 years agoMerge branch 'win32-nahimic-nv-notes' into 'main'
Matthias Clasen [Tue, 2 Aug 2022 11:10:25 +0000 (11:10 +0000)]
Merge branch 'win32-nahimic-nv-notes' into 'main'

running.md: Mention about issue with Nahimic on Windows

Closes #4113

See merge request GNOME/gtk!4915

3 years agorunning.md: Mention about issue with Nahimic on Windows
Chun-wei Fan [Mon, 1 Aug 2022 04:10:15 +0000 (12:10 +0800)]
running.md: Mention about issue with Nahimic on Windows

Let people know that they will need to use GTK with the Nahimic service
disabled or OpenGL disabled or put their GTK application into the Nahimic
backlist, or try to use GLES, since there is a known issue in the Windows
nVidia graphics drivers and Nahimic that causes GL operations to fail,
causing crashes in operations such as window resizes.

This will close issue #4113--sadly, there is nothing we can do within
GTK to fix the issue.

3 years agoMerge branch 'label-tabs' into 'main'
Matthias Clasen [Tue, 2 Aug 2022 00:18:44 +0000 (00:18 +0000)]
Merge branch 'label-tabs' into 'main'

Label tabs

See merge request GNOME/gtk!4914

3 years agoMerge branch 'otte-main-patch-86462' into 'main'
Benjamin Otte [Mon, 1 Aug 2022 20:47:12 +0000 (20:47 +0000)]
Merge branch 'otte-main-patch-86462' into 'main'

Fix g_object_new(GTK_TYPE_SNAPSHOT)

See merge request GNOME/gtk!4919

3 years agosnapshot: Don't critical on dispose
Benjamin Otte [Mon, 1 Aug 2022 20:28:46 +0000 (20:28 +0000)]
snapshot: Don't critical on dispose

When there's remaining state that draws nothing, it returns no
rendernode. So do a NULL-check before unreffing it.

3 years agoFix g_object_new(GTK_TYPE_SNAPSHOT)
Benjamin Otte [Mon, 1 Aug 2022 20:08:58 +0000 (20:08 +0000)]
Fix g_object_new(GTK_TYPE_SNAPSHOT)

GJS apparent likes g_object_new() over actual constructors, so make that work.

3 years agoAdd GtkLabel:tabs
Matthias Clasen [Sun, 31 Jul 2022 15:40:20 +0000 (11:40 -0400)]
Add GtkLabel:tabs

This adds more powerful formatting capabilities to GtkLabel
without costing us much, since Pango already supports tabs.

3 years agoMerge branch 'wip/chergert/builder-expose-object-fix' into 'main'
Christian Hergert [Mon, 1 Aug 2022 05:09:53 +0000 (05:09 +0000)]
Merge branch 'wip/chergert/builder-expose-object-fix' into 'main'

builder: gracefully handle re-exposing builder object

See merge request GNOME/gtk!4913

3 years agogtkbuilder: update gtk_builder_expose_object() docs
Christian Hergert [Mon, 1 Aug 2022 04:21:13 +0000 (21:21 -0700)]
gtkbuilder: update gtk_builder_expose_object() docs

3 years agogtkbuilder: update gtk_builder_extend_with_templat() docs
Christian Hergert [Mon, 1 Aug 2022 04:20:55 +0000 (21:20 -0700)]
gtkbuilder: update gtk_builder_extend_with_templat() docs

3 years agogtkbuilder: check for existing object before extending template
Christian Hergert [Mon, 1 Aug 2022 04:15:08 +0000 (21:15 -0700)]
gtkbuilder: check for existing object before extending template

If gtk_builder_expose_object() is called twice with the same name, it will
result in a g_critical(). This improves that situation by checking for the
object before exposing additional times.

This turns out to be handy in situations where templates are expanded
multiple times, such as application-side implementations of UI merging.

3 years agoMerge branch 'fix-gdk-win32-dnd' into 'main'
Luca Bacci [Fri, 29 Jul 2022 12:42:57 +0000 (12:42 +0000)]
Merge branch 'fix-gdk-win32-dnd' into 'main'

Fix DnD on Windows

Closes #4498

See merge request GNOME/gtk!4900

3 years agoUpdate German translation
Christian Kirbach [Thu, 28 Jul 2022 21:13:07 +0000 (21:13 +0000)]
Update German translation

3 years agoUpdate Abkhazian translation
Nart Tlisha [Thu, 28 Jul 2022 19:19:12 +0000 (19:19 +0000)]
Update Abkhazian translation

3 years agoMerge branch 'alatiera/node-flatpak' into 'main'
Matthias Clasen [Thu, 28 Jul 2022 18:08:47 +0000 (18:08 +0000)]
Merge branch 'alatiera/node-flatpak' into 'main'

flatpak: add a NodeEditor demo

See merge request GNOME/gtk!4898

3 years agoMerge branch 'ebassi/file-list-fixes' into 'main'
Matthias Clasen [Thu, 28 Jul 2022 18:07:34 +0000 (18:07 +0000)]
Merge branch 'ebassi/file-list-fixes' into 'main'

Add constructors for GdkFileList

See merge request GNOME/gtk!4907

3 years agoAdd constructors for GdkFileList
Emmanuele Bassi [Thu, 28 Jul 2022 09:13:17 +0000 (10:13 +0100)]
Add constructors for GdkFileList

C API users can keep dealing with the implicit equivalence of
GdkFileList and GSList, but language bindings have no idea that one type
is another, and none of them exposes GSList as a type anyway, so they
will need a way to construct a GdkFileList.

Instead of making GdkFileList mutable, and re-implement GSList, we only
provide a constructors pair that lets you create a GdkFileList from a
linked list or from an array.

3 years agoMerge branch 'barthalion/gnome-runtime-images-quay' into 'main'
Emmanuele Bassi [Wed, 27 Jul 2022 11:39:55 +0000 (11:39 +0000)]
Merge branch 'barthalion/gnome-runtime-images-quay' into 'main'

Update (or drop) the Docker image used by Flatpak job

See merge request GNOME/gtk!4906

3 years agoUpdate (or drop) the Docker image used by Flatpak job
Bartłomiej Piotrowski [Wed, 27 Jul 2022 10:47:50 +0000 (12:47 +0200)]
Update (or drop) the Docker image used by Flatpak job

The gnome-runtime-images have been recently migrated to Quay. This is already reflected in the template.

Please note this MR has been created semi-automatically. If it doesn't make sense, feel free to close it.

3 years agoUpdated Spanish translation
Daniel Mustieles [Wed, 27 Jul 2022 09:36:48 +0000 (11:36 +0200)]
Updated Spanish translation

3 years agoMerge branch 'wip/chergert/disable-sysprof-agent' into 'main'
Christian Hergert [Tue, 26 Jul 2022 23:44:37 +0000 (23:44 +0000)]
Merge branch 'wip/chergert/disable-sysprof-agent' into 'main'

build: configure subproject sysprof with -Dagent=false

See merge request GNOME/gtk!4896

3 years agobuild: configure subproject sysprof with -Dagent=false
Christian Hergert [Fri, 22 Jul 2022 18:30:21 +0000 (11:30 -0700)]
build: configure subproject sysprof with -Dagent=false

Sysprof has a new -Dagent=true build option which allows installing a
/usr/bin/sysprof-agent program (simimlar to sysprof-cli). It provides a
P2P D-Bus API to the process which can control subprocesses. It's used by
IDE tooling to have more control across container boundaries.

However, we do not need it for GTK CI.

3 years agoMerge branch 'markand-main-patch-04776' into 'main'
Emmanuele Bassi [Tue, 26 Jul 2022 15:09:28 +0000 (15:09 +0000)]
Merge branch 'markand-main-patch-04776' into 'main'

gtk: Missing end of code block

See merge request GNOME/gtk!4902

3 years agogtk: Missing end of code block
David Demelier [Tue, 26 Jul 2022 14:52:30 +0000 (14:52 +0000)]
gtk: Missing end of code block

3 years agoAdd Abkhazian translation
Nart Tlisha [Tue, 26 Jul 2022 11:17:20 +0000 (11:17 +0000)]
Add Abkhazian translation

3 years agoMerge branch 'gridview' into 'main'
Benjamin Otte [Tue, 26 Jul 2022 01:08:08 +0000 (01:08 +0000)]
Merge branch 'gridview' into 'main'

Gridview fix rubberbanding issues

Closes #3462 and #3445

See merge request GNOME/gtk!4688

3 years agolistview: Fix selection for last item in get_items_in_rect
Corey Berla [Tue, 26 Jul 2022 00:01:28 +0000 (17:01 -0700)]
listview: Fix selection for last item in get_items_in_rect

Make the last item dependent on y + height

3 years agolistview: Allow starting rubberband in empty space below last row
Corey Berla [Tue, 26 Jul 2022 00:00:46 +0000 (17:00 -0700)]
listview: Allow starting rubberband in empty space below last row

Rubberband does not work when initiated past the last row
(warning is printed "Could not start rubberbanding: No item).

Clamp y at the max height of the widgets in the listview

3 years agolistview: Return an empty bitset when selecting only empty space
Corey Berla [Mon, 25 Jul 2022 23:59:35 +0000 (16:59 -0700)]
listview: Return an empty bitset when selecting only empty space

Return an empty bitset if the user selects exclusively below the last
row.

3 years agogridview: Fix typo in docstring for gtk_grid_view_get_cell_at_y()
Corey Berla [Thu, 5 May 2022 04:48:11 +0000 (21:48 -0700)]
gridview: Fix typo in docstring for gtk_grid_view_get_cell_at_y()

3 years agolistbase: Clear selection if rubberband selected an empty set
Corey Berla [Thu, 5 May 2022 04:41:30 +0000 (21:41 -0700)]
listbase: Clear selection if rubberband selected an empty set

If rubberband returns an empty bitset the selection should be cleared
unless the shift or ctrl key is held

3 years agogridview: Return an empty bitset when selecting only empty space
Corey Berla [Mon, 25 Jul 2022 22:55:13 +0000 (15:55 -0700)]
gridview: Return an empty bitset when selecting only empty space

Return an empty bitset if the user selects exclusively below the last
row.  No need to calculate selection.

3 years agogridview: Fix get_items_in_rect() selection
Corey Berla [Tue, 26 Jul 2022 00:16:56 +0000 (17:16 -0700)]
gridview: Fix get_items_in_rect() selection

last_row should be dependent on y + height, not y

3 years agogridview: Allow starting rubberband in empty space below last row
Corey Berla [Mon, 25 Jul 2022 22:35:20 +0000 (15:35 -0700)]
gridview: Allow starting rubberband in empty space below last row

Rubberband does not work when initiated past the last row
(warning is printed "Could not start rubberbanding: No item).

Clamp y at the max height of the widgets in the gridview

Fixes: #3462
3 years agogridview: Limit rectangle to gridview columns
Corey Berla [Thu, 5 May 2022 04:33:26 +0000 (21:33 -0700)]
gridview: Limit rectangle to gridview columns

The function gtk_grid_view_get_items_in_rect() erroneously calculates
columns less than 0 and greater than n_columns when the user attempts
to rubberband all the way to the left or right respectively.  This
causes the rubberband to persistent and creates unexpected behavior.
Limit the rows to a minimum of 0 and maximum of n_columns - 1.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3445
3 years agogridview: Move gtk_grid_view_computer_total_height() up for reuse
Corey Berla [Tue, 26 Jul 2022 00:19:30 +0000 (17:19 -0700)]
gridview: Move gtk_grid_view_computer_total_height() up for reuse

3 years agoMerge branch 'widget-docs-fix' into 'main'
Emmanuele Bassi [Mon, 25 Jul 2022 21:31:18 +0000 (21:31 +0000)]
Merge branch 'widget-docs-fix' into 'main'

gtkwidget: Fix a small typo in a docs comment

See merge request GNOME/gtk!4901

3 years agogtkwidget: Fix a small typo in a docs comment
Philip Withnall [Mon, 25 Jul 2022 21:15:58 +0000 (23:15 +0200)]
gtkwidget: Fix a small typo in a docs comment

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
3 years agoUpdate Georgian translation
Zurab Kargareteli [Mon, 25 Jul 2022 16:03:57 +0000 (16:03 +0000)]
Update Georgian translation

3 years agoFix DnD on Windows
darkcutler [Mon, 25 Jul 2022 15:16:23 +0000 (15:16 +0000)]
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

3 years agomountoperation: Free user_widgets list upon dialog destruction
Corey Berla [Mon, 25 Jul 2022 03:55:22 +0000 (20:55 -0700)]
mountoperation: Free user_widgets list upon dialog destruction

There's a list user_widgets that contains all of the entries and
selections during authentication.  This is only freed  upon
finalizing the GtkMountOperation.  It's possible (and true for the
GVFS SMB implementation) that a MountOperation can have the
gtk_mount_operation_ask_password_do_gtk () function called multiple
times (i.e. bad password).  The user_widgets list grows with now
invalid pointers to old widgets (causing unexpected behavior and
seg faults).

Free the user_widgets list upon dialog destruction, we don't need it
anymore.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5059
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5058
3 years agoflatpak-build.sh: change the buildtype to debugoptimized
Jordan Petridis [Mon, 25 Jul 2022 12:42:14 +0000 (15:42 +0300)]
flatpak-build.sh: change the buildtype to debugoptimized

So that the flatpaks will include debuginfo and make debugging
easier.

3 years agoflatpak: add a NodeEditor demo
Jordan Petridis [Mon, 25 Jul 2022 12:38:55 +0000 (15:38 +0300)]
flatpak: add a NodeEditor demo

3 years agoMerge branch 'content-fit-since' into 'main'
Emmanuele Bassi [Mon, 25 Jul 2022 11:45:43 +0000 (11:45 +0000)]
Merge branch 'content-fit-since' into 'main'

picture: Fix Since and Deprecated annotations for content-fit

See merge request GNOME/gtk!4897

3 years agopicture: Fix Since and Deprecated annotations
Maximiliano Sandoval R [Mon, 25 Jul 2022 10:52:43 +0000 (12:52 +0200)]
picture: Fix Since and Deprecated annotations

gi-docgen will parse four or more whitespaces of indentation as code blocks,
two whitespaces were used.

This was missing in https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4873.

3 years agomountoperation: Select "Anonymous" check button by default
Corey Berla [Mon, 25 Jul 2022 03:53:41 +0000 (20:53 -0700)]
mountoperation: Select "Anonymous" check button by default

It is already explicitly assumed that anonymous authentication will
be used when available, but it is not clear to the user since neither
of the check buttons are selected.  Select the Anonymous check button
by default.

3 years agoUpdate Catalan translation
Jordi Mas [Thu, 21 Jul 2022 02:25:20 +0000 (04:25 +0200)]
Update Catalan translation

3 years agoMerge branch 'fix-controller-key-event-propagation-file-chooser-widget' into 'main'
Carlos Garnacho [Tue, 19 Jul 2022 22:15:04 +0000 (22:15 +0000)]
Merge branch 'fix-controller-key-event-propagation-file-chooser-widget' into 'main'

GtkFileChooserWidget: Propagate captured key events when the location entry is focused

Closes #4880

See merge request GNOME/gtk!4674

3 years agoMerge branch 'drag-action' into 'main'
Matthias Clasen [Mon, 18 Jul 2022 14:35:11 +0000 (14:35 +0000)]
Merge branch 'drag-action' into 'main'

tree/iconview: Use a unique drag action in drag_enter/motion callbacks

Closes #3187

See merge request GNOME/gtk!4882

3 years agoMerge branch 'treeview-drag-ancestor' into 'main'
Matthias Clasen [Mon, 18 Jul 2022 14:33:26 +0000 (14:33 +0000)]
Merge branch 'treeview-drag-ancestor' into 'main'

treeview: Check for column header area in row click/drag gestures

Closes #4453

See merge request GNOME/gtk!4885

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Mon, 18 Jul 2022 14:24:49 +0000 (14:24 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

css: Fix handling of transform values

See merge request GNOME/gtk!4890

3 years agoMerge branch 'wip/carlosg/use-press-serial' into 'main'
Matthias Clasen [Mon, 18 Jul 2022 14:18:22 +0000 (14:18 +0000)]
Merge branch 'wip/carlosg/use-press-serial' into 'main'

gdk/wayland: Use last implicit grab serial for DnD start requests

Closes #5048

See merge request GNOME/gtk!4889

3 years agogdk/wayland: Stop storing the last serial in GdkWaylandDisplay
Carlos Garnacho [Mon, 18 Jul 2022 10:50:39 +0000 (12:50 +0200)]
gdk/wayland: Stop storing the last serial in GdkWaylandDisplay

This is not used anymore, so we can drop the serial being stored
here.

3 years agoMerge branch 'drop-target-unique' into 'main'
Matthias Clasen [Mon, 18 Jul 2022 12:38:52 +0000 (12:38 +0000)]
Merge branch 'drop-target-unique' into 'main'

droptarget: Provide a unique action for gdk_drop_finish

Closes #5051

See merge request GNOME/gtk!4888

3 years agoMerge branch 'tree-popover-scroll' into 'main'
Matthias Clasen [Mon, 18 Jul 2022 12:28:34 +0000 (12:28 +0000)]
Merge branch 'tree-popover-scroll' into 'main'

treepopover: Add support for scrolling

Closes #3674 and #4877

See merge request GNOME/gtk!4887

3 years agocss: Improve test coverage
Matthias Clasen [Sun, 17 Jul 2022 13:11:23 +0000 (09:11 -0400)]
css: Improve test coverage

Among other things, this includes a test for the fix
in the previous commit.

3 years agocss: Fix handling of transform values
Matthias Clasen [Mon, 18 Jul 2022 11:59:39 +0000 (06:59 -0500)]
css: Fix handling of transform values

When computing a transform value, there is nothing
to do, but we still need to copy the matrix from
src to dest, since it depends on the other transforms
in the array whether we are using the src or the
dest in the end.

This fixes cases like
-gtk-icon-transform: perspective(100px) matrix(1,2,...);
which would otherwise end up with a zero matrix.

3 years agogtk: Improve test coverage
Matthias Clasen [Sun, 17 Jul 2022 13:10:38 +0000 (09:10 -0400)]
gtk: Improve test coverage

3 years agosortlistmodel: Add more tests
Matthias Clasen [Sun, 17 Jul 2022 13:10:08 +0000 (09:10 -0400)]
sortlistmodel: Add more tests

3 years agofilterlistmodel: Add more tests
Matthias Clasen [Sun, 17 Jul 2022 13:09:58 +0000 (09:09 -0400)]
filterlistmodel: Add more tests

3 years agogdk/wayland: Use last press serial for clipboard/primary selections
Carlos Garnacho [Mon, 18 Jul 2022 10:46:11 +0000 (12:46 +0200)]
gdk/wayland: Use last press serial for clipboard/primary selections

This serial observes key and button presses, we can use that instead
of relying on the last serial which might come from other
events/devices.

3 years agogdk/wayland: Use last implicit grab serial for DnD start requests
Carlos Garnacho [Mon, 18 Jul 2022 10:37:29 +0000 (12:37 +0200)]
gdk/wayland: Use last implicit grab serial for DnD start requests

This serial should be that from a button press/touch down/etc, use
the last implicit grab here, which will presumably be from the same
device that triggered the event.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5048
3 years agotreepopover: Add support for scrolling
Mat [Sun, 17 Jul 2022 19:24:51 +0000 (22:24 +0300)]
treepopover: Add support for scrolling

Add support for scrolling large tree popovers in a similar fashion to GtkPopoverMenu.

Fixes #3674
Fixes #4877

3 years agodroptarget: Provide a unique action for gdk_drop_finish
Mat [Sun, 17 Jul 2022 16:11:34 +0000 (19:11 +0300)]
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

3 years agoUpdate Occitan translation
Quentin PAGÈS [Sun, 17 Jul 2022 15:38:50 +0000 (15:38 +0000)]
Update Occitan translation

3 years agoMerge branch 'picture-suggest-content-fit' into 'main'
Emmanuele Bassi [Sun, 17 Jul 2022 15:00:19 +0000 (15:00 +0000)]
Merge branch 'picture-suggest-content-fit' into 'main'

picture: Remove keep-aspect-ratio mention in the doc

See merge request GNOME/gtk!4886

3 years agotreeview: Check for column header area in row click/drag gestures
Mat [Sun, 17 Jul 2022 12:48:30 +0000 (15:48 +0300)]
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

3 years agopicture: Remove keep-aspect-ratio mention in the doc
Marco Melorio [Sun, 17 Jul 2022 14:17:40 +0000 (16:17 +0200)]
picture: Remove keep-aspect-ratio mention in the doc

We were still suggesting to use it in the main doc page. Suggest using
content-fit instead.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 17 Jul 2022 10:50:22 +0000 (10:50 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

filterlistmodel: Add a test

See merge request GNOME/gtk!4884

3 years agoslicelistmodel: Improve a test
Matthias Clasen [Sun, 17 Jul 2022 10:27:39 +0000 (06:27 -0400)]
slicelistmodel: Improve a test

Make sure that replacements in the underlying model
don't affect the slice list model if they are outside
the slice window.

3 years agosortlistmodel: Add a test
Matthias Clasen [Sun, 17 Jul 2022 10:22:55 +0000 (06:22 -0400)]
sortlistmodel: Add a test

Add  a test to prove that additions and removals
in the underlying model show up as expected.

3 years agofilterlistmodel: Add a test
Matthias Clasen [Sun, 17 Jul 2022 10:05:15 +0000 (06:05 -0400)]
filterlistmodel: Add a test

Test that items added in the underlying model show
up in the filter model (if they pass the filter).

Test removals as well.

See #5050

3 years agotree/iconview: Use a unique drag action in drag_enter/motion callbacks
Mat [Sat, 16 Jul 2022 17:50:41 +0000 (20:50 +0300)]
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

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 17 Jul 2022 01:33:09 +0000 (01:33 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

widget-factory: Make the icon work uninstalled

See merge request GNOME/gtk!4881

3 years agowidget-factory: Make the icon work uninstalled
Matthias Clasen [Sun, 17 Jul 2022 01:16:40 +0000 (21:16 -0400)]
widget-factory: Make the icon work uninstalled

Include the app logo as a resource, so we can show
it even when uninstalled.

3 years agoMerge branch 'fix-wrong-label-wrap-in-popover' into 'main'
Matthias Clasen [Sat, 16 Jul 2022 23:19:10 +0000 (23:19 +0000)]
Merge branch 'fix-wrong-label-wrap-in-popover' into 'main'

popover: Correctly substract arrow height when measuring popover widget

See merge request GNOME/gtk!4880

3 years agoMerge branch 'dnd' into 'main'
Benjamin Otte [Sat, 16 Jul 2022 21:37:15 +0000 (21:37 +0000)]
Merge branch 'dnd' into 'main'

DnD Fix Preferred Action for X11

Closes #4259

See merge request GNOME/gtk!4785

3 years agogdkdrop-x11: Use the preferred action if possible
Corey Berla [Sat, 16 Jul 2022 20:34:07 +0000 (13:34 -0700)]
gdkdrop-x11: Use the preferred action if possible

The XDND suggested action is a relic from when the source would control
the action for a drop.  With the new GtkDropTarget the target decides
the action (not the source).  That means the all of the returned
results from the ::enter and ::motion handlers will be unexpectely
ignored. Prefer to use the preferred action over the x11 suggested action.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4259
3 years agogdkdrop-x11: Fix preferred action
Corey Berla [Sat, 16 Jul 2022 20:01:31 +0000 (13:01 -0700)]
gdkdrop-x11: Fix preferred action

gdk_x11_drop_update_actions() sets actions to
drop_x11->suggested_action when !drop_x11->xdnd_have_actions
and then sets it again to drop_x11->suggested_action if it is.
If xdnd_have_actions is true use xdnd_actions.

3 years agopopover: Correctly substract arrow height when measuring popover widget
Yubao Liu [Sat, 16 Jul 2022 16:12:39 +0000 (00:12 +0800)]
popover: Correctly substract arrow height when measuring popover widget

For default popover arrow position and default height-for-width layout mode,
natural_width is calculated first with for_size=-1 and orientation=HORIZONTAL,
at the end of gtk_popover_measure() natural_width  won't be added with tail_height.

Then to measure with for_size=natural_width and orientation=VERTICAL, obviously
for_size shouldn't be substract with tail_height.

The wrong logic will force content in popover gets less width and then text labels
in popover may get wrapped unnecessarily.

3 years agoMerge branch 'content-fit-reftests' into 'main'
Benjamin Otte [Sat, 16 Jul 2022 16:06:57 +0000 (16:06 +0000)]
Merge branch 'content-fit-reftests' into 'main'

reftests: Add content-fit picture tests

See merge request GNOME/gtk!4879

3 years agoreftests: Add content-fit picture tests
Marco Melorio [Sat, 16 Jul 2022 14:47:17 +0000 (16:47 +0200)]
reftests: Add content-fit picture tests

3 years agoMerge branch 'test-coverage' into 'main'
Matthias Clasen [Sat, 16 Jul 2022 14:08:37 +0000 (14:08 +0000)]
Merge branch 'test-coverage' into 'main'

gtk-demo: Fix icon theme breakage

See merge request GNOME/gtk!4878

3 years agogtk-demo: Make the icon work uninstalled
Matthias Clasen [Sat, 16 Jul 2022 13:34:01 +0000 (09:34 -0400)]
gtk-demo: Make the icon work uninstalled

Include the app logo as a resource, so we can show
it even when uninstalled.

3 years agogtk-demo: Add a winning sound to the puzzle
Matthias Clasen [Sat, 16 Jul 2022 12:16:37 +0000 (08:16 -0400)]
gtk-demo: Add a winning sound to the puzzle

We should celebrate every win.

3 years agogtk-demo: Fix icon theme breakage
Matthias Clasen [Sat, 16 Jul 2022 11:23:55 +0000 (07:23 -0400)]
gtk-demo: Fix icon theme breakage

The starred emblem silently went away :(

3 years agogdk: Improve test coverage
Matthias Clasen [Sat, 16 Jul 2022 03:08:28 +0000 (23:08 -0400)]
gdk: Improve test coverage