Commit Graph

75573 Commits

Author SHA1 Message Date
Benjamin Otte
107133ec6d listview: Move ::factory out of the item manager
It's a listitemwidget property, and the item manager manages the items,
not the widgets.
2023-03-23 04:45:03 +01:00
Benjamin Otte
4ecda13fbd listview: Move ::single-click-activate out of the item manager
It's a listitemwidget property, and the item manager manages the items,
not the widgets.
2023-03-23 04:45:03 +01:00
Benjamin Otte
ccacf80f47 listitemmanager: Create widgets via vfunc
We now have listitemmanager just create GtkListItemBase objects via
vfunc and use them.
2023-03-23 04:45:03 +01:00
Benjamin Otte
1f3a2734eb listitemwidget: split out GtkListItemBase
There's 2 reasons for this:

1. Adding a custom widget for columnview rows
2. Using this as base class for sections
2023-03-23 04:45:03 +01:00
Benjamin Otte
a18760a094 itemmananger: Remove the user data
Use the widget instead. They're the same anyway.
2023-03-23 04:45:03 +01:00
Benjamin Otte
e85270b051 listbase: Privatize 2 functions
They're not used outside of GtkListBase, so no use to have them in the
header.

Requires moving one function up in the source now that the forward
declaration is missing.
2023-03-23 04:45:03 +01:00
Benjamin Otte
27c01cfa49 listitemmanager: Clean up header
Remove all unused functions and an unused macro.
2023-03-23 04:45:03 +01:00
Matthias Clasen
7b22983be5 Don't leak all AT contexts
create_at_context was confused - it stored a reference
to the newly created context in priv->context, but then
also returned a reference, and the caller stored that
in priv->context again.

Change it to only return a reference.

Fixes: #5690
2023-03-22 23:41:40 -04:00
Matthias Clasen
57ec758d81 Merge branch 'texture-scale-test' into 'main'
gsk: Add a test for scaled textures

See merge request GNOME/gtk!5686
2023-03-23 02:42:28 +00:00
Bruce Cowan
2ab3610df8 Update British English translation
(cherry picked from commit d80cecec06)
2023-03-22 15:46:23 +00:00
Matthias Clasen
724ecf3b51 Merge branch 'ebassi/ensure-file-chooser-types' into 'main'
Ensure GtkFileChooserCell's type

See merge request GNOME/gtk!5696
2023-03-22 10:48:55 +00:00
Emmanuele Bassi
b2e8158c7a Ensure GtkFileChooserCell's type
Otherwise anything that dlopen()'s GTK will have a bad day.

See: https://discourse.gnome.org/t/strange-filechooserdialog-behaviour-in-gtk-4-10/14435
2023-03-22 10:29:57 +00:00
Matthias Clasen
9dcc1943b3 gsk: Improve slice handling
Upload slices in chunks, instead of copying
enormous amounts of memory.
2023-03-22 00:15:32 -04:00
Matthias Clasen
c3ee8d2699 gsk: Add more flexible texture upload
Add a command queue function to create a
GL texture by uploading several GdkTextures
at given positions.
This lets us 'piece together' textures.
2023-03-22 00:15:04 -04:00
Matthias Clasen
24720307bb gsk: Tweak one test to pass
Clip away the problematic corners in this
artificial texture scaling test. The GL renderer
has problems getting them perfect.
2023-03-22 00:15:04 -04:00
Matthias Clasen
50969d7923 gsk: Drop debug code 2023-03-22 00:15:04 -04:00
Matthias Clasen
5de8e9ec6e gsk: Drop some unused arguments
All callers of the slice apis pass 0 for
min_rows and min_cols. So just drop these.
2023-03-22 00:14:43 -04:00
Matthias Clasen
d1fc44d3a6 gsk: Use overlapping slices
Store texture coordinates for each slice
instead of assuming 0,0,1,1, and generate
overlapping slices to allow for proper mipmaps.

This almost fixes trilinear filtering with
sliced textures.
2023-03-22 00:14:43 -04:00
Matthias Clasen
61b9be1c1a gsk: Add a test for scaled textures
GL and cairo disagree on this one, and have forever.
Whee!
2023-03-22 00:14:16 -04:00
Matthias Clasen
8f73a7c690 gsk: Cosmetics 2023-03-22 00:14:16 -04:00
Matthias Clasen
c237957ef0 Merge branch 'matthiasc/for-main' into 'main'
a11y: Add a test for gtk_accessible_role_to_name

See merge request GNOME/gtk!5694
2023-03-22 00:24:52 +00:00
Matthias Clasen
d04690d05c a11y: Add a test for gtk_accessible_role_to_name
This should prevent !5693 from happening again
in the future.
2023-03-21 20:06:37 -04:00
Matthias Clasen
f8bfb5fec2 Merge branch 'fix_gtk_accessible_role_to_name_crash' into 'main'
fix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON

See merge request GNOME/gtk!5693
2023-03-21 18:05:50 +00:00
Caolán McNamara
2a78734aef fix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON
presumably since:

commit de80f503e4
Date:   Thu Feb 23 14:22:20 2023 +0100

    a11y: Introduce a dedicated role for toggle buttons
2023-03-21 15:04:12 +00:00
Benjamin Otte
ee6aae93d5 Merge branch 'wip/otte/for-main' into 'main'
checkbutton: Only andle arrow focus if we're in a group

See merge request GNOME/gtk!5692
2023-03-21 13:26:09 +00:00
Benjamin Otte
fb2a17a972 testsuite: Add a treelistmodel test
This one exhaustively tests reusing the same model as a child model for
many nodes.
This tracks that multiple items-changed signals emitted at the same time
(or multiple handlers for one such signal) doesn't put the treelistmodel
in an inconsistent state while it is handling all of them.

I'm not sure this (ab)use of treelistmodel should be officially
supported, but it works today, so let's test it to see if we can keep it
working.
2023-03-21 14:10:17 +01:00
Benjamin Otte
1c64438b12 checkbutton: Only andle arrow focus if we're in a group
If there is no other widget in the group that we can focus, don't focus
and activate ourselves.

Otherwise the arrow keys on checkbuttons toggle the checkbutton.
2023-03-21 14:10:17 +01:00
Matthias Clasen
634bea777f Merge branch 'disabled-picture-opacity-fix' into 'main'
theme: Use 0.5 opacity for disabled pictures

Closes #5683

See merge request GNOME/gtk!5689
2023-03-20 23:06:44 +00:00
Marco Trevisan (Treviño)
a2076dd537 theme: Use 0.5 opacity for disabled pictures
If a GtkImage is using an icon we use a gtk-icon-filter to se the icon
opacity when in insensitive state, however when using other kinds of
pictures we do not apply the same style leading to an inconsistent
result.

Closes: #5683
2023-03-20 23:46:08 +01:00
Matthias Clasen
75f9379cd5 Merge branch 'alatiera/fedora-bump' into 'main'
ci: Use Fedora 38 as the base

See merge request GNOME/gtk!5688
2023-03-20 14:39:15 +00:00
Jordan Petridis
f9b2d3104a vulkan: Update error codes enum 2023-03-20 16:16:30 +02:00
Jordan Petridis
679657cc0f ci: Use Fedora 38 as the base 2023-03-20 16:16:24 +02:00
Matthias Clasen
d712bdcd6d Merge branch 'bilelmoussaoui-main-patch-49195' into 'main'
g-i: Add since annotation to GdkSurfaceSize

See merge request GNOME/gtk!5687
2023-03-20 11:23:21 +00:00
Bilal Elmoussaoui
aa0cd3a553 g-i: Add since annotation to GdkSurfaceSize 2023-03-20 08:14:25 +00:00
Matthias Clasen
244d36d3f4 Merge branch 'mipmap-more' into 'main'
gsk: Use mipmaps when it is beneficial

See merge request GNOME/gtk!5685
2023-03-20 02:04:21 +00:00
Matthias Clasen
a19cf02b16 gsk: Use mipmaps when it is beneficial
If a texture node ends up getting scaled
down a lot, it helps to use trilinear filtering.
2023-03-19 21:45:30 -04:00
Benjamin Otte
56b904f1e6 Merge branch 'wip/otte/for-main' into 'main'
treelistmodel: Clear item in right place

Closes #5681

See merge request GNOME/gtk!5682
2023-03-19 17:07:53 +00:00
Benjamin Otte
dd1e76e601 treelistmodel: Clear item in right place
Items should be cleared when the node is discarded, not when the node's
children are discarded - which can also happen when a node is collapsed.

Fixes an error introduced in 9048e391b6

Fixes #5681
2023-03-19 17:38:38 +01:00
Matthias Clasen
e850dc81ba Merge branch 'texture-scale-tests' into 'main'
node-editor: Embed textures in testcases

See merge request GNOME/gtk!5681
2023-03-19 14:54:34 +00:00
Matthias Clasen
942c8eec73 ci: Make reports for all setups 2023-03-19 10:21:19 -04:00
Matthias Clasen
e7bb7785fa testsuite: Improve setup name consistency
Rename the 'waylandgles' test setup to 'wayland_gles'.
2023-03-19 10:19:00 -04:00
Matthias Clasen
9705ccbe2f ci: Run tests with small textures 2023-03-19 10:16:19 -04:00
Matthias Clasen
ace2122d45 testsuite: Add a test setup for slicing
Add a 'wayland_smalltexture' test setup that forces
the max texture size to be 1024, which lets us test
the texture slicing codepaths.
2023-03-19 10:15:22 -04:00
Matthias Clasen
80730a4014 testsuite: Add some texture tests
In constrast to our other tests, these use
textures that are big enough to force slicing
with setting GSK_MAX_TEXTURE_SIZE, which we
will use in the following commits to improve
test coverage.
2023-03-19 10:05:52 -04:00
Matthias Clasen
0a3eceb15d node-editor: Embed textures in testcases
It is useless to have node files with references
to external files in the testsuite, so turn such
textures into data urls by doing a serialization
roundtrip.
2023-03-19 10:04:46 -04:00
Benjamin Otte
f211a2177f Merge branch 'wip/otte/for-main' into 'main'
Fix inspector doing weird stuff

Closes #5646

See merge request GNOME/gtk!5678
2023-03-19 06:23:46 +00:00
Benjamin Otte
c463685286 treelistmodel: Clarify docs
No user knows that we have an internal function called
gtk_tree_list_row_destroy() that gets called when a row gets removed
from the treelistmodel.

So everyone was probably just making stuff up about what "destroy"
means.

Related: #5646
2023-03-19 06:55:05 +01:00
Benjamin Otte
bf55685000 treelistmodel: Track the item in the row
That way, we can return the item even after the row is removed. This is
particularly relevant in ListItemFactory::unbind callbacks because they
often use gtk_tree_list_row_get_item() and user code never tracks
changes to this property.

A side effect of this is that the item will survive until the row gets
destroyed, but that's what users expect anyway, so we can live with it.

Related: #5646
2023-03-19 06:55:05 +01:00
Benjamin Otte
9048e391b6 treelistmodel: Cache the item
This is a good idea to avoid reentrancy problems when any child model
(or potentially more than one child model) has started emitting
items-changed but the emission hasn't arrived in this model yet.

At tat point, we'd get_item() the wrong item from those models.

We want to avoid such cases of reentrancy.

Related: #5646
2023-03-19 06:55:05 +01:00
Benjamin Otte
f4be5c80c6 cssnode: Refer the correct previous item
We disconnect from old_previous, not from the new previous.

Related: #5646
2023-03-19 06:55:01 +01:00