For size -1 in the opposite orientation, GtkBoxLayout used to measure
the children based on their min size in the box's orientation instead of
-1. That wasn't really intended, but was a side effect of how the sizing
code did (not) distribute extra size above the minimum size.
This is clearly not what we want.
What we want is measuring the orientation as is for size -1. Then we
want to just take the maximum of all children and use that.
A reftest is incldued that ensures a vbox wraps a label just like an
hbox does.
The old code couldn't properly do height-for-width because it only
computed the widest and smallest layout instead of looking at the actual
passed in for-size.
The label-sizing reftest has been adapted as the label code is now smart
enough to always display the whole text and no longer requests a too
small width-for-single-row when wrapping.
This reverts commit ba44e7a228.
The change was meant to revert to old GTK3 behavior but it actually
broke new GTK4 behavior that is in use where max-width-chars is used to
determine an ideal size, but where we don't want to limit the width to
that size.
So what happens is the reintroduction of GTK3-style lots of whitepsace
bugs, and we really don't want those.
We also don't want to break backwards compat if we can avoid it.
So let's revert this.
The reftest that was made for this purpose has been adapted.
Fixes#4399
If a URL can't be loaded, we might end up with a NULL file. Handle that
case properly by creating an invalid image instead and don't crash or
complain to stderr when files are NULL.
This was broken since 0886ade182
A new reftest has been included. We need a reftest instead of a
CSS parser test, because the error only becomes visible when
compute()ing the actual image.
Fixes#4373
Have square images in the following sizes:
* 20
* 100
* 150
* 200
* 300
and place them in a can-shrink Picture allocated at the sizes:
* 200x100
* 100x200
and set align to center/center.
That's 10 combinations and they should all do the right thing.
This is supposed to test the most fallback GL stuff, so we might want to
set even more env vars here.
Also enable the run for the Fedora builder in CI.
We were only applying <binding> elements when the
object is constructed, which can be triggered by
various things (e.g. a <style> element). Defer
this until we reach </object>, so we can be sure
that we pick up all the bindings.
Testcase included.
Fixes: #4147
The GtkBuilder parser constructs the object e.g.
when handling a <binding> element. There may be
more <property> elements after it, which we were
just not applying. Fix that by always applying
property when we see </object>. To do that, we
need to track the applied status per property.
Test included.
Fixes: #4208
We don't want to allow new items to be grouped into a previous action
group after the end_user_action() is called. This ensures that we add a
barrier action in those conditions.
Fixes#4276
This change removes the assertions limiting replacement strings in the compose table to be less than 20 characters.
The limit seems arbitrary, is not required, will break some users' setups, and problems with it result in applications not launching.
Fixes#4273
We can't have other test pop up windows, and possibly
stealing focus and preventing us from getting data
offers. So, run the clipboard test in isolation.
Color values must be divisible by 15 to be convertible into U8 and U16
values with the same result. 0x80 is not one of these values, so switch
it to 0x99.
Tests that overdrawing of content inside an opacity node happens before
the opacity is applied.
This is broken in the GL renderer and causes the opacity.ui reftest to
fail.
This also switches the rendering code from using gsk_render_node_draw()
to gsk_renderer_render_texture().
Some tests are broken with the GL renderer, so this patch forces the
Cairo renderer until they get fixed.
The test used to test that GtkBox ordered it's children left-to-right in
CSS, no matter the text direction or pack-type.
But there is neither a pack-type anymore nor does GTK4 do that.
So that test has been broken for yers, it just didn't render anything
wrong.
This happens in the real world when using the inspector to look at a
node recording of a GStreamer video while the video is still playing.
GStreamer will use the GL context in a different thread while we are
busy trying to download it.
A test is included.
Use a GL renderer to upload textures (and then optionally download them
via release() again). This way, we can test that the GL renderer
properly uploads textures to the right formats (not losing information
for HDR for example) and downloads them again.
If the alpha channel is zero, it doesn't matter what the values of the
red, green and blue channels are: the pixel is still fully transparent.
On most architectures, fully transparent pixels end up all-zeroes
(fully transparent black), matching what's in the reference PNG file;
but on mips*el the blend-difference and blend-normal tests get all-ones
(fully transparent white) and a test failure.
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4227
Signed-off-by: Simon McVittie <smcv@debian.org>
This adds support for sequences like <Compose>,G,u -> capital G with
breve. Previously, only a capital U was accepted for E, G, I and O
(but a lower-case u was accepted for A and U for some reason).
Signed-off-by: Simon McVittie <smcv@debian.org>
We can use the new binding helpers to make this
a little less bothersome. That way, it will need
tweaks less often (only when new fundamental types
are introduced).
Update all the places where we switch over
PangoAttrType to handle PANGO_ATTR_TEXT_TRANSFORM,
and do nothing for now - text-transform support
will land in 4.6.
Our compose table format is still limited to 16bit
values for keysyms, but what we see in key events
can be 32bit values, and we treat them as such now.
Fixes: #4149
Remove the limitation on the number of dead keys
that we match, and allow the result be be multiple
characters.
Regenerate the builtin sequences, since this changes
what dead key sequences we can reproduce algorithmically.
Update tests to match.
Fixes: #10
Make gtk_check_algorithmically take a GString
for the result. This is in preparation for allowing
multi-character results here, in the future.
Update all callers.
Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.
Apply heuristics to avoid breaking users existing configurations
with the change to not always add the default sequences.
If we find a cache that was generated before 4.4, and the Compose
file does not have an include, and doesn't contain so many sequences
that it is probably a copy of the system one, we take steps to keep
things working, and thell the user about it.
All tables use the compact format now, and we generate
caches in that format too. Bump the cache version to 3
for this.
Replace the python script for generating the builtin table
by a small C program using the same code to generate the data
for the builtin table. This drops the restriction on only
generating a single character in the builtin sequences.
This lets us naturally replace matching sequences
while parsing. That means that the semantics are now
"last one wins" if the parser sees multiple entries
for the same sequence.
Add a testcase that checks the new replacement semantics.
Keep the list of composetables private to GtkIMContextSimple,
and just have an api that creates new GtkComposeTables, either
from a file or from data.
Update tests to use the new api.
We hardcoded the typelib directory for only an arch (and a distro),
while we can just get it from gobject-introspection pkg config if tests
are enabled.
This was comparing the included image-missing icon
with the one in the current icontheme on the test
system. Works fine as long as we don't change
the icons (which we just did). To avoid this, set
the icontheme to hicolor for this test, which does
not have the image-missing icon, so we end up getting
the builtin icon for both ui files.
If the session bus address is unset, GLib will
helpfully try to autolaunch a bus, which will
fail and timeout. If we set an empty address,
it gives up early.
Arrange things so that non-child parameters
are always printed before the children. This
greatly helps with readability, which really
suffers when there's hundreds of lines of indented
children between the node start and its parameters.
Update all affected tests.
This is a pet peeve of mine: When we call
g_test_init() before handling --generate,
the random seed spew pollutes the output.
Highly annoying. I've fixes many test binaries
over the years, but more keep popping up.
Compare clipped repeat nodes. Must skip cairo here
since it blurred the child by scaling after rendering.
Also skip the gl renderer, since it hasn't been fixed
for this yet. ngl passes this test.
It seems to make assumptions about text positioning that
are not holding with subpixel positioning. I'm not 100%
sure how that leads to exactly the artifacts that are seen
here, but I am just disabling the test until that is fully
understood.
It makes assumptions about text positioning that are
not holding with subpixel positioning. There is no
guarantee that the next word in a multi-word text
starts on an even pixel boundary, as it does when
you break the text into multiple, separately rendered
blocks.
We were not handling mnemonics vs markup right
in all cases. Rewrite the _-stripping code to
do it during the link parsing, instead of as
a separate function. This avoids the issue of
stripping _ from attribute names in markup.
Add tests.
Fixes: 3706
The primary goal here was to cleanup the current GL renderer to make
maintenance easier going forward. Furthermore, it tracks state to allow
us to implement more advanced renderer features going forward.
Reordering
This renderer will reorder batches by render target to reduce the number
of times render targets are changed.
In the future, we could also reorder by program within the render target
if we can determine that vertices do not overlap.
Uniform Snapshots
To allow for reordering of batches all uniforms need to be tracked for
the programs. This allows us to create the full uniform state when the
batch has been moved into a new position.
Some care was taken as it can be performance sensitive.
Attachment Snapshots
Similar to uniform snapshots, we need to know all of the texture
attachments so that we can rebind them when necessary.
Render Jobs
To help isolate the process of creating GL commands from the renderer
abstraction a render job abstraction was added. This could be extended
in the future if we decided to do tiling.
Command Queue
Render jobs create batches using the command queue. The command queue
will snapshot uniform and attachment state so that it can reorder
batches right before executing them.
Currently, the only reordering done is to ensure that we only visit
each render target once. We could extend this by tracking vertices,
attachments, and others.
This code currently uses an inline array helper to reduce overhead
from GArray which was showing up on profiles. It could be changed to
use GdkArray without too much work, but had roughly double the
instructions. Cycle counts have not yet been determined.
GLSL Programs
This was simplified to use XMACROS so that we can just extend one file
(gskglprograms.defs) instead of multiple places. The programs are added
as fields in the driver for easy access.
Driver
The driver manages textures, render targets, access to atlases,
programs, and more. There is one driver per display, by using the
shared GL context.
Some work could be done here to batch uploads so that we make fewer
calls to upload when sending icon theme data to the GPU. We'd need
to keep a copy of the atlas data for such purposes.
This is the only non-whitespace difference between the copies in
testsuite/reftests/ and testsuite/gsk/.
Signed-off-by: Simon McVittie <smcv@debian.org>
When we are rendering a texture node to an offscreen,
and we have a clip, we must force the offscreen rendering.
Otherwise, the code will notice: Hey, it already is a texture
node, so no need to render it to a texture again. But when
clipping is involved, that is exactly what we want to do.
Testcase included.
Fixes: #3651
This function was not doing the right thing.
Once we are doing the right thing and not compare
shadows as unequal, some reftests that inhibit
snapshots for a few frames now hang forever, since
we are no more redrawing unnecessarily. Fix that
with an explicit queue_draw.
Make it possible for gtk_compose_table_check to return
a string instead of just a single Unicode character.
Currently, we only ever return strings holding a single
character, still.