Benjamin Otte [Mon, 11 Oct 2021 17:22:46 +0000 (19:22 +0200)]
x11: Don't try to move destroyed windows
Fixes BadWindow crashes when the resize happen right when tooltips or
other such transient popups were in the process of being destroyed.
Benjamin Otte [Sat, 9 Oct 2021 11:59:42 +0000 (11:59 +0000)]
Merge branch 'wip/otte/gles' into 'master'
Improve GLES
See merge request GNOME/gtk!4050
Benjamin Otte [Fri, 8 Oct 2021 16:38:51 +0000 (18:38 +0200)]
testsuite: Add run for GLES
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.
Benjamin Otte [Sat, 9 Oct 2021 03:25:05 +0000 (05:25 +0200)]
gl: Make sure to set a proper alignment
No matter which branch we take, the alignment setting is always the
same.
Benjamin Otte [Sat, 9 Oct 2021 03:24:44 +0000 (05:24 +0200)]
gl: Check the stride is a multiple of the bpp
Benjamin Otte [Sat, 9 Oct 2021 02:36:20 +0000 (04:36 +0200)]
gl: Set stride properly in fallback
Benjamin Otte [Sat, 9 Oct 2021 02:35:27 +0000 (04:35 +0200)]
gl: Fix broken internal format
Benjamin Otte [Fri, 8 Oct 2021 18:15:07 +0000 (20:15 +0200)]
testsuite: Add a test targeting GL upload code
Previously, all the tests used the icon upload path using
glTexSubImage2D().
This test uses the custom texture path using glTexImage2D().
Benjamin Otte [Fri, 8 Oct 2021 16:47:49 +0000 (18:47 +0200)]
ngl: Use the right value
It's GL_RGBA, not GL_BGRA, or GLES will complain.
Asier Sarasua Garmendia [Fri, 8 Oct 2021 17:44:18 +0000 (17:44 +0000)]
Update Basque translation
(cherry picked from commit
2492729238b90c3b1f28a8776899ea2b11c379a3)
Benjamin Otte [Fri, 8 Oct 2021 15:57:08 +0000 (15:57 +0000)]
Merge branch 'wip/otte/glcontext' into 'master'
glcontext: Make GLES vs GL configuration clearer
Closes #4221
See merge request GNOME/gtk!4044
Benjamin Otte [Fri, 8 Oct 2021 09:11:03 +0000 (09:11 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
Fix GLES fallout from recent NGL updates
See merge request GNOME/gtk!4046
Benjamin Otte [Thu, 7 Oct 2021 21:03:45 +0000 (23:03 +0200)]
glcontext: Add gdk_gl_context_get_api()
This is mostly for inspector.
Not sure if we also want to deprecate gdk_gl_context_get_use_es() in
favor of this function.
Benjamin Otte [Fri, 8 Oct 2021 01:29:45 +0000 (03:29 +0200)]
ngl: Fix glTexImage2D() usage on GLES
GLES is very adamant about the format and type matching the internal
format, even if the data is NULL.
Benjamin Otte [Thu, 7 Oct 2021 20:10:39 +0000 (22:10 +0200)]
gl: Check allowed APIs in realize()
Add gdk_gl_context_is_api_allowed() for backends and make them use it.
Finally, have them return the final API as the return value (or 0 on
error).
And then use that api instead of a use_es boolean flag.
Fixes #4221
Benjamin Otte [Thu, 7 Oct 2021 16:13:36 +0000 (18:13 +0200)]
glcontext: Deprecate gdk_gl_context_set_use_es()
Make it call gdk_gl_context_set_allowed_apis().
Also port callers to use this function.
Benjamin Otte [Thu, 7 Oct 2021 15:59:17 +0000 (17:59 +0200)]
glcontext: Add GdkGLContext::allowed-apis
This allows specifying the GL APIs in a more comprehensive way than
gdk_gl_context_set_use_es().
Benjamin Otte [Fri, 8 Oct 2021 00:31:25 +0000 (02:31 +0200)]
ngl: Compute correct renderformat
We want to round up, not down.
Benjamin Otte [Fri, 8 Oct 2021 00:28:49 +0000 (02:28 +0200)]
ngl: fbo 0 has no color attachment
Query the backbuffer instead.
Benjamin Otte [Thu, 7 Oct 2021 19:11:28 +0000 (19:11 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
css: Render the background-clip area, not the background-origin
Closes #4324
See merge request GNOME/gtk!4043
Benjamin Otte [Thu, 7 Oct 2021 17:50:02 +0000 (19:50 +0200)]
css: Render the background-clip area, not the background-origin
Testcase included
Fixes #4324
Matthias Clasen [Thu, 7 Oct 2021 12:32:46 +0000 (12:32 +0000)]
Merge branch 'wip/cdavis/menu-item-markup' into 'master'
Add support for pango markup in menu items
Closes #4306
See merge request GNOME/gtk!4039
Christopher Davis [Thu, 7 Oct 2021 09:32:31 +0000 (02:32 -0700)]
Add support for pango markup in menu items
Before https://gitlab.gnome.org/GNOME/gtk/-/commit/
c4a2234a28456fda5034bbaa155a1f8f76a6bebc
menu models could use markup for items and the markup would
be parsed, but this was not intended behavior.
This commit adds official support for using markup
for menu items via the `use-markup` property.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4306
Matthias Clasen [Thu, 7 Oct 2021 05:05:49 +0000 (05:05 +0000)]
Merge branch 'fix-filechooser-portal-crash' into 'master'
filechooserportal: Take a ref on transient-for
Closes #4314
See merge request GNOME/gtk!4038
Matthias Clasen [Thu, 7 Oct 2021 02:37:45 +0000 (22:37 -0400)]
filechooserportal: Take a ref on transient-for
This may fix a crash that has been reported in
file_chooser_portal_data_free.
Fixes: #4314
Matthias Clasen [Thu, 7 Oct 2021 02:03:48 +0000 (02:03 +0000)]
Merge branch 'wip/matthiasc/gsk-hdr' into 'master'
texture: Add hdr api
See merge request GNOME/gtk!4036
Matthias Clasen [Wed, 6 Oct 2021 22:31:09 +0000 (18:31 -0400)]
ngl: Make render_texture high depth aware
Make a deep texture, if the render nodes have
high depth content.
For now, we use 32F here for the deep format,
since using 16F causes small rounding errors
that break the memorytexture roundtrip tests.
Matthias Clasen [Fri, 1 Oct 2021 20:47:55 +0000 (16:47 -0400)]
ngl: Update framebuffer format for each frame
Look at whether the render nodes are high depth and
if so, request a high depth framebuffer.
Whether we actually get one is up to the backend.
Matthias Clasen [Fri, 1 Oct 2021 12:48:43 +0000 (08:48 -0400)]
ngl: Determine intermediate formats
Look at the framebuffer and the rendernode to
determine what format to use for intermediate
textures.
Our preference here is to use fp16, if we have it
and it makes sense for the framebuffer we're given.
Matthias Clasen [Wed, 6 Oct 2021 03:36:49 +0000 (23:36 -0400)]
ngl: Allow specifying texture formats
Allow passing a format when creating textures or render targets.
Update all callers to pass GL_RGBA8, which is the format we
have always used so far.
Matthias Clasen [Fri, 1 Oct 2021 20:23:12 +0000 (16:23 -0400)]
gsk: Add high depth rendernode api
Add private api to find out if the content
of a render node should be considered 'deep'.
The information is collected at creation time,
so there is no tree-walking involved when we
are using this information in the renderer.
Currently, this comes down to whether there are
any texture nodes with high depth textures in the subtree.
In the future, we may want to allow marking gradient
nodes in this way as well.
Benjamin Otte [Thu, 7 Oct 2021 00:41:30 +0000 (02:41 +0200)]
texture: Make format a property of GdkTexture
For MemoryTexture, this is a simple change.
For GLTexture, we need to query the format at texture creation. This
sounds like a bad idea and extra work until one realizes that we'd
need to do that anyway when using the texure the first time - either
when downloading, or when trying to use it in a rendernode, where we
will soon need that information to determine if the texture prefers high
depth.
Benjamin Otte [Wed, 6 Oct 2021 20:17:33 +0000 (22:17 +0200)]
testsuite: Fail more accurately
Don't run the full test and then return "something failed" - instead
just explode when you find the failure.
Benjamin Otte [Wed, 6 Oct 2021 20:17:11 +0000 (22:17 +0200)]
cairo: Use GdkTexture for converting from pixbuf
Benjamin Otte [Wed, 6 Oct 2021 16:25:30 +0000 (18:25 +0200)]
gdk: hdr => high depth
The term "hdr" is so overloaded, we shouldn't use them anywhere, except
from maybe describing all of this work in blog posts and other marketing
materials.
So do renames:
* hdr => high_depth
* request_hdr => prefers_high_depth
This more accurately describes what is going on.
Benjamin Otte [Wed, 6 Oct 2021 15:55:14 +0000 (17:55 +0200)]
memoryformat: Add gdk_memory_format_prefers_high_depth()
This is unused so far, but is part of preparations for high depth
support in renderers.
Benjamin Otte [Sat, 25 Sep 2021 02:47:45 +0000 (04:47 +0200)]
gl: Move memory <=> GL format mapping
Put it into gdkmemoryformat.c, where all the mapping goes.
Benjamin Otte [Wed, 22 Sep 2021 00:01:41 +0000 (02:01 +0200)]
memorytexture: Split out GdkMemoryFormat handling
Also, now make gdk_memory_convert() the only conversion functions
and allow conversions between any 2 formats by going via a float[4].
This could be optimized via fast-paths, but so far it isn't.
Matthias Clasen [Wed, 6 Oct 2021 19:19:10 +0000 (19:19 +0000)]
Merge branch 'wip/chergert/dropdown-show-arrow' into 'master'
dropdown: add GtkDropDown:show-arrow property
See merge request GNOME/gtk!4033
Christian Hergert [Wed, 6 Oct 2021 16:56:11 +0000 (09:56 -0700)]
dropdown: fix extraneous * in documentation
Christian Hergert [Tue, 5 Oct 2021 21:27:14 +0000 (14:27 -0700)]
dropdown: add GtkDropDown:show-arrow property
This allows hiding the arrow on the dropdown which cannot otherwise be
controlled via CSS.
Matthias Clasen [Wed, 6 Oct 2021 03:50:04 +0000 (03:50 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
gdk: Fix an oversight
See merge request GNOME/gtk!4035
Matthias Clasen [Wed, 6 Oct 2021 03:23:41 +0000 (23:23 -0400)]
gdk: Fix an oversight
The intention here was obviously to return
the hdr config.
Matthias Clasen [Wed, 6 Oct 2021 02:59:05 +0000 (02:59 +0000)]
Merge branch 'wip/otte/gl-hdr' into 'master'
Rework GL for HDR support
See merge request GNOME/gtk!4032
Benjamin Otte [Wed, 6 Oct 2021 01:33:24 +0000 (03:33 +0200)]
egl: Implement HDR support
If EGL supports:
* no-config contexts
* >8bits pixel formats
* (optionally) floating point pixel formats
Then select such a profile as the HDR format and use it when HDR is
requested.
Benjamin Otte [Sat, 2 Oct 2021 20:38:05 +0000 (22:38 +0200)]
gdk: Add GDK_DEBUG=hdr
Forces request_hdr = TRUE for all requests.
Backends should also use this when choosing whether to honor HDR
requests for low quality compositors - as long as the compositor
pretends to support HDR, shovel HDR at it.
Benjamin Otte [Sat, 2 Oct 2021 20:21:23 +0000 (22:21 +0200)]
gdk: Add a request_hdr argument to begin_frame()
It's not used by anyone, it's just there.
gdk_draw_context_begin_frame_full() has been added so renderers can
make use of it.
Benjamin Otte [Wed, 6 Oct 2021 00:41:31 +0000 (02:41 +0200)]
egl: Support EGL_KHR_no_config_context
If the extension is supported, we create configless contexts.
This will come in handy real soon now, we use different configs for HDR
and SDR.
Benjamin Otte [Wed, 6 Oct 2021 00:36:59 +0000 (02:36 +0200)]
glcontext: Handle failure of eglBindAPI()
We don't want to be sure if we have GL or GLES.
Benjamin Otte [Tue, 5 Oct 2021 22:34:10 +0000 (00:34 +0200)]
egl: Unify contexts
Unify the X11 and Wayland EGL contexts.
This is a bit ugly to implement, because I don't want to create an
interface and I can't make them inherit from the same object, because
one needs to inherit from X11GLContext and the other from
WaylandGLContext.
So we have to put the code in GdkGLContext and make sure non-EGL
contexts can't accidentally run it. This is rather easy because we can
just check for priv->egl_context != NULL.
Benjamin Otte [Tue, 5 Oct 2021 23:32:22 +0000 (01:32 +0200)]
glcontext: Remove unused functionality
The recent changes made and unused function removals make these features
unused.
Benjamin Otte [Tue, 5 Oct 2021 23:26:36 +0000 (01:26 +0200)]
gdk: Remove unused gdk_gl_texture_quads() function
That function carried a lot of baggage.
Benjamin Otte [Tue, 5 Oct 2021 23:23:02 +0000 (01:23 +0200)]
cairo-gl: Don't leak framebuffers
The framebufffer was cached, but never deleted. And because this
function is deprecated and nobody should ever use it: Don't bother with
caching now.
Benjamin Otte [Tue, 5 Oct 2021 22:54:36 +0000 (00:54 +0200)]
wayland: Remove initial GL API bind
This is leftover from before the addition of GLES support.
GTK works fine without OpenGL and just OpenGLES.
Benjamin Otte [Tue, 5 Oct 2021 22:48:33 +0000 (00:48 +0200)]
egl: Move extension checks to GdkDisplay
We check the same extensions anyway, so no need to duplicate the code.
Benjamin Otte [Sun, 3 Oct 2021 19:58:57 +0000 (21:58 +0200)]
egl: Move EGLSurface handling to GdkSurface
Calling gdk_surface_set_egl_native_window() enables this.
Benjamin Otte [Sun, 3 Oct 2021 15:40:09 +0000 (17:40 +0200)]
display: Get carried away by extension checker
I wanted to make it easy to check for multiple extensions and then got
carried away by trying to generate beautiful error messages.
Benjamin Otte [Sun, 3 Oct 2021 06:20:30 +0000 (08:20 +0200)]
surface: Add a private struct
Adding a random member to it resulted in a lot of header surgery as a
side effect.
Benjamin Otte [Sun, 3 Oct 2021 05:20:43 +0000 (07:20 +0200)]
glcontext: The content cannot be the current context
The current context owns a reference to the context, so it cannot be
disposed.
Benjamin Otte [Sun, 3 Oct 2021 05:16:11 +0000 (07:16 +0200)]
x11: Port to shared EGL code
Benjamin Otte [Sun, 3 Oct 2021 04:22:21 +0000 (06:22 +0200)]
egl: Move initialization code and port Wayland
Moves the EGL initialization code to gdk/ so it can be shared between
backends.
Also port the Wayland backend to this code, so I know that it works.
Benjamin Otte [Tue, 5 Oct 2021 02:14:57 +0000 (04:14 +0200)]
build: Add a HAVE_EGL define to config.h
Matthias Clasen [Wed, 6 Oct 2021 00:46:21 +0000 (00:46 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
inspector: Export gtk_inspector_init
See merge request GNOME/gtk!4034
Matthias Clasen [Wed, 6 Oct 2021 00:09:20 +0000 (20:09 -0400)]
inspector: Export gtk_inspector_init
Quietly export this function mainly for the benefit
of libadwaita, which can can use this to install its
implementation of the gtk-inspector-page extension
point.
Benjamin Otte [Fri, 24 Sep 2021 17:43:15 +0000 (19:43 +0200)]
surface: Use g_clear_thing()
Benjamin Otte [Thu, 23 Sep 2021 01:49:59 +0000 (03:49 +0200)]
widget-factory: Name the images pages
Benjamin Otte [Sat, 2 Oct 2021 03:21:29 +0000 (05:21 +0200)]
gdk: Make GDK_DEBUG GL backend selection global
We have a global GdkGLBackendType now, just set it.
This way, using the variable forces the backend type, and we don't need
special code handling the env vars in the backends.
It also means setting the env var will now "work" on GDK backends that
don't even support that GL backend and simualte another GDK backend
having registered that GL backend already. So you can run
GDK_DEBUG=gl-wgl gtk4-demo
on test what Wayland will do when WGL is in use.
Benjamin Otte [Mon, 4 Oct 2021 00:45:03 +0000 (02:45 +0200)]
pathbar: Use correct marshaler
Recent changes to types didn't update the marshaler. Oops.
Benjamin Otte [Mon, 4 Oct 2021 02:26:10 +0000 (04:26 +0200)]
win32: Remove unused variables
Dušan Kazik [Mon, 4 Oct 2021 13:20:03 +0000 (13:20 +0000)]
Update Slovak translation
(cherry picked from commit
14f31183b80ffa20c7c931d3c5e91c4f8c7e3c69)
Matthias Clasen [Mon, 4 Oct 2021 12:25:41 +0000 (12:25 +0000)]
Merge branch 'docs-label' into 'master'
Various documentation fixes
See merge request GNOME/gtk!4029
Emmanuele Bassi [Mon, 4 Oct 2021 10:01:08 +0000 (10:01 +0000)]
Merge branch 'filesearch' into 'master'
searchenginemodel: finalize search results
Closes #3546
See merge request GNOME/gtk!4028
Emmanuele Bassi [Mon, 4 Oct 2021 09:46:45 +0000 (10:46 +0100)]
docs: Replace gtk-doc internal link in GtkRequisition
Emmanuele Bassi [Mon, 4 Oct 2021 09:45:34 +0000 (10:45 +0100)]
docs: Remove gtk-doc link from GtkTreeView::row-activated
Emmanuele Bassi [Mon, 4 Oct 2021 09:42:59 +0000 (10:42 +0100)]
docs: Fix GtkCellLayout description
- Drop gtk-doc internal links
- Escape XML elements
Emmanuele Bassi [Mon, 4 Oct 2021 09:37:29 +0000 (10:37 +0100)]
docs: Remove gtk-doc links from GtkDrawingArea
Emmanuele Bassi [Mon, 4 Oct 2021 09:36:52 +0000 (10:36 +0100)]
docs: Fix up GtkTreeViewColumn
Remove the use of gtk-doc links.
Emmanuele Bassi [Mon, 4 Oct 2021 09:30:02 +0000 (10:30 +0100)]
docs: Clean up GtkCellArea description
- Drop gtk-doc links
- Use gi-docgen links
- Use Markdown code blocks
- Fix code markers around types
Emmanuele Bassi [Mon, 4 Oct 2021 09:16:26 +0000 (10:16 +0100)]
docs: Fix GtkListStore description
- Escape XML elements
- Remove old gtk-doc links
- Add a few internal links
- Use Markdown code blocks
Emmanuele Bassi [Mon, 4 Oct 2021 09:15:51 +0000 (10:15 +0100)]
docs: Fix internal links in for GtkLabel's text layout section
Pierre Ossman [Mon, 4 Oct 2021 07:23:39 +0000 (09:23 +0200)]
searchenginemodel: finalize search results
It is necessary to signal the search engine that we are finished and
that we found something for it to reliably show the results. It would
sometimes work anyway since it is sufficient if any backend signals
completion. However if GtkSearchEngineModel was the only backend
returning results then things would break.
Matthias Clasen [Mon, 4 Oct 2021 03:08:42 +0000 (03:08 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Add depfiles back to resource generation
See merge request GNOME/gtk!4027
Benjamin Otte [Mon, 4 Oct 2021 02:24:54 +0000 (04:24 +0200)]
win32: Comment out unused function
Matthias Clasen [Mon, 4 Oct 2021 01:01:04 +0000 (21:01 -0400)]
Add depfiles back to resource generation
The recent change to faster resource generation
lost the depfiles to ensure that we regenerate
resources when any of the contents change.
Bring it back.
Matthias Clasen [Sun, 3 Oct 2021 19:04:00 +0000 (19:04 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
contentdeserializer: Plug a small memleak
See merge request GNOME/gtk!4026
Matthias Clasen [Sun, 3 Oct 2021 18:51:03 +0000 (14:51 -0400)]
contentdeserializer: Plug a small memleak
Found by asan in ci. We intern the mimetypes
when they are registered, so there is no need
to leak this string.
Matthias Clasen [Sun, 3 Oct 2021 18:33:12 +0000 (18:33 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
ngl: Small docs updates
See merge request GNOME/gtk!4025
Matthias Clasen [Sun, 3 Oct 2021 17:43:15 +0000 (13:43 -0400)]
ngl: Don't cache large glyphs forever
We never put large icons into the icon cache,
so all its items are always atlased, but we do
put large glyphs in to the glyph cache, and we
were never freeing those items, even when they
go unused. Fix that.
Matthias Clasen [Sun, 3 Oct 2021 15:36:19 +0000 (15:36 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
ngl: Drop the texture pool object
See merge request GNOME/gtk!4024
Matthias Clasen [Sun, 3 Oct 2021 15:08:46 +0000 (11:08 -0400)]
ngl: Small docs updates
Don't refer to nonexisting functions.
Anders Jonsson [Sun, 3 Oct 2021 14:16:58 +0000 (14:16 +0000)]
Update Swedish translation
Matthias Clasen [Sun, 3 Oct 2021 06:16:56 +0000 (02:16 -0400)]
ngl: Plug a memory leak
When creating a GdkTexture from the texture
stored in the driver, we must free the GskNglTexture
struct.
Matthias Clasen [Sun, 3 Oct 2021 05:54:41 +0000 (01:54 -0400)]
ngl: Drop the texture pool object
This wasn't serving any clear purpose.
Matthias Clasen [Sun, 3 Oct 2021 05:59:28 +0000 (05:59 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Revert "Add GtkLoader to gtk4-widget-factory"
See merge request GNOME/gtk!4023
Matthias Clasen [Sun, 3 Oct 2021 05:13:36 +0000 (01:13 -0400)]
ngl: Cosmetics
Move _GskNglTextureState to the one place it is used.
Matthias Clasen [Sun, 3 Oct 2021 03:54:06 +0000 (23:54 -0400)]
Revert "Add GtkLoader to gtk4-widget-factory"
This reverts commit
923c944abb6b5305c4f0adda3d20e9abb6381c8a.
This commit broke the image dnd, and the async
loading isn't that important here.
Matthias Clasen [Sat, 2 Oct 2021 16:03:46 +0000 (16:03 +0000)]
Merge branch 'wip/baedert/for-master' into 'master'
build: Print toolchain in summary
See merge request GNOME/gtk!4022
Timm Bäder [Sun, 19 Sep 2021 09:00:07 +0000 (11:00 +0200)]
gdk loaders: Add noreturn attribtues where appropriate
Timm Bäder [Sun, 19 Sep 2021 08:52:36 +0000 (10:52 +0200)]
build: Print toolchain in summary
Would be nice to print CFLAGS and LDFLAGS as well, but that's not as
easy.
Matthias Clasen [Sat, 2 Oct 2021 01:14:35 +0000 (21:14 -0400)]
x11: Better debug for egl
Print the extensions one per line, and sort them
alphabetically, so it is actually possible to find
something in the list.
Also print a short description of the chosen config.