Commit Graph

75573 Commits

Author SHA1 Message Date
Benjamin Otte
c7499a33fd wayland: Use wl_compositor_get_version()
Wayland has functions to check versions, so use those.
2023-04-01 02:22:21 +02:00
Benjamin Otte
c97b489316 wayland: Use proper macro
Wayland has macros to check required versions. Use those instead of
custom ones.
2023-04-01 02:22:21 +02:00
Matthias Clasen
ce86ec5599 CODING-STYLE: Updates
We switched to using #pragma once in headers,
document that.
2023-03-31 20:17:12 -04:00
Matthias Clasen
27230ccb01 Merge branch 'pragma-once' into 'main'
Convert headers to #pragma once

See merge request GNOME/gtk!5759
2023-03-31 23:52:01 +00:00
Matthias Clasen
a1c5a806b3 Convert headers to #pragma once
The conversion was done by guard2one.
2023-03-31 15:11:10 -04:00
Georges Basile Stavracas Neto
b1a8c0e686 gsk/vulkan/renderpass: Factor out node implementations
This is mostly a cosmetic change, and the goal is twofold:

 1. Make it easier to spot unimplemented render node types; and
 2. Prepare for a small rework

The implementation for each node now lives in specific functions,
like the GL renderer; unlike the GL renderer, however, we use a
node type vtable to map GskRenderNodeType → implementation. Render
node without an implementation map to NULL, and use the fallback
implementation. Render nodes that fail any check and return FALSE
also use fallback implementation.
2023-03-31 14:00:33 -03:00
Benjamin Otte
515f39f161 Merge branch 'wip/otte/for-main' into 'main'
various fixes

See merge request GNOME/gtk!5756
2023-03-31 15:58:03 +00:00
Benjamin Otte
dbff49b5a7 listbase: Clear any newly set adjustments
The scrolling code assumes the adjustment values are up to date or
it crashes and before we've run size_allocate() we haven't update them.

Fixes a crash in the gtk-demo scrollinfo that would set the adjustments
with random values (via ScrolledWindow.set_child()) and then scroll in a
tick callback right before the (first) size_allocate().
2023-03-31 17:35:48 +02:00
Benjamin Otte
6f4175345f widget: Shortcut widget not repositioning
If a widget doesn't move positions during gtk_widget_reposition(),
detect it early.

This is especially beneficial in the inspector.
2023-03-31 17:35:48 +02:00
Matthias Clasen
bd29bed785 Merge branch 'gbsneto/easy-vulkan-fixes' into 'main'
Easy Vulkan cleanups and fixes

See merge request GNOME/gtk!5753
2023-03-31 13:25:30 +00:00
Alexander Shopov
cf2c955b12 Update Bulgarian translation
(cherry picked from commit 3458ebf8c9)
2023-03-31 10:04:32 +00:00
Matthias Clasen
ad8684431e Merge branch 'more-property-notification' into 'main'
filedialog: Make filters nullable

See merge request GNOME/gtk!5755
2023-03-31 01:54:52 +00:00
Matthias Clasen
4e17900b9a testsuite: Check more property notification
Handle more value types.
2023-03-30 21:39:55 -04:00
Matthias Clasen
fdce10fb96 Make adjustment setters behave 2023-03-30 21:39:55 -04:00
Matthias Clasen
3b96b053ad models: Fix up property notifications
We were emitting redundant notifications
for the ::model property.
2023-03-30 20:18:19 -04:00
Matthias Clasen
82b188c8fb filedialog: Make filters nullable
It should be possible to reset a property
to its default value.
2023-03-30 20:17:28 -04:00
Matthias Clasen
ef45004d14 Merge branch 'more-notify-tests' into 'main'
testsuite: Clean up some exclusions

See merge request GNOME/gtk!5752
2023-03-30 23:34:48 +00:00
Benjamin Otte
8566622748 Merge branch 'gbsneto/wayland-buffer-scale-creation' into 'main'
gdk/wayland/surface: Track and apply buffer scale

See merge request GNOME/gtk!5751
2023-03-30 21:59:45 +00:00
Matthias Clasen
577195a243 Make widget property setters behave
We want to allow setting a property to its
current value, while still having a precondition
for widget->parent being NULL otherwise.
2023-03-30 17:32:38 -04:00
Georges Basile Stavracas Neto
6e80c8b07e gdk/vulkancontext: Accept Khronos validation layers
The Lunarg validation layers seem to have been deprecated in favour
of the Khronos ones. There's no reason not to have both, to accept
loading both - simultaneously, even.
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
c85599e2e8 gsk/vulkanglyphcache: Cleanup maths
A trivial cleanup to match what the GL renderer does
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
981e94505c vulkan/glyphcache: Add padding around ink rect
This is what the GL renderer does, and it gets rid of the cutout
characters.
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
c0449e3245 gdk/vulkancontext: Pass all painted rects
Instead of passing a single, potentially massive rectangle that is
just the extents of the damage rect, collect and pass all damage
rects individually.
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
8217b6e484 gdk/wayland/surface: Track and apply buffer scale
Add a new flag to track whether buffer scale is dirty or not,
and centralize calling wl_surface_set_buffer_scale() in a single
place: gdk_wayland_surface_sync_buffer_scale().

gdk_wayland_surface_sync_buffer_scale() is only called by
gdk_wayland_surface_sync(), which itself is called by the GL,
Vulkan, and Cairo contexts, right before submitting a frame.
This ensure that each frame has an up-to-date buffer scale.

This mimics how opaque and input regions are tracked.
2023-03-30 16:32:50 -03:00
Matthias Clasen
2650c4e974 testsuite: Check more property notification
We can easily check some object types
such as widgets.
2023-03-30 14:13:19 -04:00
Matthias Clasen
87f9e8a4c1 testsuite: Clean up some exclusions
Drop some exclusions from the notify test.
The tests work fine for these objects.
2023-03-30 14:13:19 -04:00
Matthias Clasen
54b895341c listitem: Fix a notification problem
We were notifying ::item when ::child is
changed. Oops
2023-03-30 14:13:19 -04:00
Lukáš Tyrychtr
878b80806e a11y: Set ATSPI_STATE_SHOWING for all widgets, not only for windows
According to the at-spi2 docs, for a widget to be considered visible,
it needs both the showing and visible states. Many applications rely on that,
for example the flat review functionality of Orca.

this fixes #5194
2023-03-30 10:07:36 +02:00
Matthias Clasen
5ee0e19568 Merge branch 'matthiasc/for-main' into 'main'
emojichooser: Stop using gtk_widget_get_allocation

See merge request GNOME/gtk!5749
2023-03-30 02:45:56 +00:00
Matthias Clasen
fc573491b2 emojichooser: Stop using gtk_widget_get_allocation
Replace all uses with gtk_widget_compute_bounds.
2023-03-29 21:14:24 -04:00
Matthias Clasen
5e9405887e Merge branch 'fix-popover-positioning' into 'main'
wayland: Fix corner cases in positioning

See merge request GNOME/gtk!5741
2023-03-29 20:12:29 +00:00
Matthias Clasen
49778fda3e Merge branch 'matthiasc/for-main' into 'main'
Add some more keysyms tests

See merge request GNOME/gtk!5745
2023-03-29 12:05:58 +00:00
Matthias Clasen
dbefc330bd Add some more keysyms tests
Spot-check a few keypad symbols.
2023-03-29 07:35:24 -04:00
Matthias Clasen
31ebe42d2e testsuite: Update a test
cacecd2fb5 changed a warning message that
some tests check for. Oops.
2023-03-29 07:34:27 -04:00
Benjamin Otte
8fd526a194 Merge branch 'wip/otte/filechooser-fixes' into 'main'
filechooser fixes

See merge request GNOME/gtk!5746
2023-03-29 11:28:28 +00:00
Benjamin Otte
1449e487d3 Merge branch 'wip/otte/node-naming' into 'main'
node format: Allow naming textures and nodes

See merge request GNOME/gtk!5740
2023-03-29 11:28:15 +00:00
Benjamin Otte
889870546f filechoosercell: Remove position property
Instead, query the position from the listitem
2023-03-29 10:42:49 +02:00
Benjamin Otte
82e308b635 filechoosercell: Remove selected property
Instead, query the selected state from the listitem.
2023-03-29 10:42:49 +02:00
Benjamin Otte
0834dc50aa filechooser: Select via action
Don't fudge around poking through the listview, trying to get a model
and selecting it directly. Instead, use the proper way and activate the
"listitem.select" action.
2023-03-29 10:42:49 +02:00
Benjamin Otte
cbef6a9258 listbase: Select via action
Instead of directly calling select_item(), trigger the select-item
action of the focused child.

We do this convoluted calling into the widget because that way
GtkListItem::selectable gets respected, which is what one would expect.

Plus, this code is usually triggered via keybindings, and this way the
ListBase keybindings work identical to the ListItem keybindings.
2023-03-29 10:42:49 +02:00
Matthias Clasen
c5a53f235a Merge branch 'wip/otte/trelistmodel-fixage' into 'main'
treelistmodel: Don't add items in reverse

Closes #5707

See merge request GNOME/gtk!5744
2023-03-29 02:23:46 +00:00
Benjamin Otte
47ba29bc14 docs: Document additions to the node format 2023-03-29 03:53:52 +02:00
Benjamin Otte
9dd050ff30 testsuite: Add parsing tests for node and texture naming 2023-03-29 03:53:52 +02:00
Benjamin Otte
0d6a6a5997 rendernodeparser: Detect duplicates and print them by name
If we encounter a node or texture the 1st time and they are going
to be used again, give them a name.

Then, when encountering them again, print them by name instead
of duplicating them.
2023-03-29 03:53:52 +02:00
Benjamin Otte
5a0c4de07f rendernodeparser: Add support for reusing nodes
We extend the syntax for nodes from:
  <node-type> { ... }
to
  <node-type> { ... }
  <node-type> <string> { ... }
  <string>;
where the first is the same as before, the 2nd defines a named node and
the last references a previously defined node.
Or to give an example:
  color "node" {
    bounds: 0 0 10 10;
    color: red;
  }
  transform {
    bounds: 20 0 10 10;
    child: "node";
  }
This will draw the red box twice, once at (0,0) and once at
(20,0).

The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse nodes, in particular when
dealing with caches.
2023-03-29 03:53:52 +02:00
Benjamin Otte
348a68599a rendernodeparser: Add support for reusing textures
We extend the syntax for textures from just:
  <url>
to
  [<string>] <url>
  <string>
where the first defines a named texture while the second references a
texture.
Or to give an example:
  texture {
    bounds: 0 0 10 10;
    texture: "foo" url("foo.png");
  }
  texture {
    bounds: 20 0 10 10;
    texture: "foo";
  }
This will draw the texture "foo.png" twice, once at (0,0) and once at
(20,0).

The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse textures, in particular when
mixing them in texture and texture-scale nodes.
2023-03-29 03:53:52 +02:00
Benjamin Otte
8590b1ef11 rendernodeparser: Add a Context object
... and pass it through all the parsing functions.

So far it's unused, this is just the plumbing.
2023-03-29 03:53:52 +02:00
Benjamin Otte
d1f27c281d rendernodeparser: Split out a function
This code was copy/pasted, so unify it.
2023-03-29 03:53:52 +02:00
Benjamin Otte
76ff2f5410 rendernodeparser: Emit error when failing to resolve URL 2023-03-29 03:53:52 +02:00
Benjamin Otte
1605b07ff5 rendernodeparser: Failing to parse a string is an error
Testcase included.
2023-03-29 03:53:52 +02:00