gtk4.git
2 years agowayland: Don't crash on cursor size 0
Matthias Clasen [Sun, 26 Mar 2023 00:25:51 +0000 (20:25 -0400)]
wayland: Don't crash on cursor size 0

The cursor-theme-size setting is documented as
'0 means the default size'. Make it so by using
size 24 if we see a 0. Its better than crashing.

Fixes: #5700
2 years agoMerge branch 'deprecate-translate-coordinates' into 'main'
Matthias Clasen [Sat, 25 Mar 2023 14:33:14 +0000 (14:33 +0000)]
Merge branch 'deprecate-translate-coordinates' into 'main'

Deprecate gtk_widget_translate_coordinates

Closes #5697

See merge request GNOME/gtk!5717

2 years agoDrop gtk_widget_get_surface_allocation
Matthias Clasen [Sat, 25 Mar 2023 13:48:12 +0000 (09:48 -0400)]
Drop gtk_widget_get_surface_allocation

This private api is confusing, and no longer used.

2 years agoentrycompletion: Stop using gtk_widget_get_surface_allocation
Matthias Clasen [Sat, 25 Mar 2023 13:46:34 +0000 (09:46 -0400)]
entrycompletion: Stop using gtk_widget_get_surface_allocation

We only need the width of the widgets' bounds
here anyway, so just use gtk_widget_compute_bounds.

2 years agopopover: Stop using gtk_widget_get_surface_allocation
Matthias Clasen [Sat, 25 Mar 2023 13:45:31 +0000 (09:45 -0400)]
popover: Stop using gtk_widget_get_surface_allocation

The function is going away, and the computation
here was wrong anyway. Instead, add a helper that
properly computes the pointing-to rect in surface
coordinates and use it everywhere.

2 years agoDeprecate gtk_widget_translate_coordinates
Matthias Clasen [Sat, 25 Mar 2023 13:20:47 +0000 (09:20 -0400)]
Deprecate gtk_widget_translate_coordinates

Update all (non-deprecated) callers to use
gtk_widget_compute_point instead.

Fixes: #5697
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 25 Mar 2023 13:59:06 +0000 (13:59 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

testsuite: Add some GL texture tests

See merge request GNOME/gtk!5715

2 years agoMerge branch 'popover-bounds-trouble' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 22:59:05 +0000 (22:59 +0000)]
Merge branch 'popover-bounds-trouble' into 'main'

textview: Give the magnifier correct coordinates

Closes #5695

See merge request GNOME/gtk!5716

2 years agomagnifier: Correct position of area
Matthias Clasen [Fri, 24 Mar 2023 19:30:27 +0000 (15:30 -0400)]
magnifier: Correct position of area

The widget paintable uses the widgets bounds
as intrinsic size, so we need to offset from
that to the allocation, which is what the
coordinates are relative to.

2 years agotexthandle: Correct placement of handles
Matthias Clasen [Fri, 24 Mar 2023 18:49:18 +0000 (14:49 -0400)]
texthandle: Correct placement of handles

Text handles had the same problem as popovers.
They were interpreting their pointing-to rectangle
relative to the widgets bounds, when it is meant
to be relative to the widgtets allocation.

While we touch this code, rewrite it to use
gtk_widget_compute_point.

2 years agopopover: Correct placement of popovers
Matthias Clasen [Fri, 24 Mar 2023 18:47:27 +0000 (14:47 -0400)]
popover: Correct placement of popovers

When we don't have a pointing-to rectangle, we want to place
the popover wrt to the parents bounds. But if we have a
pointing-to rectangle, it is relative to the widgets allocation,
which is different from the bounds.

We were not handling the second case correctly, leading to context
menus in the text view being mispositioned by the widgets CSS padding.

While we are touching this code, rewrite it to handle transforms.

Fixes: #5695
2 years agotestsuite: Add some GL texture tests
Matthias Clasen [Fri, 24 Mar 2023 17:56:06 +0000 (13:56 -0400)]
testsuite: Add some GL texture tests

Tests creation and upload/download of GL
textures in various contexts.

2 years agotestsuite: Cosmetics
Matthias Clasen [Fri, 24 Mar 2023 16:33:44 +0000 (12:33 -0400)]
testsuite: Cosmetics

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 15:53:55 +0000 (15:53 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Fix up criticals from GdkGLTexture

See merge request GNOME/gtk!5712

2 years agoMerge branch 'alternative-fix-5685' into 'main'
Chun-wei Fan [Fri, 24 Mar 2023 15:30:01 +0000 (15:30 +0000)]
Merge branch 'alternative-fix-5685' into 'main'

GDK/Win32: Use wgl* functions directly as needed (fix #5685)

Closes #5685

See merge request GNOME/gtk!5702

2 years agoFix up criticals from GdkGLTexture
Matthias Clasen [Fri, 24 Mar 2023 15:29:38 +0000 (11:29 -0400)]
Fix up criticals from GdkGLTexture

I broke this in 4291f27b562f58.
I overlooked that there may not be a current context.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 14:45:35 +0000 (14:45 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

docs: Some updates

See merge request GNOME/gtk!5711

2 years agodocs: Improve markup for keys
Matthias Clasen [Fri, 24 Mar 2023 13:42:25 +0000 (09:42 -0400)]
docs: Improve markup for keys

Consistently use <kbd>x</kbd> to render keys in the docs
and use + for key combinations.

2 years agodocs: Some updates
Matthias Clasen [Fri, 24 Mar 2023 12:56:06 +0000 (08:56 -0400)]
docs: Some updates

Fix some links ot point to docs.gtk.org.

2 years agoinspector: Cosmetics
Matthias Clasen [Fri, 24 Mar 2023 12:17:51 +0000 (08:17 -0400)]
inspector: Cosmetics

2 years agogtkgstsink.c: Drop workarounds needed for Windows
Chun-wei Fan [Fri, 24 Mar 2023 10:16:35 +0000 (18:16 +0800)]
gtkgstsink.c: Drop workarounds needed for Windows

Since we are making GdkGLContext call the core wgl*() functions directly
instead of via libepoxy, drop the workarounds that we needed for notifying
libepoxy that wglMakeCurrent() outside of GDK/GTK was called.

This way, we clean up the code, and as a result, we can use the GstGL
APIs like the other platforms to query what GL api that is to be used.

For ensuring that things work between different threads, we now call
gdk_gl_context_clear_current() in place of calling wglMakeCurrent(xxx,
NULL), so that we make sure that there is no current GL context on a
thread outside of GstGL's thread, which Windows does not like.

2 years agoGDK-Win32: Add wrapper functions for calling core wgl* functions
Chun-wei Fan [Fri, 24 Mar 2023 03:08:26 +0000 (11:08 +0800)]
GDK-Win32: Add wrapper functions for calling core wgl* functions

We might be dealing with GL contexts from different threads, which have more
gotchas when we are using libepoxy, so in case the function pointers for
these are invalidated by wglMakeCurrent() calls outside of GTK/GDK, such as
in GstGL, we want to use these functions that are directly linked to
opengl32.dll provided by the system/ICD, by linking to opengl32.lib.

This will ensure that we will indeed call the "correct" wgl* functions that
we need.

This should help fix issue #5685.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Fri, 24 Mar 2023 05:18:08 +0000 (05:18 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

listview: Activatable means activate

See merge request GNOME/gtk!5709

2 years agocolumnview: Don't infloop when a cell is grab_focus()ed
Benjamin Otte [Fri, 24 Mar 2023 01:53:42 +0000 (02:53 +0100)]
columnview: Don't infloop when a cell is grab_focus()ed

Whoopsie.

Broken since 30d4629043f.

2 years agolistview: Activatable means activate
Benjamin Otte [Thu, 23 Mar 2023 19:37:57 +0000 (20:37 +0100)]
listview: Activatable means activate

Fix a typo that prevented activatable widgets from activating since the
refactoring in 608be08b0d6.

2 years agoMerge branch 'mipmap-tracking' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 03:43:21 +0000 (03:43 +0000)]
Merge branch 'mipmap-tracking' into 'main'

gsk: Avoid copying GL texture in more cases

See merge request GNOME/gtk!5704

2 years agogsk: Avoid copying GL texture in more cases
Matthias Clasen [Thu, 23 Mar 2023 12:47:54 +0000 (08:47 -0400)]
gsk: Avoid copying GL texture in more cases

When the GL texture already has a mipmap, we don't
have to download and reupload it to generate one.

We differentiate the handling for texture scale nodes,
where we do want to force the mipmap creation even if
it requires us to reupload the GL texture, and plain
texture nodes, where we just take advantage of a
preexisting mipmap to allow trilinear filtering for
downscaling, or create one if we have to upload the
texture anyway.

2 years agogl: Add a private way to query mipmap status
Matthias Clasen [Thu, 23 Mar 2023 12:44:26 +0000 (08:44 -0400)]
gl: Add a private way to query mipmap status

Make GdkGLTexture determine if the texture has
a mipmap, and provide private API to query this
information.

This check is done in gdkgltexture.c instead of
gskgldriver.c, since we're already binding the
texture here for other reasons, so it is easy
to query a few more things.

2 years agoMerge branch 'check-widget-on-destruction' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 03:03:31 +0000 (03:03 +0000)]
Merge branch 'check-widget-on-destruction' into 'main'

gtkwidget: Do a type-check in gtk_widget_in_destruction()

See merge request GNOME/gtk!5708

2 years agogltexture: Try harder to determine the format
Matthias Clasen [Fri, 24 Mar 2023 02:56:06 +0000 (22:56 -0400)]
gltexture: Try harder to determine the format

We can query these things as long as the texture ID
is valid in the current context.

2 years agogtkwidget: Do a type-check in gtk_widget_in_destruction()
Marco Trevisan (Treviño) [Fri, 24 Mar 2023 02:29:53 +0000 (03:29 +0100)]
gtkwidget: Do a type-check in gtk_widget_in_destruction()

Given it can be called during a widget destruction, it's safer to do a
type-check before crashing.

See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1727

2 years agoUpdate Chinese (China) translation
Boyuan Yang [Thu, 23 Mar 2023 18:46:30 +0000 (18:46 +0000)]
Update Chinese (China) translation

2 years agoMerge branch 'fix-a11y-leak2' into 'main'
Emmanuele Bassi [Thu, 23 Mar 2023 11:07:18 +0000 (11:07 +0000)]
Merge branch 'fix-a11y-leak2' into 'main'

Don't leak all AT contexts

Closes #5690

See merge request GNOME/gtk!5700

2 years agoMerge branch 'wip/otte/listview-cleanups' into 'main'
Benjamin Otte [Thu, 23 Mar 2023 05:38:29 +0000 (05:38 +0000)]
Merge branch 'wip/otte/listview-cleanups' into 'main'

listview refactoring and new stuff

See merge request GNOME/gtk!5701

2 years agocolumnview: Handle focus movement properly
Benjamin Otte [Thu, 23 Mar 2023 03:37:29 +0000 (04:37 +0100)]
columnview: Handle focus movement properly

- grab_focus() on a row (happens with scroll_to()) keeps the focus
  column intact if possible.
- <Tab> and <Shift-Tab> move through the cells in order, and move
  to the next row when at the end.
- <Up> an <Down> move to the next/prev row, keeping the same column
  focused.
- <Left> and <Right> move to the prev/next cell, if one is available.
  If not, they stay where they are.

2 years agocolumnview: add a (private) focus-column
Benjamin Otte [Thu, 23 Mar 2023 02:35:04 +0000 (03:35 +0100)]
columnview: add a (private) focus-column

Make setting the focus column scroll to it, too.

2 years agocolumnviewrowwidget: Handle left/right arrow keys
Benjamin Otte [Tue, 21 Mar 2023 13:08:14 +0000 (14:08 +0100)]
columnviewrowwidget: Handle left/right arrow keys

Make it move focus just like GtkWindow would.

Otherwise the listview will (try to) handle it and move focus between
cells - which doesn't do anything for lists and only works with grids.

2 years agolistbase: Only grab_focus() if the cursor moved
Benjamin Otte [Tue, 21 Mar 2023 12:47:24 +0000 (13:47 +0100)]
listbase: Only grab_focus() if the cursor moved

If there is no movement, grab_focus() on the already focused widget
just causes weird inconsistencies and we don't want those.

2 years agocolumnviewrow: Handle focus movement properly
Benjamin Otte [Tue, 21 Mar 2023 12:43:35 +0000 (13:43 +0100)]
columnviewrow: Handle focus movement properly

Handle backwards tab properly and deal with left right arrows.

2 years agolistitemwidget: Only take a single child
Benjamin Otte [Wed, 15 Mar 2023 01:12:33 +0000 (02:12 +0100)]
listitemwidget: Only take a single child

2 years agocolumnviewrowwidget: Drop unneeded stuff
Benjamin Otte [Mon, 13 Mar 2023 16:39:52 +0000 (17:39 +0100)]
columnviewrowwidget: Drop unneeded stuff

Also remove the GtkColumnListItemFactory and GtkColumnViewLayout
objects by folding them into GtkColumnViewRowWidget.

2 years agocolumnview: Add GtkColumnViewRowWidget
Benjamin Otte [Mon, 13 Mar 2023 04:04:29 +0000 (05:04 +0100)]
columnview: Add GtkColumnViewRowWidget

This is a copy/paste of GtkListItemWidget for now.

Modifications will happen in future commits.

2 years agolistview: Add private GtkListFactoryWidget
Benjamin Otte [Mon, 20 Mar 2023 05:15:18 +0000 (06:15 +0100)]
listview: Add private GtkListFactoryWidget

This is a split of GtkListItemWidget into the generic parts of factory
using widgets.

On top of it there's GtkListItemWidget, which takes care of GtkListItem.

2 years agolistview: Move ::factory out of the item manager
Benjamin Otte [Sun, 12 Mar 2023 21:03:03 +0000 (22:03 +0100)]
listview: Move ::factory out of the item manager

It's a listitemwidget property, and the item manager manages the items,
not the widgets.

2 years agolistview: Move ::single-click-activate out of the item manager
Benjamin Otte [Sun, 12 Mar 2023 20:54:07 +0000 (21:54 +0100)]
listview: Move ::single-click-activate out of the item manager

It's a listitemwidget property, and the item manager manages the items,
not the widgets.

2 years agolistitemmanager: Create widgets via vfunc
Benjamin Otte [Sun, 12 Mar 2023 17:36:57 +0000 (18:36 +0100)]
listitemmanager: Create widgets via vfunc

We now have listitemmanager just create GtkListItemBase objects via
vfunc and use them.

2 years agolistitemwidget: split out GtkListItemBase
Benjamin Otte [Sun, 12 Mar 2023 04:05:48 +0000 (05:05 +0100)]
listitemwidget: split out GtkListItemBase

There's 2 reasons for this:

1. Adding a custom widget for columnview rows
2. Using this as base class for sections

2 years agoitemmananger: Remove the user data
Benjamin Otte [Sun, 12 Mar 2023 00:13:37 +0000 (01:13 +0100)]
itemmananger: Remove the user data

Use the widget instead. They're the same anyway.

2 years agolistbase: Privatize 2 functions
Benjamin Otte [Sat, 11 Mar 2023 16:22:36 +0000 (17:22 +0100)]
listbase: Privatize 2 functions

They're not used outside of GtkListBase, so no use to have them in the
header.

Requires moving one function up in the source now that the forward
declaration is missing.

2 years agolistitemmanager: Clean up header
Benjamin Otte [Sat, 11 Mar 2023 16:41:06 +0000 (17:41 +0100)]
listitemmanager: Clean up header

Remove all unused functions and an unused macro.

2 years agoDon't leak all AT contexts
Matthias Clasen [Thu, 23 Mar 2023 03:41:40 +0000 (23:41 -0400)]
Don't leak all AT contexts

create_at_context was confused - it stored a reference
to the newly created context in priv->context, but then
also returned a reference, and the caller stored that
in priv->context again.

Change it to only return a reference.

Fixes: #5690
2 years agoMerge branch 'texture-scale-test' into 'main'
Matthias Clasen [Thu, 23 Mar 2023 02:42:28 +0000 (02:42 +0000)]
Merge branch 'texture-scale-test' into 'main'

gsk: Add a test for scaled textures

See merge request GNOME/gtk!5686

2 years agoUpdate British English translation
Bruce Cowan [Wed, 22 Mar 2023 15:46:17 +0000 (15:46 +0000)]
Update British English translation

(cherry picked from commit d80cecec06c5196bad93be38cc11db86715cca77)

2 years agoMerge branch 'ebassi/ensure-file-chooser-types' into 'main'
Matthias Clasen [Wed, 22 Mar 2023 10:48:55 +0000 (10:48 +0000)]
Merge branch 'ebassi/ensure-file-chooser-types' into 'main'

Ensure GtkFileChooserCell's type

See merge request GNOME/gtk!5696

2 years agoEnsure GtkFileChooserCell's type
Emmanuele Bassi [Wed, 22 Mar 2023 10:23:28 +0000 (10:23 +0000)]
Ensure GtkFileChooserCell's type

Otherwise anything that dlopen()'s GTK will have a bad day.

See: https://discourse.gnome.org/t/strange-filechooserdialog-behaviour-in-gtk-4-10/14435

2 years agogsk: Improve slice handling
Matthias Clasen [Wed, 22 Mar 2023 03:26:55 +0000 (23:26 -0400)]
gsk: Improve slice handling

Upload slices in chunks, instead of copying
enormous amounts of memory.

2 years agogsk: Add more flexible texture upload
Matthias Clasen [Wed, 22 Mar 2023 02:55:03 +0000 (22:55 -0400)]
gsk: Add more flexible texture upload

Add a command queue function to create a
GL texture by uploading several GdkTextures
at given positions.
This lets us 'piece together' textures.

2 years agogsk: Tweak one test to pass
Matthias Clasen [Tue, 21 Mar 2023 02:43:35 +0000 (22:43 -0400)]
gsk: Tweak one test to pass

Clip away the problematic corners in this
artificial texture scaling test. The GL renderer
has problems getting them perfect.

2 years agogsk: Drop debug code
Matthias Clasen [Tue, 21 Mar 2023 01:49:42 +0000 (21:49 -0400)]
gsk: Drop debug code

2 years agogsk: Drop some unused arguments
Matthias Clasen [Tue, 21 Mar 2023 02:02:17 +0000 (22:02 -0400)]
gsk: Drop some unused arguments

All callers of the slice apis pass 0 for
min_rows and min_cols. So just drop these.

2 years agogsk: Use overlapping slices
Matthias Clasen [Mon, 20 Mar 2023 11:57:13 +0000 (07:57 -0400)]
gsk: Use overlapping slices

Store texture coordinates for each slice
instead of assuming 0,0,1,1, and generate
overlapping slices to allow for proper mipmaps.

This almost fixes trilinear filtering with
sliced textures.

2 years agogsk: Add a test for scaled textures
Matthias Clasen [Mon, 20 Mar 2023 00:25:14 +0000 (20:25 -0400)]
gsk: Add a test for scaled textures

GL and cairo disagree on this one, and have forever.
Whee!

2 years agogsk: Cosmetics
Matthias Clasen [Mon, 20 Mar 2023 10:57:56 +0000 (06:57 -0400)]
gsk: Cosmetics

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 22 Mar 2023 00:24:52 +0000 (00:24 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

a11y: Add a test for gtk_accessible_role_to_name

See merge request GNOME/gtk!5694

2 years agoa11y: Add a test for gtk_accessible_role_to_name
Matthias Clasen [Wed, 22 Mar 2023 00:06:37 +0000 (20:06 -0400)]
a11y: Add a test for gtk_accessible_role_to_name

This should prevent !5693 from happening again
in the future.

2 years agoMerge branch 'fix_gtk_accessible_role_to_name_crash' into 'main'
Matthias Clasen [Tue, 21 Mar 2023 18:05:50 +0000 (18:05 +0000)]
Merge branch 'fix_gtk_accessible_role_to_name_crash' into 'main'

fix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON

See merge request GNOME/gtk!5693

2 years agofix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON
Caolán McNamara [Tue, 21 Mar 2023 15:04:12 +0000 (15:04 +0000)]
fix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON

presumably since:

commit de80f503e4db282a7343aa16d2803967d4179739
Date:   Thu Feb 23 14:22:20 2023 +0100

    a11y: Introduce a dedicated role for toggle buttons

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Tue, 21 Mar 2023 13:26:09 +0000 (13:26 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

checkbutton: Only andle arrow focus if we're in a group

See merge request GNOME/gtk!5692

2 years agotestsuite: Add a treelistmodel test
Benjamin Otte [Sun, 19 Mar 2023 22:24:42 +0000 (23:24 +0100)]
testsuite: Add a treelistmodel test

This one exhaustively tests reusing the same model as a child model for
many nodes.
This tracks that multiple items-changed signals emitted at the same time
(or multiple handlers for one such signal) doesn't put the treelistmodel
in an inconsistent state while it is handling all of them.

I'm not sure this (ab)use of treelistmodel should be officially
supported, but it works today, so let's test it to see if we can keep it
working.

2 years agocheckbutton: Only andle arrow focus if we're in a group
Benjamin Otte [Tue, 21 Mar 2023 13:06:33 +0000 (14:06 +0100)]
checkbutton: Only andle arrow focus if we're in a group

If there is no other widget in the group that we can focus, don't focus
and activate ourselves.

Otherwise the arrow keys on checkbuttons toggle the checkbutton.

2 years agoMerge branch 'disabled-picture-opacity-fix' into 'main'
Matthias Clasen [Mon, 20 Mar 2023 23:06:44 +0000 (23:06 +0000)]
Merge branch 'disabled-picture-opacity-fix' into 'main'

theme: Use 0.5 opacity for disabled pictures

Closes #5683

See merge request GNOME/gtk!5689

2 years agotheme: Use 0.5 opacity for disabled pictures
Marco Trevisan (Treviño) [Mon, 20 Mar 2023 22:38:35 +0000 (23:38 +0100)]
theme: Use 0.5 opacity for disabled pictures

If a GtkImage is using an icon we use a gtk-icon-filter to se the icon
opacity when in insensitive state, however when using other kinds of
pictures we do not apply the same style leading to an inconsistent
result.

Closes: #5683
2 years agoMerge branch 'alatiera/fedora-bump' into 'main'
Matthias Clasen [Mon, 20 Mar 2023 14:39:15 +0000 (14:39 +0000)]
Merge branch 'alatiera/fedora-bump' into 'main'

ci: Use Fedora 38 as the base

See merge request GNOME/gtk!5688

2 years agovulkan: Update error codes enum
Jordan Petridis [Mon, 20 Mar 2023 14:15:05 +0000 (16:15 +0200)]
vulkan: Update error codes enum

2 years agoci: Use Fedora 38 as the base
Jordan Petridis [Mon, 20 Mar 2023 13:47:10 +0000 (15:47 +0200)]
ci: Use Fedora 38 as the base

2 years agoMerge branch 'bilelmoussaoui-main-patch-49195' into 'main'
Matthias Clasen [Mon, 20 Mar 2023 11:23:21 +0000 (11:23 +0000)]
Merge branch 'bilelmoussaoui-main-patch-49195' into 'main'

g-i: Add since annotation to GdkSurfaceSize

See merge request GNOME/gtk!5687

2 years agog-i: Add since annotation to GdkSurfaceSize
Bilal Elmoussaoui [Mon, 20 Mar 2023 08:14:25 +0000 (08:14 +0000)]
g-i: Add since annotation to GdkSurfaceSize

2 years agoMerge branch 'mipmap-more' into 'main'
Matthias Clasen [Mon, 20 Mar 2023 02:04:21 +0000 (02:04 +0000)]
Merge branch 'mipmap-more' into 'main'

gsk: Use mipmaps when it is beneficial

See merge request GNOME/gtk!5685

2 years agogsk: Use mipmaps when it is beneficial
Matthias Clasen [Mon, 20 Mar 2023 01:44:54 +0000 (21:44 -0400)]
gsk: Use mipmaps when it is beneficial

If a texture node ends up getting scaled
down a lot, it helps to use trilinear filtering.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 19 Mar 2023 17:07:53 +0000 (17:07 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

treelistmodel: Clear item in right place

Closes #5681

See merge request GNOME/gtk!5682

2 years agotreelistmodel: Clear item in right place
Benjamin Otte [Sun, 19 Mar 2023 16:30:18 +0000 (17:30 +0100)]
treelistmodel: Clear item in right place

Items should be cleared when the node is discarded, not when the node's
children are discarded - which can also happen when a node is collapsed.

Fixes an error introduced in 9048e391b60e19ccefa0b9fe51c466d16b42dcc4

Fixes #5681

2 years agoMerge branch 'texture-scale-tests' into 'main'
Matthias Clasen [Sun, 19 Mar 2023 14:54:34 +0000 (14:54 +0000)]
Merge branch 'texture-scale-tests' into 'main'

node-editor: Embed textures in testcases

See merge request GNOME/gtk!5681

2 years agoci: Make reports for all setups
Matthias Clasen [Sun, 19 Mar 2023 14:21:19 +0000 (10:21 -0400)]
ci: Make reports for all setups

2 years agotestsuite: Improve setup name consistency
Matthias Clasen [Sun, 19 Mar 2023 14:19:00 +0000 (10:19 -0400)]
testsuite: Improve setup name consistency

Rename the 'waylandgles' test setup to 'wayland_gles'.

2 years agoci: Run tests with small textures
Matthias Clasen [Sun, 19 Mar 2023 14:16:19 +0000 (10:16 -0400)]
ci: Run tests with small textures

2 years agotestsuite: Add a test setup for slicing
Matthias Clasen [Sun, 19 Mar 2023 14:08:01 +0000 (10:08 -0400)]
testsuite: Add a test setup for slicing

Add a 'wayland_smalltexture' test setup that forces
the max texture size to be 1024, which lets us test
the texture slicing codepaths.

2 years agotestsuite: Add some texture tests
Matthias Clasen [Sun, 19 Mar 2023 14:05:52 +0000 (10:05 -0400)]
testsuite: Add some texture tests

In constrast to our other tests, these use
textures that are big enough to force slicing
with setting GSK_MAX_TEXTURE_SIZE, which we
will use in the following commits to improve
test coverage.

2 years agonode-editor: Embed textures in testcases
Matthias Clasen [Sun, 19 Mar 2023 14:04:46 +0000 (10:04 -0400)]
node-editor: Embed textures in testcases

It is useless to have node files with references
to external files in the testsuite, so turn such
textures into data urls by doing a serialization
roundtrip.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 19 Mar 2023 06:23:46 +0000 (06:23 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

Fix inspector doing weird stuff

Closes #5646

See merge request GNOME/gtk!5678

2 years agotreelistmodel: Clarify docs
Benjamin Otte [Sun, 19 Mar 2023 04:25:52 +0000 (05:25 +0100)]
treelistmodel: Clarify docs

No user knows that we have an internal function called
gtk_tree_list_row_destroy() that gets called when a row gets removed
from the treelistmodel.

So everyone was probably just making stuff up about what "destroy"
means.

Related: #5646

2 years agotreelistmodel: Track the item in the row
Benjamin Otte [Sun, 19 Mar 2023 04:22:46 +0000 (05:22 +0100)]
treelistmodel: Track the item in the row

That way, we can return the item even after the row is removed. This is
particularly relevant in ListItemFactory::unbind callbacks because they
often use gtk_tree_list_row_get_item() and user code never tracks
changes to this property.

A side effect of this is that the item will survive until the row gets
destroyed, but that's what users expect anyway, so we can live with it.

Related: #5646

2 years agotreelistmodel: Cache the item
Benjamin Otte [Sun, 19 Mar 2023 04:04:51 +0000 (05:04 +0100)]
treelistmodel: Cache the item

This is a good idea to avoid reentrancy problems when any child model
(or potentially more than one child model) has started emitting
items-changed but the emission hasn't arrived in this model yet.

At tat point, we'd get_item() the wrong item from those models.

We want to avoid such cases of reentrancy.

Related: #5646

2 years agocssnode: Refer the correct previous item
Benjamin Otte [Sun, 19 Mar 2023 04:07:17 +0000 (05:07 +0100)]
cssnode: Refer the correct previous item

We disconnect from old_previous, not from the new previous.

Related: #5646

2 years agoMerge branch 'wip/matthiasc/samplers' into 'main'
Matthias Clasen [Sun, 19 Mar 2023 01:54:57 +0000 (01:54 +0000)]
Merge branch 'wip/matthiasc/samplers' into 'main'

glrenderer: Handle filters differently

See merge request GNOME/gtk!5676

2 years agoglrenderer: Support GL without samplers
Benjamin Otte [Fri, 17 Mar 2023 05:26:05 +0000 (06:26 +0100)]
glrenderer: Support GL without samplers

We cheat and just set the texture parameters instead and hope nothing
explodes.
So far it didn't.

This is only needed to support GLES 2.0 so it's quite a limited set of
hardware these days.

2 years agoglrenderer: Handle filters differently
Benjamin Otte [Fri, 17 Mar 2023 05:14:53 +0000 (06:14 +0100)]
glrenderer: Handle filters differently

Instead of uploading a texture once per filter, ensure textures are
uploaded as little as possible and use samplers instead to switch
different filters.

Sometimes we have to reupload a texture unfortunately, when it is an
external one and we want to create mipmaps.

2 years agoMerge branch 'docs-tweaks' into 'main'
Matthias Clasen [Sat, 18 Mar 2023 22:56:22 +0000 (22:56 +0000)]
Merge branch 'docs-tweaks' into 'main'

dropdown: tweak the docs

See merge request GNOME/gtk!5677

2 years agodocs: Cosmetics
Matthias Clasen [Sat, 18 Mar 2023 14:25:41 +0000 (10:25 -0400)]
docs: Cosmetics

2 years agodocs: Tweaks
Matthias Clasen [Sat, 18 Mar 2023 14:24:32 +0000 (10:24 -0400)]
docs: Tweaks

Tweak the wording in the list widget overview to
fix some typos and make things read more smoothly.

2 years agodropdown: tweak the docs
Matthias Clasen [Sat, 18 Mar 2023 14:24:06 +0000 (10:24 -0400)]
dropdown: tweak the docs

Add a link to the list widget overview.