gtk4.git
2 years agotests: mark headless tests as flaky
Jeremy Bícha [Tue, 8 Aug 2023 18:50:05 +0000 (14:50 -0400)]
tests: mark headless tests as flaky

See baaa7482489b0f7446ef1e0130e527a169c43b0c

Gbp-Pq: Name tests-mark-headless-tests-as-flaky.patch

2 years agoRevert "build: Drop the install-tests option"
Jeremy Bicha [Thu, 12 Jan 2023 13:47:54 +0000 (08:47 -0500)]
Revert "build: Drop the install-tests option"

Debian and Ubuntu uses these installed tests as part of their
autopkgtest system

This reverts commit 3121f88265ac61733e257f5335473d6f139f158c.

Gbp-Pq: Name Revert-build-Drop-the-install-tests-option.patch

2 years agoRevert "tests: Stop copying the tool tests"
Jeremy Bicha [Mon, 5 Jun 2023 17:49:20 +0000 (13:49 -0400)]
Revert "tests: Stop copying the tool tests"

This reverts commit bb3a6214cbeaa3211be007192e536bd473323836.

This is actually used by the installed tests
which we also had to revert dropping (in a separate patch)

Gbp-Pq: Name Revert-tests-Stop-copying-the-tool-tests.patch

2 years agogsk: Always use RGBA on big-endian architectures
Simon McVittie [Fri, 8 Dec 2023 16:42:56 +0000 (16:42 +0000)]
gsk: Always use RGBA on big-endian architectures

The memorytexture test started failing on big-endian CPUs while using
"desktop" GL (not GLES) in commit b0e26873 "gsk: Use has_bgra in more
places". The subsequent commit f5812808 "gsk: Restore bigendian support"
was meant to fix this, but it seems it did not.

Always taking the RGBA code-path on big-endian might not be optimal,
but it seems to result in the test passing again.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/6260
Bug-Debian: https://bugs.debian.org/1057782
Forwarded: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6653

Gbp-Pq: Name gsk-Always-use-RGBA-on-big-endian-architectures.patch

2 years agoRelease to unstable
Simon McVittie [Fri, 8 Dec 2023 17:37:01 +0000 (17:37 +0000)]
Release to unstable

2 years agoAdd proposed patch to fix test failure on big-endian CPUs
Simon McVittie [Fri, 8 Dec 2023 17:36:18 +0000 (17:36 +0000)]
Add proposed patch to fix test failure on big-endian CPUs

Closes: #1057782
2 years agoBuild-Depend on dh-sequence-gnome
Jeremy Bícha [Mon, 27 Nov 2023 16:04:17 +0000 (11:04 -0500)]
Build-Depend on dh-sequence-gnome

used by Ubuntu to pull in dh_translations

2 years agoreleasing package gtk4 version 4.12.4+ds-1
Jeremy Bícha [Mon, 27 Nov 2023 15:59:13 +0000 (10:59 -0500)]
releasing package gtk4 version 4.12.4+ds-1

2 years agoNew upstream release
Jeremy Bícha [Mon, 27 Nov 2023 15:26:33 +0000 (10:26 -0500)]
New upstream release

2 years agoUpdate upstream source from tag 'upstream/4.12.4+ds'
Jeremy Bícha [Mon, 27 Nov 2023 15:26:33 +0000 (10:26 -0500)]
Update upstream source from tag 'upstream/4.12.4+ds'

Update to upstream version '4.12.4+ds'
with Debian dir bb344c20763a3a49aa1f106346878e34b17e38e0

2 years agoNew upstream version 4.12.4+ds
Jeremy Bícha [Mon, 27 Nov 2023 15:26:21 +0000 (10:26 -0500)]
New upstream version 4.12.4+ds

2 years ago4.12.4
Matthias Clasen [Fri, 17 Nov 2023 20:23:43 +0000 (15:23 -0500)]
4.12.4

2 years agoFix warnings when compiling with -pedantic
madmurphy [Wed, 15 Nov 2023 23:00:41 +0000 (23:00 +0000)]
Fix warnings when compiling with -pedantic

2 years agoAdd a debug node for CSS outlines
Benjamin Otte [Sun, 12 Nov 2023 11:55:59 +0000 (12:55 +0100)]
Add a debug node for CSS outlines

All the other CSS render operations have one, so outlines should, too.

This was found by tracking down a random border node in a rendering.

2 years agogtk: fix NULL pointer dereference
Andy Holmes [Mon, 13 Nov 2023 20:05:31 +0000 (12:05 -0800)]
gtk: fix NULL pointer dereference

`gtk_window_get_default_size()` claims width/height are optional-out
arguments, but defers to `gtk_window_get_remembered_size()` which
may dereference a NULL-pointer.

Since `gtk_window_get_remembered_size()` is only called by
`gtk_window_get_default_size()`, collapse it into the latter
and perform the NULL check there.

2 years agoinspector: Replace "no glyph" with space glyph
Benjamin Otte [Wed, 1 Nov 2023 20:57:16 +0000 (21:57 +0100)]
inspector: Replace "no glyph" with space glyph

This makes right-aligning the text work again.

2 years agoinspector: Use the right font for the fps overlay
Benjamin Otte [Wed, 1 Nov 2023 20:26:11 +0000 (21:26 +0100)]
inspector: Use the right font for the fps overlay

Initialize the font only when we have a widget that provides it. That
way we don't pick a terrible default font, but the widget's preferred
one.

2 years agoSome minor fpsoverlay improvements
Matthias Clasen [Wed, 1 Nov 2023 18:45:57 +0000 (14:45 -0400)]
Some minor fpsoverlay improvements

Avoid some allocations.

2 years agoinspector: Speed up the fps overlay
Matthias Clasen [Wed, 1 Nov 2023 17:55:29 +0000 (13:55 -0400)]
inspector: Speed up the fps overlay

Do less work!

2 years agodocs: Replace deprecated gtk_widget_show with gtk_widget_set_visible
Robert Ancell [Tue, 31 Oct 2023 00:27:26 +0000 (13:27 +1300)]
docs: Replace deprecated gtk_widget_show with gtk_widget_set_visible

2 years agogl: Fix padding in icon library
Benjamin Otte [Wed, 25 Oct 2023 19:12:23 +0000 (21:12 +0200)]
gl: Fix padding in icon library

The previous code would not pad the left side with the left column of
pixels but with the top row.

Test attached.

2 years agogsk: Fix texture-scale node Cairo drawing
Benjamin Otte [Fri, 27 Oct 2023 18:45:12 +0000 (20:45 +0200)]
gsk: Fix texture-scale node Cairo drawing

The code was interpreting x/y coordinates wrong sometimes and causing
things to not be drawn at the correct offset.

Testcase included.

2 years agorendernode-tool: Add --undecorated to show command
Benjamin Otte [Wed, 25 Oct 2023 18:31:01 +0000 (20:31 +0200)]
rendernode-tool: Add --undecorated to show command

This is to get exactly just the rendernode drawn when testing, and not
any extra drawing code.

2 years agowidget-factory: Remove insert-image icon
Kleis Auke Wolthuizen [Sat, 28 Oct 2023 17:47:33 +0000 (19:47 +0200)]
widget-factory: Remove insert-image icon

This icon is already present in the hicolor icon theme.

2 years agowidget-factory: Remove view-grid-symbolic icon
Kleis Auke Wolthuizen [Sat, 28 Oct 2023 17:46:47 +0000 (19:46 +0200)]
widget-factory: Remove view-grid-symbolic icon

No longer needed as it's included in the hicolor icon theme now.

2 years agoicons: Add view-grid-symbolic
Kleis Auke Wolthuizen [Sat, 28 Oct 2023 17:42:30 +0000 (19:42 +0200)]
icons: Add view-grid-symbolic

This showed up as missing icon in the file chooser when used with
the hicolor icon theme.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/6184

2 years agoAdjust tests
Lukáš Tyrychtr [Thu, 19 Oct 2023 15:08:57 +0000 (17:08 +0200)]
Adjust tests

2 years agoa11y: When using rule 2.E for computing accessible name, use it only if appropriate
Lukáš Tyrychtr [Thu, 19 Oct 2023 13:56:38 +0000 (15:56 +0200)]
a11y: When using rule 2.E for computing accessible name, use it only if appropriate

We were using it in all cases, so, we were using it to compute descriptions,
and also for non-embedded controls. That was overriding descriptions
set, for example, in Gnome settings, and was causing the value of spinboxes
to be read multiple times.

2 years agobuilds: Require -Zc:preprocessor for Visual Studio debug builds
Chun-wei Fan [Tue, 24 Oct 2023 06:54:19 +0000 (14:54 +0800)]
builds: Require -Zc:preprocessor for Visual Studio debug builds

This flag is actually required for the debugging code to successfully build,
so check that it is really there for debug-enabled Visual Studio builds.

2 years agoMSVC Builds: Don't enable -utf-8 explicitly
Chun-wei Fan [Mon, 19 Jun 2023 04:48:28 +0000 (12:48 +0800)]
MSVC Builds: Don't enable -utf-8 explicitly

We already require a Meson release that enables -utf-8 by default, so we don't
really need to explicitly enable it here.

2 years agobuild: Add msvc_recommended_pragmas.h
Chun-wei Fan [Mon, 19 Jun 2023 04:31:16 +0000 (12:31 +0800)]
build: Add msvc_recommended_pragmas.h

We really always want to force-include msvc_recommended_pragmas.h to check for
things at compile time so that we can avoid stuff like missing includes or
attempting to return a value in a function that is supposed to have a
void-return-type.

The current problem is that, as indicated in the Visual Studio CI job, that we
couldn't locate msvc_recommended_pragmas.h during the build if GLib is built
as a subproject, and/or when msvc_recommended_pragmas.h is not in the paths
indicated by %INCLUDE%, meaning that the aforementioned issues would not be
caught by CI, which will then break builds on Visual Studio for people when
msvc_recommended_pragmas.h is found during their builds.

It would also be nice to be quiet from the warnings that we can really
disregard anyways.

So, add a copy of msvc_recommended_pragmas.h from GLib and update the build
files to look for it in build-aux/msvc, so that it can always be used during
the build, especially by the CI.

2 years agoFix swizzle values for some memory formats
Matthias Clasen [Thu, 26 Oct 2023 01:39:52 +0000 (21:39 -0400)]
Fix swizzle values for some memory formats

For opaque formats with 3 channels, we should use the default
GL_ALPHA, but for opaque formats with an ignored 4th channel,
we must use GL_ONE.

2 years agotranslated bn.po and hi.po
sudip [Tue, 24 Oct 2023 10:50:24 +0000 (16:20 +0530)]
translated bn.po and hi.po

Resolves:https://gitlab.gnome.org/GNOME/gtk/-/issues/6164

2 years agogl: Remove optimization that does the wrong thing
Benjamin Otte [Mon, 23 Oct 2023 23:17:43 +0000 (01:17 +0200)]
gl: Remove optimization that does the wrong thing

Drawing a texture-scale node like a texture node when the filter is set
to "linear" doesn't work, because the texture node switches to
trilinear when mipmaps are available.

2 years agogl: Make sure render_texture() sets the right format for high depth
Benjamin Otte [Mon, 23 Oct 2023 19:21:03 +0000 (21:21 +0200)]
gl: Make sure render_texture() sets the right format for high depth

Setting the format got lost when converting this coe to the texture
builder, because that codepaths avods the texture sniffing and always
uses RGBA8.

2 years agogdk: Make float32 report its true depth
Benjamin Otte [Mon, 23 Oct 2023 19:20:31 +0000 (21:20 +0200)]
gdk: Make float32 report its true depth

I have no idea how this is the only value that is wrong.

2 years agoRelease to unstable
Simon McVittie [Fri, 17 Nov 2023 11:06:41 +0000 (11:06 +0000)]
Release to unstable

2 years agod/control: Use ${gir:Provides} to generate virtual package names
Simon McVittie [Fri, 17 Nov 2023 11:06:22 +0000 (11:06 +0000)]
d/control: Use ${gir:Provides} to generate virtual package names

2 years agod/control: Add ${gir:Depends} to -dev package
Simon McVittie [Fri, 17 Nov 2023 11:06:07 +0000 (11:06 +0000)]
d/control: Add ${gir:Depends} to -dev package

This will add dependencies on gir1.2-pango-1.0-dev and so on.

2 years agod/control: Add more gir1.2-x-y-dev build-dependencies
Simon McVittie [Wed, 15 Nov 2023 12:02:59 +0000 (12:02 +0000)]
d/control: Add more gir1.2-x-y-dev build-dependencies

Gbp-Dch: ignore

2 years agod/control: Build-depend on relevant gir1.2-*-dev virtual packages
Simon McVittie [Tue, 14 Nov 2023 10:05:55 +0000 (10:05 +0000)]
d/control: Build-depend on relevant gir1.2-*-dev virtual packages

This will help with eventually converting some or all of them into real
packages, to allow GIR XML to be omitted when cross-compiling or
bootstrapping.

2 years agoUpdate Russian translation
Artur S0 [Sat, 4 Nov 2023 02:05:59 +0000 (02:05 +0000)]
Update Russian translation

2 years agoMerge branch 'invalid-client-rects-4-12' into 'gtk-4-12'
Luca Bacci [Fri, 3 Nov 2023 21:23:50 +0000 (21:23 +0000)]
Merge branch 'invalid-client-rects-4-12' into 'gtk-4-12'

[4.12] GdkWin32: ignore invalid client rects

See merge request GNOME/gtk!6545

2 years agoGdkWin32: ignore invalid client rects
G.Willems [Tue, 19 Sep 2023 18:29:04 +0000 (20:29 +0200)]
GdkWin32: ignore invalid client rects

Gdk-Win32 uses GetClientRect() internally to query the surfaces coordinates,
but this API may fail in some transient contexts (observed when iconifying
a maximized window).
Check if the rect area is null, and don't update the surface position in
that case. This will keep the current surface size, until Win32 notifies
the new valid window state later.
This prevents using a nulled next_layout for toplevel size computation,
which would break widgets allocation once notified on gtk side.

Fixes #5724
Closes #5724

2 years agoRelease to unstable
Simon McVittie [Thu, 2 Nov 2023 14:48:48 +0000 (14:48 +0000)]
Release to unstable

2 years agolbgtk-4-dev: Add Provides for included GIR XML files
Simon McVittie [Thu, 2 Nov 2023 14:34:52 +0000 (14:34 +0000)]
lbgtk-4-dev: Add Provides for included GIR XML files

Representing these by systematic names gir1.2-*-dev, and perhaps
eventually separating them into their own binary package, will help to
enable cross-compilation with GObject-Introspection removed by a build
profile.

Helps: #1030223

2 years agod/rules: Remove remnants of generating d/control from d/control.in
Simon McVittie [Thu, 2 Nov 2023 14:26:53 +0000 (14:26 +0000)]
d/rules: Remove remnants of generating d/control from d/control.in

2 years agod/rules: Stop generating d/control.in from d/control
Simon McVittie [Thu, 2 Nov 2023 14:24:42 +0000 (14:24 +0000)]
d/rules: Stop generating d/control.in from d/control

The variable substitutions obscured more than they really helped.

2 years agoSubstitute GTK_BINVER_DEP as a substvar rather than using sed
Simon McVittie [Thu, 2 Nov 2023 14:22:54 +0000 (14:22 +0000)]
Substitute GTK_BINVER_DEP as a substvar rather than using sed

This will make it easier to stop making d/control a generated file.

2 years agoMerge branch 'wip/chergert/for-4-12' into 'gtk-4-12'
Matthias Clasen [Tue, 31 Oct 2023 21:35:51 +0000 (21:35 +0000)]
Merge branch 'wip/chergert/for-4-12' into 'gtk-4-12'

cherry-pick bgra/vertex-array checks to 4.12

See merge request GNOME/gtk!6541

2 years agogsk: Use vertex arrays when we can
Matthias Clasen [Fri, 20 Oct 2023 01:43:35 +0000 (21:43 -0400)]
gsk: Use vertex arrays when we can

Use the new has_vertex_arrays api to determine
whether we can use vertex arrays in GL.`

Fixes: #6173
2 years agoglcontext: Add api to check for vertex arrays
Matthias Clasen [Fri, 20 Oct 2023 00:56:59 +0000 (20:56 -0400)]
glcontext: Add api to check for vertex arrays

Vertex arrays are available in GL and in GLES >= 3.

We don't check for the GLES extension that provided
vertex arrays in older GLES, since that requires
using different API.

This api avoids version checks all over the place.

2 years agogsk: Restore bigendian support
Matthias Clasen [Sun, 22 Oct 2023 20:19:31 +0000 (16:19 -0400)]
gsk: Restore bigendian support

Restore the bigendian support that was lost in b0e26873f66a8f52,
by just not using GL_BGRA with GLES on bigendian. Should be a
very rare combination, but still.

2 years agogsk: Use has_bgra in more places
Matthias Clasen [Fri, 20 Oct 2023 01:41:44 +0000 (21:41 -0400)]
gsk: Use has_bgra in more places

The glyph and icon libaries were also checking for GLES to
decide if data needs to be transformed from BGRA to RGBA.

Use the new has_bgra getter instead.

This will probably break on bigendian, because the
GL_BGRA + GL_UNSIGNED_BYTE combination is not equivalent
to the cairo format on bigendian, but this was already
broken for the gl format information that we get from
gdk_memory_format_gl_format.

2 years agoglcontext: Check for GL_EXT_texture_format_BGRA8888
Matthias Clasen [Thu, 19 Oct 2023 17:54:14 +0000 (13:54 -0400)]
glcontext: Check for GL_EXT_texture_format_BGRA8888

Check for this GLES extension and add a private getter.

2 years agoUpdate French translation
Guillaume Bernard [Mon, 23 Oct 2023 15:22:24 +0000 (15:22 +0000)]
Update French translation

2 years agoUpdate Turkish translation
Sabri Ünal [Sat, 21 Oct 2023 09:15:46 +0000 (09:15 +0000)]
Update Turkish translation

2 years agoMerge branch 'macos_ci' into 'gtk-4-12'
Matthias Clasen [Thu, 19 Oct 2023 16:18:53 +0000 (16:18 +0000)]
Merge branch 'macos_ci' into 'gtk-4-12'

Backport macOS CI to 4-12 to use new runner

See merge request GNOME/gtk!6497

2 years agogdk: Use subpixel_layout on macOS
René de Hesselle [Fri, 11 Aug 2023 17:13:58 +0000 (19:13 +0200)]
gdk: Use subpixel_layout on macOS

(cherry picked from commit 9aeb5be8ad91f83030f3c5e5bdd68a47b4b1a970)

2 years agogdk: Remove a leftover reference to the renamed variable prefers_high_depth
Jayson Reis [Sun, 23 Jul 2023 17:19:15 +0000 (19:19 +0200)]
gdk: Remove a leftover reference to the renamed variable prefers_high_depth

(cherry picked from commit aa888c0b3f775776fe3b71028396b7a8c6adb1d6)

2 years agoci: Backport CI yaml from main
René de Hesselle [Thu, 19 Oct 2023 14:22:54 +0000 (16:22 +0200)]
ci: Backport CI yaml from main

This makes the CI yaml identical to the one in main, which changes
two things:
- modernize workflow configuration
- use a new macOS runner for macOS CI

2 years agoUpdate Romanian translation
Florentina Mușat [Wed, 18 Oct 2023 18:14:42 +0000 (18:14 +0000)]
Update Romanian translation

2 years agoUpdate Spanish translation
Daniel Mustieles [Tue, 17 Oct 2023 15:09:53 +0000 (15:09 +0000)]
Update Spanish translation

2 years agoMerge branch 'no-emus-in-bitfields-4.12' into 'gtk-4-12'
Matthias Clasen [Tue, 17 Oct 2023 10:30:00 +0000 (10:30 +0000)]
Merge branch 'no-emus-in-bitfields-4.12' into 'gtk-4-12'

[4.12] Stop using enums in bitfields

See merge request GNOME/gtk!6491

2 years agoStop using enums in bitfields
Sergey Bugaev [Tue, 17 Oct 2023 08:40:51 +0000 (11:40 +0300)]
Stop using enums in bitfields

The C standard does not specify whether the underlying type of an enum
is signed or unsigned, and until C23 there was no way to control this
explicitly. GCC appears to make enums unsigned unless there is a
negative value among cases of the enum, in which case it becomes signed.
MSCV appears to make enums signed by default.

A bitfield of an enum type (which is not specificied in the C standard
either) behaves as if it was an instance of a numeric type with a
reduced value range. Specifically, a 'signed int val : 2;' bitfield will
have the possible values of -2, -1, 0, and 1, with the usual wraparound
behavior for the values that don't fit (although this too is
implementation-defined).

This causes the following issue, if we have:

typedef enum
{
  GTK_ZERO,
  GTK_ONE,
  GTK_TWO
} GtkFoo;

struct _GtkBar
{
  GtkFoo foo : 2;
};

and then assign bar.foo = GTK_TWO and read it back, it will have the
expected value of 2 (aka GTK_TWO) on GCC, but a value of -2 (not
matching any of the enum variants) on MSVC.

There does not seem to be any way to influence signedness of an enum
prior to C23, nor is there a 'unsigned GtkFoo foo : 2;' syntax. The only
remaining options seems to be never using enums in bitfields, which is
what this change implements.

In practice, this fixes GdkPipeIOStream crashing with an assertion when
trying to copy-paste in-app in MSVC builds on GTK.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agoUpdate Russian translation
Artur S0 [Mon, 16 Oct 2023 11:56:09 +0000 (11:56 +0000)]
Update Russian translation

2 years agoUpdate Turkish translation
Sabri Ünal [Sat, 14 Oct 2023 07:06:07 +0000 (07:06 +0000)]
Update Turkish translation

2 years agoreleasing package gtk4 version 4.12.3+ds-1
Jeremy Bícha [Thu, 5 Oct 2023 01:53:05 +0000 (21:53 -0400)]
releasing package gtk4 version 4.12.3+ds-1

2 years ago* debian/changelog: Mention bug fixes for 4.12.3 from upstream NEWS.
Amin Bandali [Wed, 4 Oct 2023 21:41:30 +0000 (17:41 -0400)]
* debian/changelog: Mention bug fixes for 4.12.3 from upstream NEWS.

2 years agoNew upstream release
Amin Bandali [Wed, 4 Oct 2023 20:11:12 +0000 (16:11 -0400)]
New upstream release

2 years agoUpdate upstream source from tag 'upstream/4.12.3+ds'
Amin Bandali [Wed, 4 Oct 2023 20:11:12 +0000 (16:11 -0400)]
Update upstream source from tag 'upstream/4.12.3+ds'

Update to upstream version '4.12.3+ds'
with Debian dir 24db8d6ef94eb48755b60abcf4a00ec1468721df

2 years agoNew upstream version 4.12.3+ds
Amin Bandali [Wed, 4 Oct 2023 20:10:45 +0000 (16:10 -0400)]
New upstream version 4.12.3+ds

2 years agoUpdate Catalan translation
Jordi Mas i Hernandez [Tue, 3 Oct 2023 06:55:50 +0000 (06:55 +0000)]
Update Catalan translation

2 years agoPost-release version bump
Matthias Clasen [Thu, 28 Sep 2023 12:23:37 +0000 (08:23 -0400)]
Post-release version bump

2 years ago4.12.3
Matthias Clasen [Thu, 28 Sep 2023 12:03:14 +0000 (08:03 -0400)]
4.12.3

2 years agoprint portal: Report errors properly
Matthias Clasen [Wed, 27 Sep 2023 21:25:42 +0000 (17:25 -0400)]
print portal: Report errors properly

The portal printoperation inmplementation
relies on the file printbackend to be available.
If it isn't, we should report a proper error
status insetad of running into assertions deep
inside the printoperation code.

2 years agogsk/gl: remove TypeNode conformity checking for renderjob
Christian Hergert [Wed, 27 Sep 2023 01:36:22 +0000 (18:36 -0700)]
gsk/gl: remove TypeNode conformity checking for renderjob

We don't need to be calling type node conformity checking from the tight
loop of the renderjob. Hoist that into the private header and use that
intead through via the Class pointer.

2 years agogsk: remove excessive type checking within GSK
Christian Hergert [Wed, 27 Sep 2023 01:28:11 +0000 (18:28 -0700)]
gsk: remove excessive type checking within GSK

Anything that includes gskrendernodeprivate.h will get an alternate form
of ref/unref for render nodes which does not need to do type checking on
the parameter. We can expect that things are correct within GTK itself and
this saves excessive amounts of TypeNode conformities checking.

2 years agoprintoperation: fix some strange line spacing
Michael Catanzaro [Wed, 27 Sep 2023 00:28:12 +0000 (19:28 -0500)]
printoperation: fix some strange line spacing

2 years agoprintoperation: add some assertions
Michael Catanzaro [Wed, 27 Sep 2023 00:25:41 +0000 (19:25 -0500)]
printoperation: add some assertions

Let's assert that we schedule the idle callback exactly once.

These assertions are not perfect because if the callback executes before
we schedule it, then the assertion itself would be a use-after-free,
since I'm using the PrinterFinder to track whether the callback that
frees it has been scheduled. But in practice when using loupe's print
dialog, I was noticing the callback scheduled twice before it was
executed. The assertion would have caught this problem.

2 years agoprintoperation: fix another case where operation may complete twice
Michael Catanzaro [Tue, 26 Sep 2023 23:52:37 +0000 (18:52 -0500)]
printoperation: fix another case where operation may complete twice

This is a little tricky. At first, I thought we had a codepath where we
fail to schedule the idle that completes the print operation: if we take
the gtk_print_backend_printer_list_is_done path for each printer
backend, then printer_list_done_cb() is never executed and we never
schedule the idle. But in fact, in this case, then backends == NULL at
the bottom of find_printer(), and we'll schedule the idle there, so it's
OK. Except it's not really OK, because we'll schedule it even if a
printer was already found, resulting in the callback completing twice
and a double free.

Simplify this. Schedule the idle in find_printer() only if there are
*initially* no backends, not also if all backends are immediately ready
and already removed from consideration. Instead, always call
printer_list_done_cb() for every backend in find_printer_init(). After
the previous commit, printer_list_done_cb() will schedule the idle when
appropriate.

printer_list_done_cb() additionally disconnects signals that we did not
connect in this codepath, but it does so using
g_signal_handlers_disconnect_by_func, which is harmless. Otherwise, the
only extra work it's doing is scheduling the idle, and that's exactly
what find_printer_init() is missing.

2 years agoprintoperation: fix case where operation may complete multiple twice
Michael Catanzaro [Tue, 26 Sep 2023 23:47:01 +0000 (18:47 -0500)]
printoperation: fix case where operation may complete multiple twice

If we are the final backend, then after removing ourselves there is no
backend remaining. We will schedule the idle even if it has already been
scheduled. This idle is required to run exactly once and executing it
twices results in a double free that crashes loupe when printing. It
also causes the user callback to execute twice, which could cause
similar problems.

Fixes #6122

2 years agogsk/gl: use GdkArrayImpl for tracking modelview
Christian Hergert [Tue, 26 Sep 2023 20:21:06 +0000 (13:21 -0700)]
gsk/gl: use GdkArrayImpl for tracking modelview

Like the previous change, this uses GdkArrayImpl instead of GArray for
tracking modelview changes. This is less important than clip tracking
simple due to being used less, but it keeps the implementation synchronous
with the Clip tracking code.

2 years agogsk/gl: use GdkArrayImpl for Clip tracking
Christian Hergert [Tue, 26 Sep 2023 20:08:45 +0000 (13:08 -0700)]
gsk/gl: use GdkArrayImpl for Clip tracking

We can end up spending a lot of time in g_array_maybe_expand() through the
use of g_array_set_size() for clip tracking. That is somewhat due to the
simple nature of GArray being size-dynamic. Instead, we can use
GdkArrayImpl and let the compiler do what it does best to elide some
work and hoist other work into the calling function.

This also fixes a potential UAF in gsk_gl_render_job_push_contained_clip().

2 years agogdk: add missing G_END_DECLS to gdkarrayimpl.c
Christian Hergert [Tue, 26 Sep 2023 17:46:21 +0000 (10:46 -0700)]
gdk: add missing G_END_DECLS to gdkarrayimpl.c

2 years agobroadway: Do not add an extra reference when caching textures
Emmanuele Bassi [Tue, 26 Sep 2023 13:44:05 +0000 (14:44 +0100)]
broadway: Do not add an extra reference when caching textures

We just created a GdkTexture, so we don't need to acquire a reference if
we're transferring the ownership to the node cache.

2 years agobroadway: Plug another leak
Emmanuele Bassi [Tue, 26 Sep 2023 13:40:37 +0000 (14:40 +0100)]
broadway: Plug another leak

When getting a colorized texture we're downloading the texture as a
Cairo surface, and then feeding it to another texture, but we never drop
the reference of the new surface.

2 years agodocs: Clarify the behaviour of gdk_texture_new_for_surface()
Emmanuele Bassi [Tue, 26 Sep 2023 11:57:52 +0000 (12:57 +0100)]
docs: Clarify the behaviour of gdk_texture_new_for_surface()

Cairo surfaces are not GObject instances, so we should be more explicit
in the behaviour of the memory management, to avoid leaks.

2 years agobroadway: Plug a leak in the GSK renderer
Emmanuele Bassi [Tue, 26 Sep 2023 11:49:32 +0000 (12:49 +0100)]
broadway: Plug a leak in the GSK renderer

We are leaking the Cairo image surface when creating a new node.

Fixes: #6120
2 years agoarray: Compute new size properly
Benjamin Otte [Wed, 20 Sep 2023 00:46:47 +0000 (02:46 +0200)]
array: Compute new size properly

Using "1 << x" means that we are shifting a signed 32bit integer, but we
want a gsize, which is an unsigned 64bit integer.

So now we don't overflow anymore if the array reaches a size of 2GB.

2 years agogdk: Fix compiler warning
Benjamin Otte [Tue, 29 Aug 2023 17:34:38 +0000 (19:34 +0200)]
gdk: Fix compiler warning

gcc's -Wlto-type-mismatch found the hack, where we copied the wrong
prototype.

2 years agotreeview: Fix crash in assertion
Benjamin Otte [Mon, 25 Sep 2023 20:10:53 +0000 (22:10 +0200)]
treeview: Fix crash in assertion

The fix in commit a267dfac5d25d4ba5c1a95c82999d008fee07ac3 is wrong.
The function can return FALSE in normal operation.

Instead do a check for node == NULL that gracefully returns FALSE instead.

Fixes: #6114
2 years agoImprove FOO_DEBUG=help output
Matthias Clasen [Sun, 24 Sep 2023 12:32:13 +0000 (08:32 -0400)]
Improve FOO_DEBUG=help output

Explain the all value a bit better.

2 years agodialog: Check header bar type before calling track_default_decoration()
Alice Mikhaylenko [Sun, 24 Sep 2023 11:22:36 +0000 (15:22 +0400)]
dialog: Check header bar type before calling track_default_decoration()

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6116

2 years agoheader-bar: Add a precondition to track_default_decoration()
Alice Mikhaylenko [Sun, 24 Sep 2023 11:21:43 +0000 (15:21 +0400)]
header-bar: Add a precondition to track_default_decoration()

2 years agogtk-demo: Fix a refcounting mishap
Matthias Clasen [Sat, 23 Sep 2023 11:47:09 +0000 (07:47 -0400)]
gtk-demo: Fix a refcounting mishap

gtk_font_dialog_button_new's argument is
transfer full.

Fixes: #6113
2 years agodocs: Mention for what GtkStringObject:string is useful
Emmanuele Bassi [Thu, 21 Sep 2023 14:28:37 +0000 (15:28 +0100)]
docs: Mention for what GtkStringObject:string is useful

2 years agodocs: Link GtkStringObject from GtkStringList
Emmanuele Bassi [Thu, 21 Sep 2023 14:27:35 +0000 (15:27 +0100)]
docs: Link GtkStringObject from GtkStringList

A frequently asked question is: "what is the object type inside a
GtkStringList", so let's make the answer more obvious.

2 years agodocs: Add a link to the DropDown:selected property
Emmanuele Bassi [Tue, 15 Aug 2023 10:06:36 +0000 (11:06 +0100)]
docs: Add a link to the DropDown:selected property

The main description is a bit too coy, and some newcomers don't
understand the concept of properties and notification.

2 years agoUpdate German translation
Jürgen Benvenuti [Tue, 26 Sep 2023 20:37:59 +0000 (20:37 +0000)]
Update German translation