Benjamin Otte [Tue, 26 Oct 2021 15:02:56 +0000 (17:02 +0200)]
css: Don't throw warnings on broken URL in image css
If a URL can't be loaded, we might end up with a NULL file. Handle that
case properly by creating an invalid image instead and don't crash or
complain to stderr when files are NULL.
This was broken since
0886ade182f1a958024202d5c20248d57fcdb053
A new reftest has been included. We need a reftest instead of a
CSS parser test, because the error only becomes visible when
compute()ing the actual image.
Fixes #4373
Benjamin Otte [Mon, 25 Oct 2021 00:14:18 +0000 (02:14 +0200)]
gdk: Split enums from types
Add gdkenums.h for enums and keep gdktypes.h for types.
Makes both files easier to read.
Benjamin Otte [Sun, 24 Oct 2021 23:58:35 +0000 (01:58 +0200)]
gdktypes: Remove GDK_EXTERN_VAR
It is unused.
Matthias Clasen [Tue, 26 Oct 2021 17:53:06 +0000 (17:53 +0000)]
Merge branch 'bilelmoussaoui/missing-since-annotations' into 'master'
since annotations cleanup
See merge request GNOME/gtk!4086
Benjamin Otte [Mon, 25 Oct 2021 17:42:00 +0000 (17:42 +0000)]
Merge branch 'alatiera/gdk_create_context_nullable' into 'master'
gdkdisplay: Remove (nullable)
See merge request GNOME/gtk!4096
Rūdolfs Mazurs [Mon, 25 Oct 2021 16:59:50 +0000 (16:59 +0000)]
Update Latvian translation
(cherry picked from commit
4f5264d1b7dae98e1732d57098b9a7e4940964cd)
Jordan Petridis [Mon, 25 Oct 2021 15:40:40 +0000 (18:40 +0300)]
gdkdisplay: Remove (nullable)
gdk_display_create_gl_context only returns NULL when there is
an error set or asserts/aborts. So nullalbe annotation isn't needed.
Similar to
53312cf696516cdeb1c284008992022a210bb233
Emmanuele Bassi [Mon, 25 Oct 2021 08:22:44 +0000 (08:22 +0000)]
Merge branch 'enterprisey-master-patch-53741' into 'master'
readme: Fix "Building GTK" docs link
See merge request GNOME/gtk!4095
enterprisey [Mon, 25 Oct 2021 07:59:03 +0000 (07:59 +0000)]
readme: Fix "Building GTK" docs link
Matthias Clasen [Sun, 24 Oct 2021 19:04:48 +0000 (19:04 +0000)]
Merge branch 'wip/exalm/polish' into 'master'
A few inspector papercut fixes
See merge request GNOME/gtk!4092
Alexander Mikhaylenko [Sun, 24 Oct 2021 17:23:26 +0000 (22:23 +0500)]
inspector: Expand the controllers column view
Alexander Mikhaylenko [Sun, 24 Oct 2021 17:20:13 +0000 (22:20 +0500)]
inspector: Use .list for property list as well
Alexander Mikhaylenko [Sun, 24 Oct 2021 17:19:36 +0000 (22:19 +0500)]
inspector: Clean up the .list style
Make it work with the property list as well, handle spinbuttons, adjust
paddings so that buttons don't touch each other, don't override horizontal
padding unnecessarily.
Alexander Mikhaylenko [Sat, 23 Oct 2021 23:01:35 +0000 (04:01 +0500)]
inspector: Stop using .sidebar for the recorder page
Those aren't sidebars. Add separators manually instead of misusing the
style class.
Alexander Mikhaylenko [Sat, 23 Oct 2021 22:58:21 +0000 (03:58 +0500)]
inspector: Use consistent GtkTextView margins
Alexander Mikhaylenko [Sat, 23 Oct 2021 22:55:26 +0000 (03:55 +0500)]
inspector: Add a separator under toolbar in css editor
Same as object properties.
Alexander Mikhaylenko [Sat, 23 Oct 2021 22:22:56 +0000 (03:22 +0500)]
inspector: Use tabular figures for list position label
Avoid buttons jumping around while moving through list models.
Alexander Mikhaylenko [Sat, 23 Oct 2021 22:10:54 +0000 (03:10 +0500)]
inspector: Use .toolbar for toolbars
Remove all of the manual margins, spacing and has-frame=0, be more
consistent.
Alexander Mikhaylenko [Sat, 23 Oct 2021 21:53:22 +0000 (02:53 +0500)]
inspector: Use a GtkSeparator for the object details toolbar
Remove a hardcoded light grey border from the sidebar that was used for
this.
Alexander Mikhaylenko [Sat, 23 Oct 2021 21:51:07 +0000 (02:51 +0500)]
inspector: Remove list header style
The one from the theme works just fine.
Piotr Drąg [Sat, 23 Oct 2021 11:08:47 +0000 (13:08 +0200)]
Update POTFILES.skip
Benjamin Otte [Sat, 23 Oct 2021 00:00:32 +0000 (00:00 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
Fix a bunch of issues found by static analyzer
See merge request GNOME/gtk!4090
Benjamin Otte [Fri, 22 Oct 2021 21:51:26 +0000 (23:51 +0200)]
png: allocate data before sigsetjmp()
Makes the static analyzer not trip up when trying to analyze memory
leaks.
Benjamin Otte [Fri, 22 Oct 2021 18:54:17 +0000 (20:54 +0200)]
demos: Remove unused code
Benjamin Otte [Fri, 22 Oct 2021 18:47:26 +0000 (20:47 +0200)]
glx: Remove unused assignment
Benjamin Otte [Fri, 22 Oct 2021 18:45:27 +0000 (20:45 +0200)]
tiff: Fix variable assignment
Benjamin Otte [Fri, 22 Oct 2021 16:35:41 +0000 (16:35 +0000)]
Merge branch 'wip/otte/center-center-center' into 'master'
Add a bunch of reftests and fix their failures
Closes #4285
See merge request GNOME/gtk!4085
Benjamin Otte [Thu, 21 Oct 2021 01:32:32 +0000 (03:32 +0200)]
testsuite: Add lots of reftests for picture sizing
Have square images in the following sizes:
* 20
* 100
* 150
* 200
* 300
and place them in a can-shrink Picture allocated at the sizes:
* 200x100
* 100x200
and set align to center/center.
That's 10 combinations and they should all do the right thing.
Benjamin Otte [Fri, 22 Oct 2021 12:51:56 +0000 (14:51 +0200)]
widget: adjust allocation even better
This fixes fallout from
3742fabae040d914e6ae58edf31170a54a980f21 where
we would no longer allocate widgets to their natural size when
align flags where used.
GtkPicture wants to be allocated at 100% in that case, so a picture with
a 100x100 image inside a 200x200 window should be allocated 100x100.
The new adjustment code now does the following (for width-for-height
instead of height-for-width, swap width and height in the following):
1. query the minimum width for the allocated height
2. query the natural width
3. compute the maximum of (1) and (2)
4. set the widget width to the minimum of (3) and the allocated
width.
5. compute the natural height for (4)
6. set the widget height to the minimum of (5) and the allocated height.
Benjamin Otte [Thu, 21 Oct 2021 01:06:56 +0000 (03:06 +0200)]
reftests: Don't crash if no node
If we have no node, don't crash when trying to save the node file.
Instead, write an empty file.
Benjamin Otte [Fri, 22 Oct 2021 15:37:34 +0000 (17:37 +0200)]
gl: Call make_current() before doing any GL work
But don't call it too early, we only want to call it once we have
prepared the target.
This way, we guarantee that a GL context is always available and that it
is bound to the correct target.
Benjamin Otte [Fri, 22 Oct 2021 14:31:40 +0000 (16:31 +0200)]
build: Make sure ifuncs exist when using fp16
Fixes msys compiles on Windows (and everywhere else hopefully).
Fixes #4285
Emmanuele Bassi [Fri, 22 Oct 2021 15:05:29 +0000 (15:05 +0000)]
Merge branch 'fix-mac-kana-eisu' into 'master'
Correct translation of Mac JIS Eisu & Kana keys
Closes #4117
See merge request GNOME/gtk!3782
Bilal Elmoussaoui [Thu, 21 Oct 2021 13:56:15 +0000 (14:56 +0100)]
g-i: add missing since 4.6 annotations
Bilal Elmoussaoui [Thu, 21 Oct 2021 13:55:57 +0000 (14:55 +0100)]
gdk: fix MemoryFormat since annotations
muzena [Thu, 21 Oct 2021 11:05:28 +0000 (13:05 +0200)]
Update Croatian language
Matthias Clasen [Thu, 21 Oct 2021 00:00:29 +0000 (00:00 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
Better errors ftw!
See merge request GNOME/gtk!4084
Matthias Clasen [Wed, 20 Oct 2021 22:55:42 +0000 (22:55 +0000)]
Merge branch 'subpop/docs-getting-started-hello-world' into 'master'
Match hello world code to description
Closes #4358
See merge request GNOME/gtk!4081
Benjamin Otte [Wed, 20 Oct 2021 22:05:56 +0000 (00:05 +0200)]
css: Emit a special error for a common error
This CSS:
calc(5px+3px)
is wrong because it gets broken to:
calc( 5px +3px )
which is 2 numbers inside the calc, and what you want is:
calc( 5px + 3px )
but you need to add a space to get this, like so:
calc(5px + 3px)
which is the recommended way to write calc() statements.
So whenever we encounter an error, check if the next token is a signed
number and if so, include it in the error message.
Benjamin Otte [Wed, 20 Oct 2021 22:05:19 +0000 (00:05 +0200)]
css: Split dimension token
Add a signed and an unsigned version.
This will become useful real soon.
Benjamin Otte [Wed, 20 Oct 2021 22:14:58 +0000 (22:14 +0000)]
Merge branch 'wip/otte/display-gl' into 'master'
Add gdk_display_create_gl_context()
See merge request GNOME/gtk!4083
Benjamin Otte [Wed, 20 Oct 2021 18:33:57 +0000 (20:33 +0200)]
testsuite: Create GL renderers without surfaces
Benjamin Otte [Wed, 20 Oct 2021 18:30:43 +0000 (20:30 +0200)]
node-editor: Create renderers surfaceless
Benjamin Otte [Wed, 20 Oct 2021 18:30:08 +0000 (20:30 +0200)]
gsk: Allow gsk_renderer_realize (renderer, NULL, NULL)
That way, we can use renderers without surfaces.
Benjamin Otte [Wed, 20 Oct 2021 18:07:37 +0000 (20:07 +0200)]
drawcontext: Guard begin/end_frame() against non-surface contexts
This can happen now with gdk_display_create_gl_context().
Benjamin Otte [Wed, 20 Oct 2021 18:03:00 +0000 (20:03 +0200)]
API: Add gdk_display_create_gl_context()
This is an alternative to gdk_surface_create_gl_context() when the
context is meant to only draw to textures.
This is useful in the testsuite or in GStreamer or with GLArea,
basically whenever we want to do GL stuff but don't need to actually
draw anything on screen.
A bunch of code will need to be updated to deal with context->surface
being NULL.
Benjamin Otte [Wed, 20 Oct 2021 18:02:26 +0000 (20:02 +0200)]
surface: Remove (nullable)
The function only returns NULL on error, and such a function is not
considered nullable.
Link Dupont [Wed, 20 Oct 2021 02:36:12 +0000 (02:36 +0000)]
docs: match hello world code to description
Add the creation of a GtkBox to the hello-world sample code.
Fixes: #4358
Matthias Clasen [Tue, 19 Oct 2021 13:00:20 +0000 (13:00 +0000)]
Merge branch 'appdata-build-date' into 'master'
Drop date attribute from our appdata files
See merge request GNOME/gtk!4079
Bernhard M. Wiedemann [Mon, 6 Sep 2021 08:05:31 +0000 (10:05 +0200)]
Drop date attribute from our appdata files
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
This was suggested by Matthias Clasen as an alternative to MR !3929
Matthias Clasen [Tue, 19 Oct 2021 02:48:41 +0000 (02:48 +0000)]
Merge branch 'setlocale-gapplication-help' into 'master'
GtkApplication: Call setlocale early
Closes #4234
See merge request GNOME/gtk!3928
Matthias Clasen [Tue, 19 Oct 2021 02:46:48 +0000 (02:46 +0000)]
Merge branch 'gdkdisplay-c-stdlib-h' into 'master'
gdkdisplay.c: Include stdlib.h
See merge request GNOME/gtk!4041
Matthias Clasen [Tue, 19 Oct 2021 02:45:42 +0000 (02:45 +0000)]
Merge branch 'wip/hadess/quiet-broadway' into 'master'
broadway: Quiet initialisation failures
See merge request GNOME/gtk!4053
Matthias Clasen [Tue, 19 Oct 2021 02:44:19 +0000 (02:44 +0000)]
Merge branch 'file-list-get' into 'master'
Add getter to GdkFileList
See merge request GNOME/gtk!4047
Matthias Clasen [Tue, 19 Oct 2021 02:42:15 +0000 (02:42 +0000)]
Merge branch 'fix-win11-sdk' into 'master'
Fix building against the Windows 11 SDK (GTK master/4.x)
See merge request GNOME/gtk!4063
Matthias Clasen [Tue, 19 Oct 2021 02:41:09 +0000 (02:41 +0000)]
Merge branch 'line-height-percentage' into 'master'
css: Fix handling of percentage for line-height
Closes #3254 and #4354
See merge request GNOME/gtk!4075
Matthias Clasen [Tue, 19 Oct 2021 02:40:26 +0000 (02:40 +0000)]
Merge branch 'wip/exalm/levelbar' into 'master'
levelbar: Fill the whole space for discrete level bars
See merge request GNOME/gtk!4042
Benjamin Otte [Tue, 19 Oct 2021 00:19:52 +0000 (00:19 +0000)]
Merge branch 'label-sizing' into 'master'
Make label-sizing reftest pass
See merge request GNOME/gtk!4076
Benjamin Otte [Mon, 18 Oct 2021 23:08:06 +0000 (01:08 +0200)]
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.
Benjamin Otte [Mon, 18 Oct 2021 23:10:30 +0000 (01:10 +0200)]
testsuite: don't XFAIL label-sizing anymore
It's fixed now.
Benjamin Otte [Mon, 18 Oct 2021 23:07:22 +0000 (01:07 +0200)]
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.
Benjamin Otte [Mon, 18 Oct 2021 23:04:25 +0000 (01:04 +0200)]
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.
Benjamin Otte [Mon, 18 Oct 2021 23:01:36 +0000 (01:01 +0200)]
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.
Alexander Mikhaylenko [Thu, 7 Oct 2021 10:05:09 +0000 (15:05 +0500)]
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.
Emmanuele Bassi [Mon, 18 Oct 2021 21:09:10 +0000 (21:09 +0000)]
Merge branch 'wip/cdavis/flowbox-add-functions' into 'master'
gtkflowbox: Add prepend() and append()
Closes #4277
See merge request GNOME/gtk!4013
Matthias Clasen [Mon, 18 Oct 2021 20:58:46 +0000 (20:58 +0000)]
Merge branch 'wip/baedert/for-master' into 'master'
Some fixes, hmm yes
See merge request GNOME/gtk!4068
Matthias Clasen [Mon, 18 Oct 2021 20:45:10 +0000 (16:45 -0400)]
css: Fix handling of percentage for line-height
We weren't doing the right thing here.
This is simpler, and works.
Fixes: #4354
Matthias Clasen [Mon, 18 Oct 2021 18:00:33 +0000 (18:00 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Small fixes
Closes #4248
See merge request GNOME/gtk!4072
Matthias Clasen [Mon, 18 Oct 2021 15:08:35 +0000 (15:08 +0000)]
Merge branch 'feature/calendar-first-day' into 'master'
calendar: Fix abbreviated day names
Closes #4338
See merge request GNOME/gtk!4061
Matthias Clasen [Mon, 18 Oct 2021 15:00:27 +0000 (11:00 -0400)]
ci: Allow macos to fail
The macos runner is out of commission atm
Jonas Ådahl [Mon, 18 Oct 2021 13:45:32 +0000 (13:45 +0000)]
Merge branch 'work/reset_opaque' into 'master'
wayland: Mark opaque_region as dirty on hide
See merge request GNOME/gtk!4020
Jonas Ådahl [Mon, 18 Oct 2021 13:44:52 +0000 (13:44 +0000)]
Merge branch 'work/tidy' into 'master'
wayland: miscellaneous minor tidy ups
See merge request GNOME/gtk!4066
Benjamin Otte [Mon, 18 Oct 2021 13:32:02 +0000 (13:32 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
glcontext: reinstate another missing "!"
See merge request GNOME/gtk!4070
Matthias Clasen [Mon, 18 Oct 2021 12:23:27 +0000 (08:23 -0400)]
Improve a msgid
Instead of gl-context, say "GL Context".
Fixes: #4248
Matthias Clasen [Sun, 17 Oct 2021 20:05:35 +0000 (22:05 +0200)]
docs: Cosmetics
Do a round of "the the" removal.
Matthias Clasen [Sun, 17 Oct 2021 19:54:59 +0000 (21:54 +0200)]
docs: Cosmetics
Benjamin Otte [Mon, 18 Oct 2021 11:38:35 +0000 (13:38 +0200)]
testsuite: Add workarounds for non-gl backends
read: Fix tests for broadway
Benjamin Otte [Sat, 25 Sep 2021 22:32:27 +0000 (00:32 +0200)]
broadway: Use gdk_texture_save_to_png_bytes()
Instead of using Cairo, save the texture directly.
Benjamin Otte [Sat, 25 Sep 2021 22:22:20 +0000 (00:22 +0200)]
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.
Benjamin Otte [Sun, 17 Oct 2021 20:15:53 +0000 (22:15 +0200)]
jpeg: Use gdk_memory_texture_from_texture()
Benjamin Otte [Sun, 17 Oct 2021 12:27:03 +0000 (14:27 +0200)]
tiff: Refactor
Now we support all the formats.
Benjamin Otte [Sun, 17 Oct 2021 04:54:38 +0000 (06:54 +0200)]
gltexture: Fix conditions for glGetTexImage() call
The conditions were inverted, plus we failed to limit this call to
non-GLES.
Benjamin Otte [Sun, 17 Oct 2021 16:46:01 +0000 (18:46 +0200)]
glcontext: reinstate another missing "!"
A leftover from
aa0c22b64813a406da9854fd079579d87181a97b.
Timm Bäder [Sun, 17 Oct 2021 10:15:34 +0000 (12:15 +0200)]
Ensure blur nodes have a positive blur radius
Timm Bäder [Sun, 17 Oct 2021 09:21:00 +0000 (11:21 +0200)]
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.
Timm Bäder [Sat, 16 Oct 2021 13:56:46 +0000 (15:56 +0200)]
theme: enable tabular numbers in GtkCalendar
It aligns numbers a lot so this makes sense.
Timm Bäder [Sat, 16 Oct 2021 13:44:58 +0000 (15:44 +0200)]
fontrendering: Protect against NULL hints
Timm Bäder [Sat, 16 Oct 2021 06:51:32 +0000 (08:51 +0200)]
cssparser: Make a signed expression unsigned
Benjamin Otte [Sat, 16 Oct 2021 17:04:26 +0000 (17:04 +0000)]
Merge branch 'fix-dnd-coordinates-on-windows' into 'master'
Fix DND coordinates on Windows
See merge request GNOME/gtk!3930
Benjamin Otte [Sat, 16 Oct 2021 14:11:00 +0000 (14:11 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
glcontext: Reinstate missing "!"
Closes #4349
See merge request GNOME/gtk!4067
Benjamin Otte [Sat, 16 Oct 2021 11:35:50 +0000 (13:35 +0200)]
gdk: Move GdkMemoryFormat enum to gdktypes.h
It's used in too many places now.
Benjamin Otte [Sat, 16 Oct 2021 13:47:05 +0000 (15:47 +0200)]
glcontext: Reinstate missing "!"
Replacing the return_if_fail()s in commit
f584d4f50025 lost the
inversions.
Fixes #4349
David Edmundson [Fri, 1 Oct 2021 12:31:39 +0000 (13:31 +0100)]
wayland: port code to g_clear_pointer
David Edmundson [Fri, 1 Oct 2021 12:24:50 +0000 (13:24 +0100)]
wayland: drop unused member variables
Benjamin Otte [Wed, 13 Oct 2021 12:51:37 +0000 (12:51 +0000)]
Merge branch 'wip/otte/memoryformat' into 'master'
Refactor various texture machinery
See merge request GNOME/gtk!4057
Benjamin Otte [Tue, 12 Oct 2021 22:30:09 +0000 (00:30 +0200)]
gl: Use gdk_memory_texture_new_from_texture()
Way less code to prepare the texture in a proper format.
Benjamin Otte [Tue, 12 Oct 2021 22:07:08 +0000 (00:07 +0200)]
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.
Benjamin Otte [Tue, 12 Oct 2021 22:36:38 +0000 (00:36 +0200)]
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.
Benjamin Otte [Tue, 12 Oct 2021 13:04:43 +0000 (15:04 +0200)]
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.
Benjamin Otte [Mon, 11 Oct 2021 01:29:11 +0000 (03:29 +0200)]
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.