Compare commits

...

24 Commits

Author SHA1 Message Date
Matthias Clasen
f502743621 gpu: Never create empty images
Creating a Vulkan image with width or height zero is an error,
so check at the time when we compute the device pixel rect.

The node file in the included test was devised by Benjamin Otte.

Fixes: #6691
2024-05-06 22:10:38 -04:00
Benjamin Otte
de5b6764bc Merge branch 'wip/otte/for-6694' into 'main'
dmabuf: Ref previous context

Closes #6694

See merge request GNOME/gtk!7232
2024-05-06 22:56:05 +00:00
Benjamin Otte
bc17dfa83d dmabuf: Ref previous context
In case the context's only reference was held by being the current
context, setting the new context would free it.

Resetting it later would then be a use-after-free.

Fixes #6694
2024-05-07 00:34:47 +02:00
Matthias Clasen
84a98f74c1 Merge branch 'fix-test-breakage' into 'main'
Fix recent test breakage

See merge request GNOME/gtk!7233
2024-05-06 21:56:13 +00:00
Matthias Clasen
50facedc47 Fix recent test breakage
I neglected to fix affected tests in 76b0687467, since
ci was down at the time. Sorry about that.
2024-05-06 17:11:44 -04:00
Matthias Clasen
200cacc3ad Merge branch 'matthiasc/for-main' into 'main'
inspector: Show more key event details

See merge request GNOME/gtk!7224
2024-05-05 17:29:29 +00:00
Matthias Clasen
eed3cab29f Merge branch 'list-item-factory-docs' into 'main'
docs: Clarify types for BuilderListItemFactory

See merge request GNOME/gtk!7226
2024-05-05 15:00:49 +00:00
Matthias Clasen
76b0687467 Put newlines before base64 blobs
This makes things look a bit cleaner in the node editor, since
the first line no longer sticks out.
2024-05-05 10:16:01 -04:00
Matthias Clasen
5039dc40f8 Merge branch 'main' into 'main'
vulkan: Don't queue presentation if image acquisition fails

See merge request GNOME/gtk!7204
2024-05-05 04:06:44 +00:00
Doğukan Korkmaztürk
7c3de4a2da vulkan: Recreate swapchain when it is necessary or beneficial
Currently, GTK does not check the result of vkAcquireNextImageKHR() and
assumes that it always succeeds. As a result, the vkQueuePresentKHR() is
unconditionally set to wait for the semaphore passed to
vkAcquireNextImageKHR() earlier.

However, if vkAcquireNextImageKHR() fails for some reason, the semaphore
passed to it does not get signalled. This causes the presentation
command to wait for the semaphore to be signalled indefinitely, which
causes GTK to hang.

This change adds error handling around vkAcquireNextImageKHR() to make
GTK recreate the Vulkan swapchain when it is necessary or beneficial and
helps avoiding situations that could cause indefinite waits.
2024-05-04 22:14:33 -04:00
Matthias Clasen
b486e9b760 inspector: Show more key event details
Consumed modifiers are relevant to understanding why shortcut
do or do not match, so show them.
2024-05-04 21:29:40 -04:00
Matthias Clasen
ce2fd8a0d0 NEWS: Updates 2024-05-04 21:29:40 -04:00
Hugo Carvalho
99b1b26fdb Update Portuguese translation
(cherry picked from commit a249b58094)
2024-05-04 22:23:06 +00:00
James Westman
b7e4bbaf74 docs: Clarify types for BuilderListItemFactory
The docs for GtkBuilderListItemFactory previously stated that the
template must extend GtkListItem. However, this is not always true.
GtkListView has headers which must extend GtkListHeader, and
GtkColumnView has its own types.

Clarified this in the GtkBuilderListItemFactory docs, and specified the
expected types in the GtkColumnView, GtkListView, and GtkGridView docs.
2024-05-04 13:20:41 -05:00
Matthias Clasen
f579b171a9 Merge branch 'gbsneto/more-win32-cleanups' into 'main'
Various cleanups around Win32

See merge request GNOME/gtk!7223
2024-05-03 17:27:05 +00:00
Georges Basile Stavracas Neto
f9929d15eb gtk-demo: Remove set-but-unused variable 2024-05-03 12:30:39 -03:00
Georges Basile Stavracas Neto
c45a6ad52d gsk/gpu: Use G_GSIZE_FORMAT for printing gsizes
On Windows, gsize is a long long unsigned. The compiler complains about
that.

Use G_GSIZE_FORMAT which translates to %llu on Windows, %lu on most
platforms, and sometimes just %u on rare cases.
2024-05-03 12:30:39 -03:00
Matthias Clasen
7233e38aa8 Merge branch 'gbsneto/cleanup-meson-profiler' into 'main'
testsuite: Remove leftover code from meson.build

See merge request GNOME/gtk!7222
2024-05-03 13:44:07 +00:00
Benjamin Otte
73ba97acd9 Merge branch 'duplicate-gl-version' into 'main'
glcontext: Remove duplicate check for GL version

See merge request GNOME/gtk!7221
2024-05-03 13:42:03 +00:00
Georges Basile Stavracas Neto
7d2ad604d2 win32/vulkancontext: Remove unused variable
Silences a compiler warning.
2024-05-03 09:52:57 -03:00
Georges Basile Stavracas Neto
45e64b915c win32/wgl: Initialize hwnd to NULL
Otherwise there's a valid code path that may return it uninitialized.
2024-05-03 09:51:46 -03:00
Georges Basile Stavracas Neto
ebaef9f18b win32/cursor: Ignore GdkPixbuf deprecation warning
Seems harmless to ignore this for now, other bits of code also ignore
this.
2024-05-03 09:49:46 -03:00
Robert Ancell
c73fe8ac4a glcontext: Remove duplicate check for GL version 2024-05-03 16:40:01 +12:00
Georges Basile Stavracas Neto
8ed8f883d1 testsuite: Remove leftover code from meson.build
Performance tests were dropped at 5dd0d39a6b. The 'profiler' option
was renamed to 'sysprof' by commit e915a1aa7f.
2024-05-02 20:28:27 -03:00
32 changed files with 2086 additions and 1190 deletions

48
NEWS
View File

@@ -1,6 +1,54 @@
Overview of Changes in 4.15.1, xx-xx-xxxx
=========================================
* GtkGraphicsOffload:
- Don't crash without a child
* CSS:
- Support the :root selector
* Icontheme:
- Make symbolic svg loading more efficient
- Handle color-free symbolics more efficiently
* Accessibility:
- Make the gtk-demo sidebar search more accessible
- Stop emitting focus events
* GDK:
- Support XDG_ACTIVATION_TOKEN
- dmabuf: Be more defensive when importing unknown formats to GL
- dmabuf: Use narrow range for YUV
* GSK:
- Improve logging for GDK_DEBUG=offload
- Improve logging for GSK_DEBUG=renderer
- gpu: Warn about inefficient texture import
- gpu: Handle tiny offscreens correctly
- vulkan: Add profiler marks in various places
- vulkan: Fix a problem with imported dmabufs showing up black
* Wayland:
- Use wl_compositor version 6
* X11:
- Implement a missing method
* Build:
- Fix many ubsan warnings
* Debugging:
- Show more texture details in the recorder
* macOS:
- Fix problems with events handed back to the OS
- Respect GDK_DEBUG=default-settings
* Translation updates:
Korean
Turkish
Overview of Changes in 4.15.0, 21-04-2024
=========================================

View File

@@ -40,7 +40,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
{
wchar_t *langname_w = NULL;
wchar_t locale_abbrev_w[9];
gchar *langname, *locale_abbrev, *locale, *p;
gchar *langname, *locale_abbrev, *locale;
gint i;
const LCTYPE iso639_lctypes[] = { LOCALE_SISO639LANGNAME, LOCALE_SISO639LANGNAME2 };
GHashTable *ht_scripts_langs = (GHashTable *) param;
@@ -59,7 +59,6 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, langname_size);
langname = g_utf16_to_utf8 (langname_w, -1, NULL, NULL, NULL);
locale = g_utf16_to_utf8 (locale_w, -1, NULL, NULL, NULL);
p = strchr (locale, '-');
lang = pango_language_from_string (locale);
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
g_hash_table_insert (ht_scripts_langs, lang, langname);

View File

@@ -163,6 +163,8 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
return NULL;
previous = gdk_gl_context_get_current ();
if (previous)
g_object_ref (previous);
formats = gdk_dmabuf_formats_builder_new ();
external = gdk_dmabuf_formats_builder_new ();
@@ -194,7 +196,10 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
}
if (previous)
gdk_gl_context_make_current (previous);
{
gdk_gl_context_make_current (previous);
g_object_unref (previous);
}
return GDK_DMABUF_DOWNLOADER (renderer);
}

View File

@@ -1956,8 +1956,6 @@ gdk_gl_context_get_glsl_version_string (GdkGLContext *self)
return "#version 310 es";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
return "#version 300 es";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
return "#version 300 es";
else
return "#version 100";
}

View File

@@ -632,6 +632,7 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
{
GdkVulkanContext *context = GDK_VULKAN_CONTEXT (draw_context);
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
VkResult acquire_result;
guint i;
if (depth != priv->current_format)
@@ -653,12 +654,29 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
cairo_region_union (priv->regions[i], region);
}
GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
priv->swapchain,
UINT64_MAX,
priv->draw_semaphore,
VK_NULL_HANDLE,
&priv->draw_index);
acquire_next_image:
acquire_result = GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
priv->swapchain,
UINT64_MAX,
priv->draw_semaphore,
VK_NULL_HANDLE,
&priv->draw_index);
if ((acquire_result == VK_ERROR_OUT_OF_DATE_KHR) ||
(acquire_result == VK_SUBOPTIMAL_KHR))
{
GError *error = NULL;
GDK_DEBUG (VULKAN, "Recreating the swapchain");
if (!gdk_vulkan_context_check_swapchain (context, &error))
{
g_warning ("%s", error->message);
g_error_free (error);
return;
}
goto acquire_next_image;
}
cairo_region_union (region, priv->regions[priv->draw_index]);
}

View File

@@ -908,7 +908,9 @@ _gdk_win32_create_hicon_for_texture (GdkTexture *texture,
width = cairo_image_surface_get_width (surface);
height = cairo_image_surface_get_height (surface);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);
G_GNUC_END_IGNORE_DEPRECATIONS
icon = pixbuf_to_hicon (pixbuf, is_icon, x, y);

View File

@@ -267,7 +267,7 @@ create_dummy_gl_window (void)
{
WNDCLASS wclass = { 0, };
ATOM klass;
HWND hwnd;
HWND hwnd = NULL;
wclass.lpszClassName = "GdkGLDummyWindow";
wclass.lpfnWndProc = DefWindowProc;

View File

@@ -38,7 +38,6 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
{
GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
GdkWin32Surface *win32_surface = GDK_WIN32_SURFACE (window);
VkWin32SurfaceCreateInfoKHR info;
VkResult result;

View File

@@ -546,7 +546,7 @@ gsk_gpu_device_maybe_gc (GskGpuDevice *self)
if (priv->cache_timeout == 0 || dead_texture_pixels > 1000000)
{
GSK_DEBUG (GLYPH_CACHE, "Pre-frame GC (%lu dead pixels)", dead_texture_pixels);
GSK_DEBUG (GLYPH_CACHE, "Pre-frame GC (%" G_GSIZE_FORMAT " dead pixels)", dead_texture_pixels);
gsk_gpu_device_gc (self, g_get_monotonic_time ());
}
}

View File

@@ -311,7 +311,7 @@ gsk_gpu_node_processor_add_images (GskGpuNodeProcessor *self,
while (desc != self->desc);
}
static void
static gboolean G_GNUC_WARN_UNUSED_RESULT
rect_round_to_pixels (const graphene_rect_t *src,
const graphene_vec2_t *pixel_scale,
const graphene_point_t *pixel_offset,
@@ -331,6 +331,8 @@ rect_round_to_pixels (const graphene_rect_t *src,
y * inv_yscale - pixel_offset->y,
(ceilf ((src->origin.x + pixel_offset->x + src->size.width) * xscale) - x) * inv_xscale,
(ceilf ((src->origin.y + pixel_offset->y + src->size.height) * yscale) - y) * inv_yscale);
return ceilf (xscale * dest->size.width) > 0 && ceilf (yscale * dest->size.height) > 0;
}
static GskGpuImage *
@@ -963,7 +965,9 @@ gsk_gpu_node_processor_get_node_as_image (GskGpuNodeProcessor *self,
if (!gsk_rect_intersection (clip_bounds, &node->bounds, &clip))
return NULL;
}
rect_round_to_pixels (&clip, &self->scale, &self->offset, &clip);
if (!rect_round_to_pixels (&clip, &self->scale, &self->offset, &clip))
return NULL;
image = gsk_gpu_get_node_as_image (self->frame,
&clip,
@@ -1020,7 +1024,8 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
if (!gsk_rect_intersection (rect, &clip_rect, &intermediate_rect))
return;
rect_round_to_pixels (&intermediate_rect, &self->scale, &self->offset, &intermediate_rect);
if (!rect_round_to_pixels (&intermediate_rect, &self->scale, &self->offset, &intermediate_rect))
return;
intermediate = gsk_gpu_node_processor_init_draw (&other,
self->frame,
@@ -1083,7 +1088,8 @@ gsk_gpu_node_processor_add_fallback_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clipped_bounds))
return;
rect_round_to_pixels (&clipped_bounds, &self->scale, &self->offset, &clipped_bounds);
if (!rect_round_to_pixels (&clipped_bounds, &self->scale, &self->offset, &clipped_bounds))
return;
gsk_gpu_node_processor_sync_globals (self, 0);
@@ -1439,7 +1445,9 @@ gsk_gpu_node_processor_add_rounded_clip_node_with_mask (GskGpuNodeProcessor *sel
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clip_bounds))
return;
rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds);
if (!rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds))
return;
child_image = gsk_gpu_node_processor_get_node_as_image (self,
0,
@@ -2068,7 +2076,9 @@ gsk_gpu_node_processor_add_texture_scale_node (GskGpuNodeProcessor *self,
gsk_gpu_node_processor_get_clip_bounds (self, &clip_bounds);
/* first round to pixel boundaries, so we make sure the full pixels are covered */
rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds);
if (!rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds))
return;
/* then expand by half a pixel so that pixels needed for eventual linear
* filtering are available */
graphene_rect_inset (&clip_bounds, -0.5, -0.5);
@@ -2276,7 +2286,9 @@ gsk_gpu_node_processor_add_gradient_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &bounds))
return;
rect_round_to_pixels (&bounds, &self->scale, &self->offset, &bounds);
if (!rect_round_to_pixels (&bounds, &self->scale, &self->offset, &bounds))
return;
image = gsk_gpu_node_processor_init_draw (&other,
self->frame,
@@ -3581,7 +3593,9 @@ gsk_gpu_node_processor_add_fill_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clip_bounds))
return;
rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds);
if (!rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds))
return;
child = gsk_fill_node_get_child (node);
@@ -3678,7 +3692,9 @@ gsk_gpu_node_processor_add_stroke_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clip_bounds))
return;
rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds);
if (!rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds))
return;
child = gsk_stroke_node_get_child (node);
@@ -4111,15 +4127,17 @@ gsk_gpu_node_processor_create_node_pattern (GskGpuPatternWriter *self,
gsk_gpu_descriptors_set_size (self->desc, images_before, buffers_before);
}
rect_round_to_pixels (&GRAPHENE_RECT_INIT (
self->bounds.origin.x - self->offset.x,
self->bounds.origin.y - self->offset.y,
self->bounds.size.width,
self->bounds.size.height
),
&self->scale,
&self->offset,
&bounds);
if (!rect_round_to_pixels (&GRAPHENE_RECT_INIT (
self->bounds.origin.x - self->offset.x,
self->bounds.origin.y - self->offset.y,
self->bounds.size.width,
self->bounds.size.height
),
&self->scale,
&self->offset,
&bounds))
return TRUE;
image = gsk_gpu_get_node_as_image (self->frame,
&bounds,
&self->scale,

View File

@@ -1139,7 +1139,7 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
format);
GSK_DEBUG (SHADERS,
"Create Vulkan pipeline (%s %s, %u/%s/%s/%u) for layout (%lu/%lu/%lu)",
"Create Vulkan pipeline (%s %s, %u/%s/%s/%u) for layout (%" G_GSIZE_FORMAT "/%" G_GSIZE_FORMAT "/%" G_GSIZE_FORMAT ")",
op_class->shader_name,
version_string + 1,
variation,

View File

@@ -3560,13 +3560,13 @@ append_texture_param (Printer *p,
case GDK_MEMORY_U8:
case GDK_MEMORY_U16:
bytes = gdk_texture_save_to_png_bytes (texture);
g_string_append (p->str, "url(\"data:image/png;base64,");
g_string_append (p->str, "url(\"data:image/png;base64,\\\n");
break;
case GDK_MEMORY_FLOAT16:
case GDK_MEMORY_FLOAT32:
bytes = gdk_texture_save_to_tiff_bytes (texture);
g_string_append (p->str, "url(\"data:image/tiff;base64,");
g_string_append (p->str, "url(\"data:image/tiff;base64,\\\n");
break;
default:
@@ -3625,7 +3625,7 @@ gsk_text_node_serialize_font (GskRenderNode *node,
b64 = base64_encode_with_linebreaks ((const guchar *) data, len);
g_string_append (p->str, " url(\"data:font/ttf;base64,");
g_string_append (p->str, " url(\"data:font/ttf;base64,\\\n");
append_escaping_newlines (p->str, b64);
g_string_append (p->str, "\")");
@@ -4443,7 +4443,7 @@ render_node_print (Printer *p,
cairo_surface_write_to_png_stream (surface, cairo_write_array, array);
_indent (p);
g_string_append (p->str, "pixels: url(\"data:image/png;base64,");
g_string_append (p->str, "pixels: url(\"data:image/png;base64,\\\n");
b64 = base64_encode_with_linebreaks (array->data, array->len);
append_escaping_newlines (p->str, b64);
g_free (b64);
@@ -4463,7 +4463,7 @@ render_node_print (Printer *p,
if (cairo_script_from_recording_surface (script, surface) == CAIRO_STATUS_SUCCESS)
{
_indent (p);
g_string_append (p->str, "script: url(\"data:;base64,");
g_string_append (p->str, "script: url(\"data:;base64,\\\n");
b64 = base64_encode_with_linebreaks (array->data, array->len);
append_escaping_newlines (p->str, b64);
g_free (b64);

View File

@@ -32,8 +32,12 @@
* `GtkBuilderListItemFactory` is a `GtkListItemFactory` that creates
* widgets by instantiating `GtkBuilder` UI templates.
*
* The templates must be extending `GtkListItem`, and typically use
* `GtkExpression`s to obtain data from the items in the model.
* The templates must extend the class that the parent widget expects.
* For example, a factory provided to [property@Gtk.ListView:factory] must have
* a template that extends [class@Gtk.ListItem].
*
* Templates typically use `GtkExpression`s to obtain data from the items
* in the model.
*
* Example:
* ```xml
@@ -203,7 +207,7 @@ gtk_builder_list_item_factory_set_property (GObject *object,
case PROP_RESOURCE:
{
GError *error = NULL;
GBytes *bytes;
GBytes *bytes;
const char *resource;
resource = g_value_get_string (value);

View File

@@ -861,6 +861,8 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
*
* The factory used for configuring rows.
*
* The factory must be for configuring [class@Gtk.ColumnViewRow] objects.
*
* Since: 4.12
*/
properties[PROP_ROW_FACTORY] =
@@ -926,6 +928,8 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
*
* Factory for creating header widgets.
*
* The factory must be for configuring [class@Gtk.ListHeader] objects.
*
* Since: 4.12
*/
properties[PROP_HEADER_FACTORY] =

View File

@@ -255,6 +255,8 @@ gtk_column_view_column_class_init (GtkColumnViewColumnClass *klass)
* GtkColumnViewColumn:factory: (attributes org.gtk.Property.get=gtk_column_view_column_get_factory org.gtk.Property.set=gtk_column_view_column_set_factory)
*
* Factory for populating list items.
*
* The factory must be for configuring [class@Gtk.ColumnViewCell] objects.
*/
properties[PROP_FACTORY] =
g_param_spec_object ("factory", NULL, NULL,
@@ -761,7 +763,7 @@ gtk_column_view_column_remove_from_sorter (GtkColumnViewColumn *self)
{
if (self->view == NULL)
return;
gtk_column_view_sorter_remove_column (GTK_COLUMN_VIEW_SORTER (gtk_column_view_get_sorter (self->view)), self);
}

View File

@@ -1109,6 +1109,8 @@ gtk_grid_view_class_init (GtkGridViewClass *klass)
* GtkGridView:factory: (attributes org.gtk.Property.get=gtk_grid_view_get_factory org.gtk.Property.set=gtk_grid_view_set_factory)
*
* Factory for populating list items.
*
* The factory must be for configuring [class@Gtk.ListItem] objects.
*/
properties[PROP_FACTORY] =
g_param_spec_object ("factory", NULL, NULL,

View File

@@ -881,6 +881,8 @@ gtk_list_view_class_init (GtkListViewClass *klass)
* GtkListView:factory: (attributes org.gtk.Property.get=gtk_list_view_get_factory org.gtk.Property.set=gtk_list_view_set_factory)
*
* Factory for populating list items.
*
* The factory must be for configuring [class@Gtk.ListItem] objects.
*/
properties[PROP_FACTORY] =
g_param_spec_object ("factory", NULL, NULL,
@@ -892,6 +894,8 @@ gtk_list_view_class_init (GtkListViewClass *klass)
*
* Factory for creating header widgets.
*
* The factory must be for configuring [class@Gtk.ListHeader] objects.
*
* Since: 4.12
*/
properties[PROP_HEADER_FACTORY] =
@@ -1355,7 +1359,7 @@ gtk_list_view_get_tab_behavior (GtkListView *self)
* @pos: position of the item
* @flags: actions to perform
* @scroll: (nullable) (transfer full): details of how to perform
* the scroll operation or %NULL to scroll into view
* the scroll operation or %NULL to scroll into view
*
* Scrolls to the item at the given position and performs the actions
* specified in @flags.

View File

@@ -1774,6 +1774,10 @@ populate_event_properties (GListStore *store,
case GDK_KEY_RELEASE:
{
char *tmp;
tmp = modifier_names (gdk_key_event_get_consumed_modifiers (event));
add_text_row (store, "Consumed modifiers", "%s", tmp);
g_free (tmp);
add_int_row (store, "Keycode", gdk_key_event_get_keycode (event));
add_int_row (store, "Keyval", gdk_key_event_get_keyval (event));
tmp = key_event_string (event);

2956
po/pt.po

File diff suppressed because it is too large Load Diff

View File

@@ -52,31 +52,3 @@ test('transition', transition,
suite: 'css'
)
if false and get_option ('profiler')
adwaita_env = csstest_env
adwaita_env.set('GTK_THEME', 'Adwaita')
test('performance-adwaita', test_performance,
args: [
'--mark', 'css validation',
'--name', 'performance-adwaita',
'--output', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: adwaita_env,
suite: [ 'css' ],
)
empty_env = csstest_env
empty_env.set('GTK_THEME', 'Empty')
test('performance-empty', test_performance,
args: [
'--mark', 'css validation',
'--name', 'performance-empty',
'--output', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: empty_env,
suite: [ 'css' ],
)
endif

View File

@@ -0,0 +1,41 @@
clip {
/* Numbers that trigger rounding errors at 125%:
9, 13, 18, 21, 26, 31, 36, 42, 47, 52, 57, 62, 67, 72, 77, 84, 89, 94, 99, ...
*/
clip: 0 0 9 13;
child: transform {
/* This is a typical fractional scale factor. It is 5/4.
The inverse is 4/5, and that number cannot be represented as
a float.
The renderer does however operate in the scaled coordinate system,
So this will translate the clip rect above to the scaled clip rect
0 0 7.20000029 10.4000006
*/
transform: scale(1.25);
child: container {
/* This color node exists just so that the bounds of the clipped node
are large enough. Otherwise the node bounds computation might end
up detecting that the clip is actually empty, because it scales
the other way: It multiplies by 1.25, not by 0.8.
*/
color {
color: black;
bounds: 0 0 50 50;
}
/* This node has bounds of 7.2 0 10 10 - which gets translated to
7.19999981 0 10.000001 10 during parsing of the path.
And because 7.19999981 < 7.20000029 this node might not be considered
fully clipped, even though it really should be.
*/
fill {
path: "M 7.2 0 l 10 0 l 0 10 l -10 0 z";
child: color {
color: red;
bounds: 0 0 50 50;
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

View File

@@ -73,6 +73,7 @@ compare_render_tests = [
'empty-shadow',
'empty-texture',
'empty-transform',
'empty-fallback',
'fill',
'fill2',
'fill-clipped-nogl',

View File

@@ -1,6 +1,7 @@
texture-scale {
bounds: 0 0 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
");
}

View File

@@ -1,6 +1,7 @@
texture {
bounds: 0 0 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
");
}

View File

@@ -1,5 +1,6 @@
text {
font: "text-mixed-color 10px" url("data:font/ttf;base64,AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
font: "text-mixed-color 10px" url("data:font/ttf;base64,\
AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
AAA0Z2x5Zu8g4kAAAAGEAAAA0mhlYWQmofyJAAAArAAAADZoaGVhDAEEAgAAAOQAAAAkaG10eAQA\
AQAAAAEoAAAAFGxvY2EAyAD5AAABcAAAABRtYXhwAAwACQAAAQgAAAAgbmFtZX7VdrQAAAJYAAAA\
IgABAAAAARmajs74k18PPPUAAggAAAAAAOHCPQAAAAAA4cpY+QAAAAAEAAgAAAAAAQACAAAAAAAA\

View File

@@ -1,5 +1,6 @@
text {
font: "text-mixed-color 10px" url("data:font/ttf;base64,AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
font: "text-mixed-color 10px" url("data:font/ttf;base64,\
AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
AAA0Z2x5Zu8g4kAAAAGEAAAA0mhlYWQmofyJAAAArAAAADZoaGVhDAEEAgAAAOQAAAAkaG10eAQA\
AQAAAAEoAAAAFGxvY2EAyAD5AAABcAAAABRtYXhwAAwACQAAAQgAAAAgbmFtZX7VdrQAAAJYAAAA\
IgABAAAAARmajs74k18PPPUAAggAAAAAAOHCPQAAAAAA4cpY+QAAAAAEAAgAAAAAAQACAAAAAAAA\

View File

@@ -1,6 +1,7 @@
texture {
bounds: 0 0 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
");
}

View File

@@ -1,6 +1,7 @@
texture {
bounds: 0 0 1 1;
texture: "texture1" url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4z8DwHwAFAAH/q842\
texture: "texture1" url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4z8DwHwAFAAH/q842\
iQAAAABJRU5ErkJggg==\
");
}

View File

@@ -1,26 +1,30 @@
texture-scale {
bounds: 0 0 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
");
}
texture-scale {
bounds: 0 0 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
");
}
texture-scale {
bounds: 0 0 50 50;
filter: nearest;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
");
}
texture-scale {
bounds: 0 0 50 50;
filter: trilinear;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
");
}

View File

@@ -1,6 +1,7 @@
texture-scale {
bounds: 0 0 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
");
}

View File

@@ -277,27 +277,3 @@ make_pot = find_program ('make-pot', dirs: meson.project_source_root())
test('potfiles', make_pot,
workdir: meson.project_source_root(),
suite: ['gtk', 'translations' ])
if false and get_option ('profiler')
performance_env = test_env
performance_env.set('GTK_THEME', 'Empty')
test('performance-layout', test_performance,
args: [
'--mark', 'size allocation',
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: performance_env,
suite: [ 'gtk' ],
)
test('performance-snapshot', test_performance,
args: [
'--mark', 'widget snapshot',
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: performance_env,
suite: [ 'gtk' ],
)
endif