Commit Graph

71544 Commits

Author SHA1 Message Date
Benjamin Otte
bf5350e13c Merge branch 'label-sizing' into 'master'
Make label-sizing reftest pass

See merge request GNOME/gtk!4076
2021-10-19 00:19:52 +00:00
Benjamin Otte
3742fabae0 widget: Don't overadjust allocations
When adjusting allocations, don't query height for the current width,
but query it for the adjusted width.

And adjust width not to the width-for-any-height, but to
width-for-allocated-height.
2021-10-19 01:55:59 +02:00
Benjamin Otte
192e554f3e testsuite: don't XFAIL label-sizing anymore
It's fixed now.
2021-10-19 01:10:59 +02:00
Benjamin Otte
00214cbb4a testsuite: Add test specifically for recent fix
label-sizing.ui tests this, too - but that test tests lots of other
things, and if this ever happens again, we want to debug it in a small
test.
2021-10-19 01:10:59 +02:00
Benjamin Otte
ba44e7a228 label: Never measure more than max-width-chars
Even when we have tons of width available, still do the wrapping at
max-width-chars.

This is what happened in GTK3, too, but it happened automatically
because GTK3 did for_size = MIN (for_size, nat_size) and GTK4 does not.

So we do this manually in the label now.

Fixes the label-sizing.ui reftest.
2021-10-19 01:04:25 +02:00
Benjamin Otte
cad979b734 reftest: On failure, save the node files, too
Doesn't hurt to have them available, so it's easy to figure out if a
failure is due to the renderer or if we're generating wrong node files.
2021-10-19 01:01:36 +02:00
Alexander Mikhaylenko
1c5a4de176 levelbar: Fill the whole space for discrete level bars
Ideally this would be using box layout, but it overrides measure() so it's
not possible - so reimplement it instead. Fix an accidentally int division
along the way.
2021-10-19 02:13:49 +05:00
Emmanuele Bassi
ad46e65dff Merge branch 'wip/cdavis/flowbox-add-functions' into 'master'
gtkflowbox: Add prepend() and append()

Closes #4277

See merge request GNOME/gtk!4013
2021-10-18 21:09:10 +00:00
Matthias Clasen
5dec1b0cc0 Merge branch 'wip/baedert/for-master' into 'master'
Some fixes, hmm yes

See merge request GNOME/gtk!4068
2021-10-18 20:58:46 +00:00
Matthias Clasen
c80e877c28 css: Fix handling of percentage for line-height
We weren't doing the right thing here.
This is simpler, and works.

Fixes: #4354
2021-10-18 16:53:46 -04:00
Matthias Clasen
5ff9f4a435 Merge branch 'matthiasc/for-master' into 'master'
Small fixes

Closes #4248

See merge request GNOME/gtk!4072
2021-10-18 18:00:33 +00:00
Matthias Clasen
bd1649e5f4 Merge branch 'feature/calendar-first-day' into 'master'
calendar: Fix abbreviated day names

Closes #4338

See merge request GNOME/gtk!4061
2021-10-18 15:08:35 +00:00
Matthias Clasen
b7cab5c5eb ci: Allow macos to fail
The macos runner is out of commission atm
2021-10-18 11:00:27 -04:00
Jonas Ådahl
6067a556d7 Merge branch 'work/reset_opaque' into 'master'
wayland: Mark opaque_region as dirty on hide

See merge request GNOME/gtk!4020
2021-10-18 13:45:32 +00:00
Jonas Ådahl
6a07a853b0 Merge branch 'work/tidy' into 'master'
wayland: miscellaneous minor tidy ups

See merge request GNOME/gtk!4066
2021-10-18 13:44:52 +00:00
Benjamin Otte
886f435fc8 Merge branch 'wip/otte/for-master' into 'master'
glcontext: reinstate another missing "!"

See merge request GNOME/gtk!4070
2021-10-18 13:32:02 +00:00
Matthias Clasen
96e837ae9f Improve a msgid
Instead of gl-context, say "GL Context".

Fixes: #4248
2021-10-18 08:35:54 -04:00
Matthias Clasen
bddf9f9ca3 docs: Cosmetics
Do a round of "the the" removal.
2021-10-18 08:35:54 -04:00
Matthias Clasen
5f3062aff0 docs: Cosmetics 2021-10-18 08:35:54 -04:00
Benjamin Otte
a859471960 testsuite: Add workarounds for non-gl backends
read: Fix tests for broadway
2021-10-18 14:17:11 +02:00
Benjamin Otte
5b47391162 broadway: Use gdk_texture_save_to_png_bytes()
Instead of using Cairo, save the texture directly.
2021-10-18 12:08:57 +02:00
Benjamin Otte
dcba783389 gdk: Rework gdk_pixbuf_get_from_texture()
Make it use gdk_memory_texture_from_texture().

Also make gdk_memory_format_alpha() privately available so that we can
detect if an image contains an alpha channel.
2021-10-18 12:08:57 +02:00
Benjamin Otte
7eceed8d4d jpeg: Use gdk_memory_texture_from_texture() 2021-10-18 12:08:57 +02:00
Benjamin Otte
800246402f tiff: Refactor
Now we support all the formats.
2021-10-18 12:08:57 +02:00
Benjamin Otte
c7e36bcf22 gltexture: Fix conditions for glGetTexImage() call
The conditions were inverted, plus we failed to limit this call to
non-GLES.
2021-10-17 22:28:44 +02:00
Benjamin Otte
79d2a14061 glcontext: reinstate another missing "!"
A leftover from aa0c22b648.
2021-10-17 22:28:44 +02:00
Timm Bäder
085f0171c1 Ensure blur nodes have a positive blur radius 2021-10-17 12:15:34 +02:00
Timm Bäder
e7ac8275ea main: Flip set_widget_active_state() logic
The function used to take a boolean, just to set the active state of the
widget to the exact opposite of that boolean. Fix that.
2021-10-17 11:21:00 +02:00
Timm Bäder
03d4ac1863 theme: enable tabular numbers in GtkCalendar
It aligns numbers a lot so this makes sense.
2021-10-17 11:12:14 +02:00
Timm Bäder
a61999170e fontrendering: Protect against NULL hints 2021-10-17 11:12:14 +02:00
Timm Bäder
beda50f631 cssparser: Make a signed expression unsigned 2021-10-17 11:12:14 +02:00
Benjamin Otte
cf7ee82755 Merge branch 'fix-dnd-coordinates-on-windows' into 'master'
Fix DND coordinates on Windows

See merge request GNOME/gtk!3930
2021-10-16 17:04:26 +00:00
Benjamin Otte
f6e5a33952 Merge branch 'wip/otte/for-master' into 'master'
glcontext: Reinstate missing "!"

Closes #4349

See merge request GNOME/gtk!4067
2021-10-16 14:11:00 +00:00
Benjamin Otte
7a50ebaa3f gdk: Move GdkMemoryFormat enum to gdktypes.h
It's used in too many places now.
2021-10-16 15:49:37 +02:00
Benjamin Otte
aa0c22b648 glcontext: Reinstate missing "!"
Replacing the return_if_fail()s in commit f584d4f500 lost the
inversions.

Fixes #4349
2021-10-16 15:49:02 +02:00
David Edmundson
aa258fa17f wayland: port code to g_clear_pointer 2021-10-15 12:03:57 +01:00
David Edmundson
66de8f33fb wayland: drop unused member variables 2021-10-15 11:53:18 +01:00
Christian Hergert
e3ef21f770 macos: fix scale on macOS 12 beta
This is a port of the fix in the quartz backend to the new macOS backend.

From the original commit:

In macOS-12.sdk CGContextConverSizeToDeviceSpace returns a negative
height and passing that to CGContextScaleCTM in turn causes the cairo
surface to draw outside the window where it can't be seen. Passing the
absolute values of the scale factors fixes the display on macOS 12 without
affecting earlier macOS versions.
2021-10-14 14:46:30 -07:00
Benjamin Otte
a7ef4c75ea Merge branch 'wip/otte/memoryformat' into 'master'
Refactor various texture machinery

See merge request GNOME/gtk!4057
2021-10-13 12:51:37 +00:00
Benjamin Otte
9a2e9c5be4 gl: Use gdk_memory_texture_new_from_texture()
Way less code to prepare the texture in a proper format.
2021-10-13 14:33:44 +02:00
Benjamin Otte
ddc4a40c33 gl: Refactor texture uploading
Don't pass texture + rect, but instead have
  gdk_memory_texture_new_subtexture()
and use it to generate subtextures and pass them.

This has the advantage of downloading the a too large texture only once
instead of N times.
2021-10-13 14:33:44 +02:00
Benjamin Otte
52e88ed4c8 gltexture: Determine format in current thread
Close widget-factory and observe:

Thread 1:
 * acquire main loop
 * handle close button
 * close window
 * dispose video and media stream
 * stop GstPlayer
WAIT on pipeline stopping

Thread 2:
 * prepare next image in pipeline
 * hand image to GtkGstSink
 * create GdkTexture from image
 * gdk_gl_texture_new() determines format
WAIT on acquiring main loop

Sounds like a deadlock?

Indeed, so don't do that.
2021-10-13 14:33:44 +02:00
Benjamin Otte
5199bebdb5 gl: Move texture uploading to the renderer
It does not belong in GdkGLContext, it's a renderer thing.
It's also the only user of that API.

Introduce gdk_gl_context_check_version() private API to make version
checks simpler.
2021-10-13 14:33:44 +02:00
Benjamin Otte
31e9072906 gl: Fix downloading textures *again*
It turns out glReadPixels() cannot convert pixels and you are only
allowed to pass a single value into the function arguments. You need to
know which ones or things will explode.

GL is great.
2021-10-13 14:33:44 +02:00
Benjamin Otte
c2368cc605 png: Refactor png saving
Do all the memory format shenanigans in GTK now and support all the PNG
formats.
2021-10-13 14:33:44 +02:00
Benjamin Otte
1e7fb52b21 Add memory formats used by libpng
Add unpremultiplied high-depth formats. They are used in the real world,
so let's support them.
2021-10-13 14:33:44 +02:00
Chun-wei Fan
53705a537c tools/generate-uac-manifest.py: Fix UAC manifest .rc
The resource compiler in the Windows 11 SDK does not allow one to include
winuser.h directly in resource scripts (.rc) with a rather cryptic error
message, so fix generating the .rc file to embed the UAC manifest by including
windows.h with WIN32_LEAN_AND_MEAN instead.
2021-10-13 12:21:10 +08:00
Chun-wei Fan
3481ebdafb gtk: Fix version resource on for Windows 11 SDK
The rc.exe that comes with the Windows 11 SDK does not allow one to include
winuser.h directly in the .rc scripts, so make sure that it is not included
by gtk-win32.rc.body.in, but instead include windows.h with WIN32_LEAN_AND_MEAN
defined.
2021-10-13 12:21:10 +08:00
Sveinn í Felli
71eece2f35 Update Icelandic translation
(cherry picked from commit 83b3c7d826)
2021-10-12 22:48:16 +00:00
Christopher Davis
454ca897bb gtkflowbox: Add prepend() and append()
These functions are common across container implementations,
but GtkFlowBox was missing them.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4277
2021-10-12 11:07:17 -07:00