gtk4.git
2 years agogl: gradients should transition in unpremultiplied space
Benjamin Otte [Sun, 17 Sep 2023 04:26:16 +0000 (06:26 +0200)]
gl: gradients should transition in unpremultiplied space

So make the gradient shaders do that.

2 years agoinspector: Don't set a NULL fontdesc
Matthias Clasen [Sun, 17 Sep 2023 14:19:05 +0000 (10:19 -0400)]
inspector: Don't set a NULL fontdesc

The font dialog button does not like that.

Fixes: #5988
2 years agotreeview: No gcc, node is not NULL
Benjamin Otte [Sat, 16 Sep 2023 16:18:58 +0000 (12:18 -0400)]
treeview: No gcc, node is not NULL

... so I'll add an assertion just for you.

2 years agotreemodelfilter: Yes gcc, both if branches are empty
Benjamin Otte [Sat, 16 Sep 2023 16:17:57 +0000 (12:17 -0400)]
treemodelfilter: Yes gcc, both if branches are empty

... if assertions are disabled.

2 years agorender-node-tool: Actually load files properly
Benjamin Otte [Wed, 13 Sep 2023 18:35:02 +0000 (20:35 +0200)]
render-node-tool: Actually load files properly

2 years agogl: Change rounded_rect_shrink()
Benjamin Otte [Mon, 11 Sep 2023 03:17:56 +0000 (05:17 +0200)]
gl: Change rounded_rect_shrink()

The code now follows gsk_rounded_rect_shrink() and with it the behavior
of the Cairo renderer and Webkit.

The old code did what the GL renderer and Cairo do, but I consider that
wrong.

I did not test Chrome.

Test attached

2 years agocss: Snapshot opacity filter as opacity node
Benjamin Otte [Fri, 8 Sep 2023 17:05:11 +0000 (19:05 +0200)]
css: Snapshot opacity filter as opacity node

We were using color-matrix because it was easier, but opacity can often
be optimized when color-matrix needs offscreens.

2 years agoglrenderer: Shadows without offset do exist
Benjamin Otte [Thu, 7 Sep 2023 21:02:37 +0000 (23:02 +0200)]
glrenderer: Shadows without offset do exist

Not for opaque contents, but stuff can be semi-transparent.

Testcase included.

2 years agorendernode: Shadow nodes need offscreen for opacity
Benjamin Otte [Thu, 7 Sep 2023 20:57:57 +0000 (22:57 +0200)]
rendernode: Shadow nodes need offscreen for opacity

Otherwise the shadow will not be properly computed as opaque regions
become translucent after applying opacity.

Testcase included.

2 years agoswitch: Fix CSS nodes documentation
Sergey Bugaev [Thu, 14 Sep 2023 16:09:20 +0000 (19:09 +0300)]
switch: Fix CSS nodes documentation

A switch contains two GtkImage's whose nodes are named 'image',
not 'label'.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agoswitch: Respect text direction
Sergey Bugaev [Thu, 14 Sep 2023 16:04:24 +0000 (19:04 +0300)]
switch: Respect text direction

In RTL, we want the active state to mean the handle is on the left.

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

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agogl renderer: Don't assume an atlas
Matthias Clasen [Wed, 13 Sep 2023 20:56:47 +0000 (16:56 -0400)]
gl renderer: Don't assume an atlas

The source uniform may or may not point
to a glyph atlas. The optimization we do
for color nodes is only possible if it does,
so check this.

Fixes: #6094
2 years agogl renderer: Keep track of source
Matthias Clasen [Wed, 13 Sep 2023 20:55:01 +0000 (16:55 -0400)]
gl renderer: Keep track of source

We have an optimization that depends on having
the source be a glyph atlas, so keep track of
that information in the render job.

2 years agorendernode: Fix handling of color glyphs
Matthias Clasen [Wed, 13 Sep 2023 17:33:07 +0000 (13:33 -0400)]
rendernode: Fix handling of color glyphs

The rendernode parser was mixing up its flags.

Test included.

Related: #6075

2 years agomacOS: Fix typos
Luca Bacci [Wed, 13 Sep 2023 14:49:09 +0000 (16:49 +0200)]
macOS: Fix typos

2 years agoFix documentation of gdk_display_put_event()
Michael Catanzaro [Fri, 8 Sep 2023 21:21:33 +0000 (16:21 -0500)]
Fix documentation of gdk_display_put_event()

This function is deprecated, but we should still document it properly.
It appends, not prepends. This is clear enough from its implementation,
but also we have practical experience with WebKit in:

https://github.com/WebKit/WebKit/pull/8663

Matthias prefers to avoid the prepend, append, start, and end
terminology altogether.

2 years agowayland: Bind correct xdg_wm_base version
Jonas Ådahl [Tue, 12 Sep 2023 13:51:59 +0000 (21:51 +0800)]
wayland: Bind correct xdg_wm_base version

Otherwise we won't get the suspend state.

2 years agoFix typo
Michael Catanzaro [Fri, 8 Sep 2023 16:46:26 +0000 (11:46 -0500)]
Fix typo

2 years agorendernode-tool: Fix array size
Benjamin Otte [Sun, 27 Aug 2023 19:02:03 +0000 (21:02 +0200)]
rendernode-tool: Fix array size

Also add an assertion, so things explode properly if we forget to
update the array size when adding new nodes, instead of writing random
memory.

2 years agorendernode: Fix Cairo rendering of repeating gradients
Benjamin Otte [Thu, 7 Sep 2023 14:02:09 +0000 (16:02 +0200)]
rendernode: Fix Cairo rendering of repeating gradients

Cairo and the GL renderer have a different idea of how to handle
transitioning of colors outside the defined range.

Consider these stops:
  black 50%, white 50%

What color is at 0%?

Cairo would transition between the last and first stop, ie it'd do a
white-to-black transition and end up at rgb(0.5,0.5,0.5) at 0%.
GL would behave as it would for non-repeating gradients and use black
for the range [0%..50%] and white for [50%..100%].
The web would rescale the range so the first stop would be at 0% and
the last stop would be at 100%, so this gradient would be illegal.

Considering that it's possible for code to transition between the
different behaviors by adding explicit stops at 0%/100%, I could choose
any method.
So I chose the simplest one, which is what the GL renderer does and
which treats repeating and non-repeating gradients the same.

Tests attached.

2 years agoentry, searchentry: Fix measuring baseline
Sergey Bugaev [Sat, 2 Sep 2023 18:31:18 +0000 (21:31 +0300)]
entry, searchentry: Fix measuring baseline

If the entry has icons, we may end up increasing our minimum and natural
height compared to the values the text child returned. In that case, we
should also adjust the baseline values to account for the text being
shifted down.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agocenterlayout: Fix measuring in presence of baselines
Sergey Bugaev [Sat, 2 Sep 2023 18:22:58 +0000 (21:22 +0300)]
centerlayout: Fix measuring in presence of baselines

The measure logic (unlike the allocation logic) was enforcing strict
baseline alignment of child widgets even if no child widget had valign
set to baseline. This was causing GtkCenterLayout to request more size
than it actually needed.

Instead, bring the logic closer to that of GtkBoxLayout by introducing
explicit have_baseline and align_baseline variables. We track and report
baseline if have_baseline gets set, but it only affects our reported
minimum and natural sizes if align_baseline ends up set, which happens
if there's a child widget that has valign set to either one of the two
baseline values, and itself reports a valid baseline.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agotheme: use relative font sizes
G.Willems [Fri, 1 Sep 2023 22:04:54 +0000 (00:04 +0200)]
theme: use relative font sizes

This allows text to properly scale when changing the default font size.

2 years agocomposetable: Warn for things we can't handle
Matthias Clasen [Tue, 29 Aug 2023 16:18:49 +0000 (12:18 -0400)]
composetable: Warn for things we can't handle

The compose table stores the keyvals to match against
in a guint16 array, so it can't handle directly encoded
Unicode codepoints (which have a high bit set). Warn
if we encounter those.

2 years agocomposetable: Accept short compose sequences
Matthias Clasen [Mon, 28 Aug 2023 20:38:47 +0000 (16:38 -0400)]
composetable: Accept short compose sequences

Followup to 8931169e0026b2db. That commit did
not do enough work to actually accept sequences
of lenth 1, as pointed by Mike Fabian.

2 years agoAdd test case for single char compose sequence
Mike FABIAN [Tue, 8 Aug 2023 15:52:09 +0000 (17:52 +0200)]
Add test case for single char compose sequence

2 years agogsk: Clean up standalone headers
Matthias Clasen [Tue, 29 Aug 2023 16:56:25 +0000 (12:56 -0400)]
gsk: Clean up standalone headers

We require folks to include gskglrenderer.h in order
to create a GL renderer. So we be careful to only
include header in gskglrenderer.h that won't trigger
ugly warnings.

See !6363

2 years agotestsuite/gsk: add explicit dimensions to <svg> elements
Michael Orlitzky [Mon, 28 Aug 2023 19:27:46 +0000 (15:27 -0400)]
testsuite/gsk: add explicit dimensions to <svg> elements

Without an explicit width, height, and viewBox, there is no single
correct way to render an SVG. In the absense of said information,
librsvg is capable of making a guess by rendering the SVG to a Cairo
surface and then analyzing that surface; however, this process is
merely heuristic.

There are three GTK tests for SVG images that are missing dimensions.
While this is not a violation of the SVG specification, it does
implicitly couple the test to the librsvg rendering heuristic. In this
commit we add that dimension information so that the expected result
is unambiguous.

2 years agosnapshot, gsktransform: Mention that rotation happens around (0, 0)
Sergey Bugaev [Wed, 23 Aug 2023 15:13:16 +0000 (18:13 +0300)]
snapshot, gsktransform: Mention that rotation happens around (0, 0)

...and not around the center of the render node, as one could expect
given that the render node syntax for rotation, transform: rotate(90);,
happens to match the CSS syntax for the same thing, and CSS does rotate
around the center by default.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agosnapshot: Fix push_repeat () with empty child bounds
Sergey Bugaev [Wed, 23 Aug 2023 14:39:44 +0000 (17:39 +0300)]
snapshot: Fix push_repeat () with empty child bounds

The logic would confuse empty child bounds (in which case nothing should
get rendered) with NULL child bounds (in which case the child node's own
bounds should get used). In fact, if the child bounds are empty, we can
discard the descendant render nodes completely, getting a nice little
optimization.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agodemo: Fix a bug without GL
Matthias Clasen [Fri, 25 Aug 2023 12:37:22 +0000 (08:37 -0400)]
demo: Fix a bug without GL

The gears widget was just not unrealizing properly
when GL is not available. Fix that.

Fixes: #6059
2 years agoUpdate Dutch translation
Nathan Follens [Tue, 19 Sep 2023 12:31:33 +0000 (12:31 +0000)]
Update Dutch translation

2 years agoUpdate Chinese (China) translation
Boyuan Yang [Tue, 19 Sep 2023 01:39:41 +0000 (01:39 +0000)]
Update Chinese (China) translation

2 years agoUpdate Chinese (China) translation
Boyuan Yang [Tue, 19 Sep 2023 01:35:49 +0000 (01:35 +0000)]
Update Chinese (China) translation

2 years agoUpdate Latvian translation
Rūdolfs Mazurs [Mon, 18 Sep 2023 13:29:49 +0000 (13:29 +0000)]
Update Latvian translation

2 years agoUpdate Slovenian translation
Martin [Sat, 16 Sep 2023 10:12:05 +0000 (10:12 +0000)]
Update Slovenian translation

2 years agoMerge branch 'macos-gtk-4-12' into 'gtk-4-12'
Luca Bacci [Wed, 13 Sep 2023 16:46:41 +0000 (16:46 +0000)]
Merge branch 'macos-gtk-4-12' into 'gtk-4-12'

macOS: Clamp damage region to surface size [GTK 4.12]

See merge request GNOME/gtk!6389

2 years agoUpdate Italian translation
Milo Casagrande [Wed, 13 Sep 2023 16:28:30 +0000 (16:28 +0000)]
Update Italian translation

2 years agomacOS: Clamp damage region to surface size
Luca Bacci [Wed, 13 Sep 2023 14:50:08 +0000 (16:50 +0200)]
macOS: Clamp damage region to surface size

...in _gdk_macos_cairo_context_begin_frame ()

GdkMacosCairoContext needs regions that are clamped to the
actual surface size.

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

2 years agoMerge branch 'gtk-4-12-ssd' into 'gtk-4-12'
Luca Bacci [Wed, 13 Sep 2023 13:37:39 +0000 (13:37 +0000)]
Merge branch 'gtk-4-12-ssd' into 'gtk-4-12'

[4.12] win32: Fix minimize and maximize buttons missing on ssd

See merge request GNOME/gtk!6367

2 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Tue, 12 Sep 2023 16:42:23 +0000 (16:42 +0000)]
Update Brazilian Portuguese translation

2 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 11 Sep 2023 08:49:42 +0000 (10:49 +0200)]
Updated Spanish translation

2 years agoUpdate Indonesian translation
Andika Triwidada [Sat, 9 Sep 2023 15:06:05 +0000 (15:06 +0000)]
Update Indonesian translation

2 years agoUpdate Korean translation
Changwoo Ryu [Thu, 7 Sep 2023 16:59:43 +0000 (16:59 +0000)]
Update Korean translation

2 years agoUpdate Czech translation
Daniel Rusek [Thu, 7 Sep 2023 13:38:39 +0000 (13:38 +0000)]
Update Czech translation

2 years agoUpdate Hungarian translation
Balázs Úr [Tue, 5 Sep 2023 19:13:36 +0000 (19:13 +0000)]
Update Hungarian translation

2 years agoUpdate Galician translation
Fran Dieguez [Sun, 3 Sep 2023 18:57:27 +0000 (18:57 +0000)]
Update Galician translation

2 years agoUpdate Lithuanian translation
Aurimas Černius [Sun, 3 Sep 2023 18:20:12 +0000 (18:20 +0000)]
Update Lithuanian translation

2 years agoUpdate Danish translation
Ask Hjorth Larsen [Sun, 3 Sep 2023 14:33:55 +0000 (14:33 +0000)]
Update Danish translation

2 years agoUpdate German translation
Philipp Kiemle [Fri, 1 Sep 2023 22:19:17 +0000 (22:19 +0000)]
Update German translation

2 years agowin32: Fix minimize and maximize buttons missing on ssd
dgsasha [Wed, 31 May 2023 01:51:42 +0000 (21:51 -0400)]
win32: Fix minimize and maximize buttons missing on ssd

Completely fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5142

2 years agoMerge branch 'zbrown/tooltips' into 'gtk-4-12'
Matthias Clasen [Tue, 29 Aug 2023 01:59:16 +0000 (01:59 +0000)]
Merge branch 'zbrown/tooltips' into 'gtk-4-12'

tooltip: don't cross native boundaries (cherry-pick to 4.12)

See merge request GNOME/gtk!6360

2 years agotooltip: don't cross native boundaries
Zander Brown [Sun, 27 Aug 2023 00:54:56 +0000 (01:54 +0100)]
tooltip: don't cross native boundaries

When walking the tree looking for tooltips we shouldn't cross from, say,
a popover to it's parent window

Fix: https://gitlab.gnome.org/GNOME/gtk/-/issues/1234
Fix: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1038
Fix: https://gitlab.gnome.org/GNOME/gtk/-/issues/5998
Fix: https://gitlab.gnome.org/GNOME/nautilus/-/issues/3063
See: https://gitlab.gnome.org/GNOME/console/-/issues/318
See: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6346

2 years agoUpdate Basque translation
Asier Sarasua Garmendia [Mon, 28 Aug 2023 14:49:08 +0000 (14:49 +0000)]
Update Basque translation

2 years agoUpdate Spanish translation
Daniel Mustieles [Mon, 28 Aug 2023 10:24:46 +0000 (10:24 +0000)]
Update Spanish translation

2 years agoUpdate Galician translation
Fran Dieguez [Sun, 27 Aug 2023 19:47:33 +0000 (19:47 +0000)]
Update Galician translation

2 years agoUpdate Finnish translation
Jiri Grönroos [Sun, 27 Aug 2023 14:42:06 +0000 (14:42 +0000)]
Update Finnish translation

2 years agoUpdate Turkish translation
Sabri Ünal [Sat, 26 Aug 2023 18:32:59 +0000 (18:32 +0000)]
Update Turkish translation

2 years agoUpdate Catalan translation
Jordi Mas [Sat, 26 Aug 2023 07:48:16 +0000 (09:48 +0200)]
Update Catalan translation

2 years agoPost-release version bump
Matthias Clasen [Sat, 26 Aug 2023 02:29:54 +0000 (22:29 -0400)]
Post-release version bump

2 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Fri, 25 Aug 2023 15:53:58 +0000 (15:53 +0000)]
Update Kazakh translation

2 years ago4.12.1
Matthias Clasen [Fri, 25 Aug 2023 12:28:29 +0000 (08:28 -0400)]
4.12.1

2 years agoUpdate Swedish translation
Anders Jonsson [Thu, 24 Aug 2023 15:38:43 +0000 (15:38 +0000)]
Update Swedish translation

2 years agoUpdates
Matthias Clasen [Thu, 24 Aug 2023 14:49:44 +0000 (10:49 -0400)]
Updates

2 years agoUpdate Polish translation
Piotr Drąg [Thu, 24 Aug 2023 14:47:45 +0000 (16:47 +0200)]
Update Polish translation

2 years agoRevert "PopoverMenu: Make :flags a property for use in UI…"
Matthias Clasen [Thu, 24 Aug 2023 14:39:04 +0000 (10:39 -0400)]
Revert "PopoverMenu: Make :flags a property for use in UI…"

This reverts commit acd874ec5507f45ad22de7a91478433d27f640a4.

This adds new API, therefore not suitable for 4.12.

2 years agomenubutton: Don't assume the root is a window
Matthias Clasen [Thu, 24 Aug 2023 10:29:13 +0000 (06:29 -0400)]
menubutton: Don't assume the root is a window

The only thing this assumption does is cause
criticals, so remove it.

Fixes: #6055
2 years agonotebook: fix critical when switching page
Michael Catanzaro [Wed, 23 Aug 2023 20:51:08 +0000 (15:51 -0500)]
notebook: fix critical when switching page

It's expected that gtk_widget_get_root() will return NULL if the widget
tree does not contain a root widget. I don't know what that means or why
it happens, but it's true in gnome-control-center's network panel when
displaying the OpenVPN configuration dialog. We need to handle it.

Fixes #6056

2 years agotests: Accept slightly different numeric results
Simon McVittie [Tue, 22 Aug 2023 09:49:36 +0000 (10:49 +0100)]
tests: Accept slightly different numeric results

FLT_EPSILON is the distance between 1.0 and the next distinct floating
point number, and doesn't necessarily have anything to do with the
precision we can expect from a series of floating-point calculations.
Experimentally, 1e-6 is achievable, even on platforms with unusual
floating point implementations like i387.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/6051
Bug-Debian: https://bugs.debian.org/1050076
Signed-off-by: Simon McVittie <smcv@debian.org>
2 years agowayland: Don't assume the shell protocol
Matthias Clasen [Tue, 22 Aug 2023 12:26:22 +0000 (08:26 -0400)]
wayland: Don't assume the shell protocol

The gtk_shell proxy will be NULL if the compositor
is not gnome-shell. Handle that without crashing.

Fixes: #6048
2 years agogi: Fix missing namespace
Bilal Elmoussaoui [Mon, 21 Aug 2023 21:11:12 +0000 (21:11 +0000)]
gi: Fix missing namespace

2 years agoci: Limit parallel linking on Windows CI
Georges Basile Stavracas Neto [Mon, 21 Aug 2023 18:23:22 +0000 (15:23 -0300)]
ci: Limit parallel linking on Windows CI

Linking on Windows can easily run out of memory, and limiting it
to a single link operation (i.e. disabling parallelization) should
be enough to avoid this problem.

2 years agogdk/x11/clipboard: Fix Slist leak
Khalid Abu Shawarib [Mon, 21 Aug 2023 17:14:59 +0000 (20:14 +0300)]
gdk/x11/clipboard: Fix Slist leak

2 years agobuild: Add -Woverride-init
Benjamin Otte [Fri, 18 Aug 2023 19:06:59 +0000 (21:06 +0200)]
build: Add -Woverride-init

That's a gcc warning (clang has the equivalent -Winitializer-overrides,
but that one is included in -Wall) that complains about things like:

  VkOffset3D offset = { .x = pt.x, .x = pt.y, .y = 0 };

So you don't have to spend a few hours trying to understand what's going
on before realizing your copy/paste skills are substandard.

2 years agobuild: GSK doesn't depend on gdk-pixbuf
Benjamin Otte [Mon, 14 Aug 2023 03:21:06 +0000 (05:21 +0200)]
build: GSK doesn't depend on gdk-pixbuf

2 years agobuild: Don't use configure_file() when custom_target() works
Benjamin Otte [Mon, 21 Aug 2023 03:14:33 +0000 (05:14 +0200)]
build: Don't use configure_file() when custom_target() works

These two files don't need to be built when configuring, they are only
needed during build.

2 years agowidget: Remove unused headers from gtkwidget.h
Benjamin Otte [Mon, 21 Aug 2023 00:20:17 +0000 (02:20 +0200)]
widget: Remove unused headers from gtkwidget.h

... and put them back in places where they are needed.

2 years agopaintable: Implement gdk_paintable_default_get_current_image ()
Sergey Bugaev [Fri, 18 Aug 2023 08:07:35 +0000 (11:07 +0300)]
paintable: Implement gdk_paintable_default_get_current_image ()

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agogtktexthistory: restore 'modified' flag on redo
G.Willems [Thu, 17 Aug 2023 20:26:00 +0000 (22:26 +0200)]
gtktexthistory: restore 'modified' flag on redo

When redoing a history entry, its `is_modified` flag is not
reflected to the history state tracker. So GtkTextBuffers may
expose a modified=FALSE status, despite a change was actually
applied to the buffer.

For the undo case, an `is_modified_set` flag was set on the last
entry of the undo queue when a change of the modified state of
the history is requested. This commit does the same on the first
entry of the redo queue.

Closes #5777

2 years agoPopoverMenu: Make :flags a property for use in UI…
Daniel Boles [Thu, 17 Aug 2023 09:52:21 +0000 (10:52 +0100)]
PopoverMenu: Make :flags a property for use in UI…

…files, or other cases other than calling new_from_model_full(), which
generally makes it far easier to experiment with the effect of flags,
including by changing the value of the property in the Inspector.

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6030#note_1818229

2 years agoPopover: Fix & add to CSS nodes documentation
Daniel Boles [Wed, 16 Aug 2023 16:11:45 +0000 (17:11 +0100)]
Popover: Fix & add to CSS nodes documentation

* The `.background` class gets put on `popover`, not `content`
* Use backticks to style node and class names with monospace
* Link to GtkPopoverMenu
* Add to PopoverMenu a bit outlining how items and sections look in CSS.

2 years agobuild: Drop some unused variables
Matthias Clasen [Wed, 16 Aug 2023 13:43:34 +0000 (09:43 -0400)]
build: Drop some unused variables

We are not using gtk_private_packages at all,
so drop it.

2 years agogsk: Update docs for gtk_snapshot_append_layout
Alexandros Theodotou [Wed, 16 Aug 2023 11:09:15 +0000 (20:09 +0900)]
gsk: Update docs for gtk_snapshot_append_layout

Mention how to get the current theme's foreground color.

2 years agorendernode, snapshot: Slightly expand color matrix docs
Sergey Bugaev [Tue, 15 Aug 2023 08:28:43 +0000 (11:28 +0300)]
rendernode, snapshot: Slightly expand color matrix docs

Based on reverse engineering the color node and contrary to my
expectations, the matrix/offset is expressed in, and applied to,
unpremultiplied colors. The colors are being explicitly
unpremultiplied, transformed according to the matrix/offset, and
premultiplied back (see color_matrix.glsl). The matrix is getting
transposed.

Also, copy the same blurb to the corresponding GtkSnapshot function.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agosnapshot: Fix merging color matrix nodes
Sergey Bugaev [Tue, 15 Aug 2023 08:03:25 +0000 (11:03 +0300)]
snapshot: Fix merging color matrix nodes

The code was appliying the matrices in the wrong order: we have to apply
the inner node's matrix first, and the outer one second. Due to the
matrices being implicitly transposed, the matrix multiplication was done
in the right order, yet the wrong matrix was being mutliplied by the
wrong offset vector.

To make the code a little easier to follow, create explicit variables
for the resulting matrix and offset (instead of reusing matrix2 and
offset2), and fix & expand the comment to document how matrix
transposition factors into this.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2 years agointrospection: Remove 'caller-allocates' from POD types
Philip Chimento [Wed, 16 Aug 2023 05:30:27 +0000 (22:30 -0700)]
introspection: Remove 'caller-allocates' from POD types

The (out caller-allocates) and (out callee-allocates) annotations are
meant for structured or pointer types. Plain old data types are just
regular out parameters and don't need the annotation about who allocates
them.

See glib!2005, gjs#570

2 years agomeson: Add x11_dep to gtk4-x11 requires
Xavier Claessens [Wed, 16 Aug 2023 01:17:23 +0000 (21:17 -0400)]
meson: Add x11_dep to gtk4-x11 requires

2 years agomeson: Add wayland-client to gtk4-wayland requires
Xavier Claessens [Tue, 15 Aug 2023 17:35:46 +0000 (13:35 -0400)]
meson: Add wayland-client to gtk4-wayland requires

2 years agoSignalListItemFactory: small doc grammar+sense fix
Daniel Boles [Tue, 15 Aug 2023 09:47:30 +0000 (10:47 +0100)]
SignalListItemFactory: small doc grammar+sense fix

* "to to" => "to"
* "a object" => "an object"
* "its new prop is about to be unset" => "its prop is about to be unset"

2 years agomenubutton: Fix focus on the internal gizmo
Alice Mikhaylenko [Mon, 14 Aug 2023 10:24:06 +0000 (14:24 +0400)]
menubutton: Fix focus on the internal gizmo

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

2 years agoInspector: Fix ! flash on select widget @ obj tree
Daniel Boles [Mon, 14 Aug 2023 09:48:26 +0000 (10:48 +0100)]
Inspector: Fix ! flash on select widget @ obj tree

Widgets are flashed by the window when it receives Tree::object-selected
- but we were emitting said signal from select_object(), i.e. if we were
made to select by an external caller. We should also emit it if the user
interactively selects an item, so the window receives+flashes the widget

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6022

2 years agofontdialogbutton: Make activatable
Joshua Lee [Sun, 13 Aug 2023 13:55:22 +0000 (14:55 +0100)]
fontdialogbutton: Make activatable

2 years agocolordialogbutton: Make activatable
Joshua Lee [Tue, 8 Aug 2023 13:50:28 +0000 (14:50 +0100)]
colordialogbutton: Make activatable

2 years agotext: Track user changes better
Matthias Clasen [Sun, 13 Aug 2023 13:31:42 +0000 (09:31 -0400)]
text: Track user changes better

Make all the action signal handlers call
begin/end_change(), so we can rely on
change_count being >0 to check later if
an action is user-initiated or programmatic.

Fixes: #6018
2 years agogl: Pass swizzle array directly
Benjamin Otte [Sat, 12 Aug 2023 20:17:29 +0000 (22:17 +0200)]
gl: Pass swizzle array directly

There's no need to pass pointers to arrays, as arrays are already
pointers.

2 years agocolumnview: Fix refcounting woes
Benjamin Otte [Sat, 12 Aug 2023 20:14:11 +0000 (22:14 +0200)]
columnview: Fix refcounting woes

The new code did not deal with the GtkScrollInfo properly.

Related: #6002

2 years agogdkcontext: Make has_unpack_subimage() do the version check
Benjamin Otte [Sat, 12 Aug 2023 20:13:07 +0000 (22:13 +0200)]
gdkcontext: Make has_unpack_subimage() do the version check

Makes the code look simpler when we actually use that function.

2 years agotreeviewcolumn: Set ascending class for ascending order
Benjamin Otte [Mon, 7 Aug 2023 23:37:18 +0000 (01:37 +0200)]
treeviewcolumn: Set ascending class for ascending order

The alternative button order confused the code and so the "ascending"
class was set for descending order by default, not when alternate order
is set.

2 years agomacos: use NSPopUpButton for filter selection in native filechooser
Qiu Wenbo [Fri, 11 Aug 2023 07:58:06 +0000 (15:58 +0800)]
macos: use NSPopUpButton for filter selection in native filechooser

On macOS 14, NSComboBox can't popup the dropdown list of filters. That
makes native filechooser on macOS completed broken. And NSComboBox is
more complex since it is a widget focused on edit capability.
NSPopUpButton is more suitable for plain selectable dropdown list.

Fixes: 4986
Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>
2 years agofilefilter: fix UTI type conversion on macOS
Qiu Wenbo [Fri, 11 Aug 2023 07:55:08 +0000 (15:55 +0800)]
filefilter: fix UTI type conversion on macOS

GContentType on macOS switched to UTI since glib 2.51. We should not assume it as MIME type anymore.

Fixes: #4986
Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>