Commit Graph

75150 Commits

Author SHA1 Message Date
Matthias Clasen
248027a366 Merge branch 'expose_error_message_relation' into 'main'
a11y: Expose GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE to AtSPI2

See merge request GNOME/gtk!5588
2023-03-05 16:08:38 +00:00
Benjamin Otte
c823432eef Merge branch 'wip/otte/listview2' into 'main'
listview: GtkListTile

See merge request GNOME/gtk!5584
2023-03-05 15:53:43 +00:00
Matthias Clasen
98ac2de649 Merge branch 'matthiasc/for-main' into 'main'
ci: Disable the testsuite in flatpak builds

See merge request GNOME/gtk!5593
2023-03-05 15:46:13 +00:00
Matthias Clasen
1cee54009a ci: Disable the testsuite in flatpak builds
No need to build the testsuite when we are
just producing flatpaks.
2023-03-05 07:26:17 -08:00
Benjamin Otte
80b7c60150 listbase: Remove nonexisting function from header 2023-03-05 15:23:20 +00:00
Benjamin Otte
e8c5a771e5 gridview: Add a filler tile for empty space
That stupid space in the bottom right when n_items isn't a multiple of
n_columns needs its own tile, or we'll get errors about not finding a
tile.

So make one.
2023-03-05 15:23:20 +00:00
Benjamin Otte
882dcda53b columnview: Clear the sorter first thing in dispose
Otherwise, when removing the columns, each column will trigger a
sorter::changed signal emission.

And because sorters are often still connected to a sortlistmodel, we
can't skip that emission and need to do it.
But we only need to do it once.
2023-03-05 15:23:20 +00:00
Benjamin Otte
b488fae893 listview: Handle emptying of views
The previous check does not longer work.

When a model gets all items deleted, there will still be existing tiles
until the next time garbage collection is run.
So do that before checking if the list is empty.
2023-03-05 15:23:20 +00:00
Benjamin Otte
b962defc11 listview: Remove an unused member variable
It's only used in the allocate function, so make it a local varaible
there.
2023-03-05 15:23:20 +00:00
Benjamin Otte
9ee0696923 listview: Simplify a vfunc
Instead of making it 2 vfuncs for getting horizontal and vertical area,
make it one vfunc to get the area.

Also rewrite the implementations to use the tile's area instead of
trying to deduce things with fancy math.
2023-03-05 15:23:20 +00:00
Benjamin Otte
f3c53ae69d listview: Simplify allocation
With the Tile changes, a lot of stuff does no longer need to be
duplicated between listview and gridview. Move it to ListBase instead.
2023-03-05 15:23:20 +00:00
Benjamin Otte
8aea6fc1b5 gridview: Remove an unused member variable
It's only used during size_allocate(), so make it a local variable
there.
2023-03-05 15:23:20 +00:00
Benjamin Otte
d949afb80e listitemmanager: Add a split vfunc and use it
Instead of randomly changing tiles, the listitemmanager gains a split
vfunc that listview and gridview implement so they can keep their tile
areas intact. The listitemmanager will now conform to these rules:

1. Never delete a tile.
   This ensures that all areas stay intact.

2. Never change the n_items of a tile other than setting them to 0.
   This causes "empty" areas to appear, but listview/gridview can
   easily check for them by checking for tile->n_items == 0.
   gtk_list_tile_gc() will get rid of them.

3. Adding items always creates new tiles that are added with empty area.
   That way they don't interrupt any existing machinery until the next
   allocation.

4. Adding/removing widgets has no effect on areas
   This is useful in particular when scrolling where new widgets are
   moving between tiles. When the manager moves the widgets, it may
   split some areas, but will not remove any existing tiles, so the
   whole area stays intact and the list can deal with further scroll
   events before an allocation.

This improve the situation for #3334
2023-03-05 15:23:20 +00:00
Benjamin Otte
08c583b1b3 listview: Add gc'ing
This is in preparation for the following reorg of the listitemmanager,
it should not have any effect now.
2023-03-05 15:23:20 +00:00
Benjamin Otte
1c663cb340 listitemmanager: Remove unused functionality
Both ListView and GridView use GtkListTile now, so no need anymore for
custom machinery.
2023-03-05 15:23:20 +00:00
Benjamin Otte
776910d03d gridview: Redo tile management
Instead of the custom size property, use the new tile size.

Also introduce the ability to split tiles, so that gridview can split a
layout that would look like (question mark denoting cells without a
widget, which in this case would be a single tile)

█ █ █ ? ?
? ? ? ? ?
? ? ? ? ?
? ? ?

into 3 rectangular tiles like so:

█ █ █ A A
B B B B B
B B B B B
C C C

This of course also means we need to be able to merge those tiles again
when cells got added/deleted or the gridview was resized. For that job,
gtk_list_tile_gc() exists now, which removes tiles without items and
merges adjacent tiles without widgets.
2023-03-05 15:23:20 +00:00
Benjamin Otte
c82b2d86c0 listview: Get rid of ListRow and its height
Use the tiles' area instead.
2023-03-05 15:23:20 +00:00
Benjamin Otte
3ca4acdc1a list: Allow storing size in the ListTile
... and use it to handle ListView allocations.

Nothing spectacular, just proof of concept.

The code introduces the idea that every tile stores its area (others
would call it "allocation", but I avoided that because tiles aren't
widgets). This should allow moving lots of code into gtklistbase.c and
not require special handling inside ListView and GridView.

And that in turn hopefully makes it easier to add more features (like
sections and so on.)
2023-03-05 15:23:20 +00:00
Benjamin Otte
c705dba2ee list: Make GtkListTile more prominent
* Instead of using a gpointer to refer to it, use the GtkListTile type.

* Use gtk_list_tile_get_foo() instead of
  gtk_list_item_manager_get_tile_foo() naming.
2023-03-05 15:23:20 +00:00
Benjamin Otte
55ad241f43 list: Rename GtkListItemManagerItem => GtkListTile
That's a good description for what the job of those elements is:
They're a tile in the lists scrollable area.
2023-03-05 15:23:20 +00:00
Benjamin Otte
d3efd80b90 rendernodepaintable: Allow the node to be NULL
This can happen when creating paintables from GtkSnapshot when nothing
was drawn.
2023-03-05 15:23:20 +00:00
Jordi Mas
a899c0af6e Update Catalan translation 2023-03-05 09:44:49 +01:00
Matthias Clasen
f8fb30b555 Post-release version bump 2023-03-04 13:47:37 -08:00
Matthias Clasen
47aa0dcc7f 4.10.0 2023-03-04 08:28:12 -08:00
Emmanuele Bassi
32f0723bf0 Merge branch 'ebassi/file-info-attributes' into 'main'
Check for attributes being available before querying them

See merge request GNOME/gtk!5592
2023-03-04 16:04:04 +00:00
Matthias Clasen
90a3584c1d Merge branch 'wip/otte/dont-scale-or-it-breaks' into 'main'
Add a test for lots of texture scaling and fix the fallout

See merge request GNOME/gtk!5509
2023-03-04 15:57:49 +00:00
Emmanuele Bassi
891b6dc4a9 Check for attributes being available before querying them
GLib 2.75 started checking if a GFileInfo was created with the attribute
we're querying, instead of failing silently and leaving us in an
inconsistent state.

Turns out that GtkFileChooserWidget, GtkFileSystemModel, and GtkPathBar
trip the newly introduced check.
2023-03-04 15:28:53 +00:00
Emmanuele Bassi
c6ff7400a8 Merge branch 'wip/chergert/fix-action-activation-crash' into 'main'
inspector: be defensive against out parameters

See merge request GNOME/gtk!5591
2023-03-04 15:16:59 +00:00
Emmanuele Bassi
6620b7de92 Merge branch 'ebassi/stack-page-fix' into 'main'
a11y: Fix GtkStackPage first accessible child

See merge request GNOME/gtk!5590
2023-03-04 15:16:34 +00:00
Aleksandr Melman
d58071b4c1 Update Russian translation 2023-03-04 15:05:45 +00:00
Piotr Drąg
f38df62e2b Update Polish translation 2023-03-04 15:59:29 +01:00
Benjamin Otte
0581e38b09 testsuite: Add a test for stripes
The GL renderer was creating sripes for nodes that were scaled in
particular ways, probably due to rounding errors.

This testsuite focuses on one of those stripes to make sure they are
gone.
2023-03-04 02:50:38 +01:00
Emmanuele Bassi
74a00319dd a11y: Use weak references for GtkATContext cached accessibles
The accessible objects already own the GtkATContext, let's avoid a
reference cycle.
2023-03-03 22:07:09 +00:00
Matthias Clasen
611788fb53 stack: Don't recreate at contexts in dispose
This is the same protection we have in
GtkWidgetAccessible.
2023-03-03 22:07:09 +00:00
Emmanuele Bassi
500128d186 a11y: Plug reference leaks
The gtk_accessible_get_at_context() getter is now transfer full, which
means we need to drop the reference when getting the GtkATContext.
2023-03-03 22:07:09 +00:00
Christian Hergert
32cf104167 inspector: be defensive against out parameters
Set initial state to NULL so that we don't risk accessing an unset out
parameter.

Fixes a crash when activating certain actions.
2023-03-03 12:17:32 -08:00
Emmanuele Bassi
9b98426e71 a11y: Simplify bookkeeping while iterating accessible children 2023-03-03 18:02:22 +00:00
Emmanuele Bassi
9820d25cf9 a11y: Fix GtkStackPage first accessible child
The first accessible child is the child widget of the GtkStackPage, not
the first child of the widget.
2023-03-03 18:02:22 +00:00
Benjamin Otte
8bbf220fdf testsuite: Add a test for large scale nodes
This test fails if we naively create fullscale
intermediate offscreens. This was fixed in the
previous commits.

This tests the fixes in 22ba6b1f33 (for
cairo) and 3a0152b65f (for GL).
2023-03-03 11:33:57 -06:00
Matthias Clasen
3a0152b65f gl: Respect clip wehn drawing scale nodes
Use the same approach and only create an offscreen
that is big enough for the clipped part of the scaled
texture.

If the clipped part is still too large for a single
texture, we give up and just render the texture without
filters (using the regular texture rendering code path
which supports slicing).

The following commit will add the texture-scale-magnify-10000x
test which fails without this fix.
2023-03-03 11:32:08 -06:00
Benjamin Otte
22ba6b1f33 rendernode: Respect clip when drawing scale nodes
Scale nodes can use large scale factors and we don't want to create
insanely huge Cairo surfaces.

A subsequent commit will add the texture-scale-magnify-10000x
test which fails without this fix.
2023-03-03 11:31:31 -06:00
Benjamin Otte
718b5d5fe7 rendernode: Clarify some Cairo stuff
Split out a function to make it more obvious what's going on.
2023-03-03 11:24:46 -06:00
Benjamin Otte
88dd64551c rendernode: Don't do unnecessary stuff
Cairo surfaces are created transparent.

And even if they weren't, overdrawing with transparency wouldn't erase
what's in the surface because it's a no-op.

It would require CAIRO_OPERATOR_CLEAR or CAIRO_OPERATOR_SOURCE.
2023-03-03 11:24:46 -06:00
Benjamin Otte
98eac8ac83 Fixes for gdk_memory_texture_new_subtexture checks
There were several mistakes here.
2023-03-03 11:24:46 -06:00
Changwoo Ryu
dbb2cb22ca Update Korean translation 2023-03-03 15:36:03 +00:00
Lukáš Tyrychtr
71dbb5090e a11y: Expose GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE to AtSPI2
Also, update the AtSPI2 relations to match the 1.26 version of AtSPI2.
2023-03-03 15:15:59 +01:00
Matthias Clasen
4b46097748 Merge branch 'ebassi/accessible-transfer-full' into 'main'
Mark Accessible getters as transfer full

Closes #5615

See merge request GNOME/gtk!5586
2023-03-03 09:46:51 +00:00
Emmanuele Bassi
eb0f33d76b Mark Accessible getters as transfer full
GtkAccessible implementations in C can get away returning objects just
by shuffling pointers around, but higher level languages prefer using
full ownership transfer in virtual functions.

Fixes: #5615
2023-03-03 02:13:26 +00:00
Emmanuele Bassi
828f686fc9 Merge branch 'expose_details_relation' into 'main'
a11y: Expose GTK_ACCESSIBLE_RELATION_DETAILS to at-spi2

See merge request GNOME/gtk!5580
2023-03-03 01:55:48 +00:00
Emmanuele Bassi
681f8bed19 Merge branch 'fix_section_role' into 'main'
a11y: Fix mapping of GTK_ACCESSIBLE_ROLE_PRESENTATION

See merge request GNOME/gtk!5576
2023-03-03 01:54:51 +00:00