Commit Graph

75686 Commits

Author SHA1 Message Date
Matthias Clasen
76ac91512b Deprecate gdk_surface_create_similar_surface
This function is part of the cairo drawing API and
we are moving away from that. Update all callers.
2023-04-01 23:09:19 -04:00
Matthias Clasen
afed6f92ef popover: Stop using gdk_surface_create_similar_surface
Just create the cairo image surface ourselves.
2023-04-01 23:08:36 -04:00
Matthias Clasen
b02729a58e Merge branch 'inspector-fractional-scale' into 'main'
Add gdk_surface_get_scale

See merge request GNOME/gtk!5769
2023-04-01 23:31:39 +00:00
Matthias Clasen
ed9f0c0eb8 inspector: Show surface scale
For Wayland surfaces, show the fractional scale
if we have it.
2023-04-01 19:11:00 -04:00
Matthias Clasen
075bea788b Add gdk_surface_get_scale
Add a scale property to GdkSurface and use the
fractional scale for it on Wayland.
2023-04-01 19:09:16 -04:00
Benjamin Otte
378df6556b Merge branch 'wip/otte/listitem-focus' into 'main'
GtkColumnView factories and focus rework

See merge request GNOME/gtk!5728
2023-04-01 19:33:00 +00:00
Matthias Clasen
d10e228ae0 inspector: Show the viewporter too 2023-04-01 14:53:12 -04:00
Benjamin Otte
4086913795 gtk-demo: Port to GtkColumnViewCell 2023-04-01 20:49:40 +02:00
Benjamin Otte
f5dea9a3c2 filechooserwidget: Port to ColumnViewCell 2023-04-01 20:49:40 +02:00
Benjamin Otte
5af3c2b2ec testcolumnview: Port to GtkColumnViewCell 2023-04-01 20:49:40 +02:00
Benjamin Otte
7a4ad81ed6 columnview: Add GtkColumnViewCell
This splits GtkListItem into 2 objects.

It is fully backwards compatible.

Using GtkListItem for GtkColumnView is now de-facto deprecated.
2023-04-01 20:49:40 +02:00
Benjamin Otte
e76d615d5f builderlistitemfactory: Allow subclasses
It's going to be used with the new GtkColumnViewCell objects, so that
it's backwards compatible with ui file factories that use GtkListItem.
2023-04-01 20:49:40 +02:00
Benjamin Otte
beba8be6b5 builder: Allow template parsing to be used with subclasses
Whenn setting gtk_builder_set_allow_template_parents(), the builder
instance will accept
  <template class="GtkWidget">
for a GtkBox instance.

It's going to be used with the new GtkColumnViewCell objects, so that
it's backwards compatible with ui file factories that use GtkListItem.
2023-04-01 20:49:40 +02:00
Benjamin Otte
170d49f067 columnviewcell: Ignore ::activatable and ::selectable for cells
This is a row property, not a cell property.
2023-04-01 20:49:40 +02:00
Benjamin Otte
c74ab7aaec columnviewcellwidget: Untangle from GtkListItemWidget
This is step 1 in switching cells to their own ListItem subclass.
2023-04-01 20:49:40 +02:00
Benjamin Otte
00cb4c66cf testdatatable: Add a --pages option
That way, local scrolling is available and the scrolling isn't random.

Recycling should now involve reordering the recycled widgets instead of
just keeping their order because all of them got recycled.
2023-04-01 20:49:40 +02:00
Benjamin Otte
708e067617 columnviewcellwidget: Ensure for_size is large enough
When clipping, we still need to do proper size requests.
2023-04-01 20:49:40 +02:00
Benjamin Otte
a29cf74e05 columnviewcellwidget: Rewrite width unadjusting
Use GtkCssBoxes for that purpose. No more scary CSS math necessary in
the widget.
2023-04-01 20:49:40 +02:00
Benjamin Otte
c760131f6f filechooser: Set a row-factory
This way, we can toggle per-row selectability and ensure files are not
selectable in select-folder mode.
2023-04-01 20:49:40 +02:00
Benjamin Otte
880aea513f columnview: Add gtk_column_view_add_row_factory()
This allows setting a factory to toggle per-row properties.

Implemented are selectable, focusable and activatable.
These are meant to supercede the per-cell selectable and activatable
properties, which make no sense individually.

The focus property makes it possible to focus rows instead of cells,
which is the default behavior.
2023-04-01 20:49:40 +02:00
Benjamin Otte
d1bc552b5f columnview: Implement inertness
This properly implements the same behavior as
62e9d1e470 and avoids randomly losing
factories.

Oops.
2023-04-01 20:49:40 +02:00
Benjamin Otte
e8f0aa6ef8 columnviewrowwidget: Don't discard items in unroot()
Follows 3411b0306ee3b88038abdc736adf60bd004c7b7a and
3fb10ff2d8.
2023-04-01 20:49:40 +02:00
Benjamin Otte
1a6afebbda columnview: Rename to GtkColumnViewCellWidget
Just like with Row/RowWidget, I want to use Cell/CellWidget.
2023-04-01 20:49:40 +02:00
Benjamin Otte
7cfab4edf2 columnview: Add GtkColumnViewRow
There is no way to set it yet, this is just to prove that it works.

It also changes the focus behavior of rows. They are now always
focusable - unless turned off by the factory once that is possible.
2023-04-01 20:49:40 +02:00
Benjamin Otte
04c049ee54 listitem: Add a backwards compatibility workaround
I want to avoid turning the :focusable property into a tristate at all
costs, but that third state is what we had before the property.
2023-04-01 20:49:40 +02:00
Benjamin Otte
5f1b8a31c2 treeexpander: Add docs note about setting GtkListItem::focusable 2023-04-01 20:49:40 +02:00
Benjamin Otte
87059d53a6 columnviewcell: Cells should not be focusable by default 2023-04-01 20:49:40 +02:00
Benjamin Otte
ce531ce280 listview: Add GtkListItem::focusable property
This makes the question if a listitem can be focused or not an explicit
decision by application developers.

Previously an item could be focused if it was selectable and no child or
grandchild was focusable - so if you put a label and icon into it, the
item was focusable, but if you put a GtkTreeExpander or a GtkButton into
it, the item wasn't. This needs to be decided explicitly now.

Technically this is an API break, because the previous behavior does not
exist anymore.
But I really don't want to make this a tristate (focusable, not
focusable, automatic), because then binding it to other things gets
hard, and because all the other focusable proeprties are booleans, too,
and working with them gets a lot harder.

Related: #3910
2023-04-01 20:49:40 +02:00
Benjamin Otte
eb0541c9d1 columnviewcell: Cells aren't selectable or activatable
Rows are.
2023-04-01 20:49:40 +02:00
Benjamin Otte
3048100617 listitem: Use GDK_DECLARE_INTERNAL_TYPE 2023-04-01 20:49:40 +02:00
Matthias Clasen
60921db76f Merge branch 'matthiasc/for-main' into 'main'
inspector: Update some misc info rows

See merge request GNOME/gtk!5768
2023-04-01 18:36:39 +00:00
Matthias Clasen
f7600a62e4 Merge branch 'wip/otte/fractional-cairo' into 'main'
wayland: Enable fractional scaling with the Cairo renderer

See merge request GNOME/gtk!5767
2023-04-01 18:35:33 +00:00
Georges Basile Stavracas Neto
70e6bcce16 Merge branch 'gbsneto/mildly-mid-vulkan-fixes' into 'main'
Vulkan transform / scale fixes

See merge request GNOME/gtk!5757
2023-04-01 18:23:12 +00:00
Matthias Clasen
a4dc0a74fd inspector: Update some misc info rows 2023-04-01 14:21:41 -04:00
Benjamin Otte
6d4d9af14e wayland: Use fractional scaling with the Cairo renderer
Cairo can do that, so just enable it:

 * Create surfaces with the correct fractionally scaled size.
 * Set the Cairo surface's device scale to that number.
2023-04-01 20:05:06 +02:00
Benjamin Otte
84b235aac1 wayland: Allow creating fractional Cairo surfaces
We don't do that yet, because the buffer scale code can't deal with it,
but we can do it now.
2023-04-01 20:05:05 +02:00
Benjamin Otte
ea82f50d13 build: Bump wayland-protocols requirement
The new fractional-scale support requires v1.31
2023-04-01 20:05:05 +02:00
Benjamin Otte
1a71e82fc5 wayland: Use wp_viewport to set buffer scale
Instead of setting the buffer scale via the buffer-scale command, set it
via the viewport.

This technically allows setting fractional scales, but we're not doing
that.
2023-04-01 20:05:01 +02:00
Georges Basile Stavracas Neto
f3b8bd8a98 gsk/gl/renderjob: Decompose matrix for 3D transforms
While this can be more expensive, it's also correct.
2023-04-01 14:47:29 -03:00
Georges Basile Stavracas Neto
ee1730dd49 gsk/vulkan/renderpass: Update scales from transform node
Retrieve the scale from the transform node, and store it as long
as the transform node is being visited. This applies the proper
scale to text nodes.
2023-04-01 14:47:29 -03:00
Georges Basile Stavracas Neto
e0aaf9bc83 gsk/vulkan/renderpass: Refactor scale
Instead of tracking a single scale, track x and y scales separately.
Factor out gsk_vulkan_render_pass_new() into a private function that
receives both scales, and pass 'scale_factor' for both.
2023-04-01 14:46:56 -03:00
Matthias Clasen
63318dcd66 NEWS: Updates 2023-04-01 12:38:38 -04:00
Benjamin Otte
8dd5d649b8 wayland: Use GdkFractionalScale for surface scale
We still always round it to integers when we read it, but we store it as a fraction.

So we could now use it for fractional scaling.
2023-04-01 18:23:38 +02:00
Benjamin Otte
40ac6f22a3 wayland: Introduce GdkFractionalScale type
We want to use it later for various things, this just adds the
infrastructure we will need.
2023-04-01 18:23:38 +02:00
Matthias Clasen
1262477e17 Merge branch 'always_expose_showing' into 'main'
a11y: Set ATSPI_STATE_SHOWING for all widgets, not only for windows

Closes #5194

See merge request GNOME/gtk!5738
2023-04-01 14:41:42 +00:00
Matthias Clasen
afe3f0ef0c Merge branch 'matthiasc/for-main' into 'main'
inspector: Improve display of paths

See merge request GNOME/gtk!5766
2023-04-01 14:14:31 +00:00
Matthias Clasen
258fb091dc inspector: Improve display of paths
The values in the path section are long and generally
ellipsized. It does not make sense to reserve extra
space that the labels don't need.
2023-04-01 09:52:31 -04:00
Matthias Clasen
7aca807b15 Merge branch 'wayland-details' into 'main'
inspector: Show Wayland protocols

See merge request GNOME/gtk!5765
2023-04-01 13:51:40 +00:00
Matthias Clasen
ffdbb9077c wayland: Some debug spew tweaks 2023-04-01 09:31:12 -04:00
Matthias Clasen
23268e84b3 inspector: Show Wayland protocols
This could be useful for somebody.
2023-04-01 09:31:12 -04:00