Commit Graph

71423 Commits

Author SHA1 Message Date
Benjamin Otte
a4e83ec584 demos: Remove unused code 2021-10-23 00:03:51 +02:00
Benjamin Otte
373ca2389a glx: Remove unused assignment 2021-10-22 23:50:45 +02:00
Benjamin Otte
b2f9a907ce tiff: Fix variable assignment 2021-10-22 23:50:45 +02:00
Benjamin Otte
2b2fd23815 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
2021-10-22 16:35:41 +00:00
Benjamin Otte
2113a18a18 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.
2021-10-22 17:51:41 +02:00
Benjamin Otte
1606a41116 widget: adjust allocation even better
This fixes fallout from 3742fabae0 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.
2021-10-22 17:51:40 +02:00
Benjamin Otte
438bf8596e 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.
2021-10-22 17:51:40 +02:00
Benjamin Otte
b912e84df7 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.
2021-10-22 17:51:40 +02:00
Benjamin Otte
3c9c7a0e72 build: Make sure ifuncs exist when using fp16
Fixes msys compiles on Windows (and everywhere else hopefully).

Fixes #4285
2021-10-22 17:50:42 +02:00
Emmanuele Bassi
82c0654f76 Merge branch 'fix-mac-kana-eisu' into 'master'
Correct translation of Mac JIS Eisu & Kana keys

Closes #4117

See merge request GNOME/gtk!3782
2021-10-22 15:05:29 +00:00
muzena
1d387b5d45 Update Croatian language 2021-10-21 13:05:28 +02:00
Matthias Clasen
74329abf29 Merge branch 'wip/otte/for-master' into 'master'
Better errors ftw!

See merge request GNOME/gtk!4084
2021-10-21 00:00:29 +00:00
Matthias Clasen
0afae65c8a Merge branch 'subpop/docs-getting-started-hello-world' into 'master'
Match hello world code to description

Closes #4358

See merge request GNOME/gtk!4081
2021-10-20 22:55:42 +00:00
Benjamin Otte
350a5edb87 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.
2021-10-21 00:16:20 +02:00
Benjamin Otte
c11bd57422 css: Split dimension token
Add a signed and an unsigned version.

This will become useful real soon.
2021-10-21 00:16:20 +02:00
Benjamin Otte
883b2223c1 Merge branch 'wip/otte/display-gl' into 'master'
Add gdk_display_create_gl_context()

See merge request GNOME/gtk!4083
2021-10-20 22:14:58 +00:00
Benjamin Otte
0898023e6b testsuite: Create GL renderers without surfaces 2021-10-20 21:49:32 +02:00
Benjamin Otte
869d2f281a node-editor: Create renderers surfaceless 2021-10-20 21:49:32 +02:00
Benjamin Otte
cb03fe8f31 gsk: Allow gsk_renderer_realize (renderer, NULL, NULL)
That way, we can use renderers without surfaces.
2021-10-20 21:49:32 +02:00
Benjamin Otte
ea14e94eaf drawcontext: Guard begin/end_frame() against non-surface contexts
This can happen now with gdk_display_create_gl_context().
2021-10-20 20:31:33 +02:00
Benjamin Otte
2601c39cb2 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.
2021-10-20 20:31:33 +02:00
Benjamin Otte
53312cf696 surface: Remove (nullable)
The function only returns NULL on error, and such a function is not
considered nullable.
2021-10-20 20:02:26 +02:00
Link Dupont
9e0494cf4d docs: match hello world code to description
Add the creation of a GtkBox to the hello-world sample code.

Fixes: #4358
2021-10-19 22:40:20 -04:00
Matthias Clasen
3d536f1293 Merge branch 'appdata-build-date' into 'master'
Drop date attribute from our appdata files

See merge request GNOME/gtk!4079
2021-10-19 13:00:20 +00:00
Bernhard M. Wiedemann
d6f4a0d2cf 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
2021-10-19 07:37:59 -04:00
Matthias Clasen
14e6d9555d Merge branch 'setlocale-gapplication-help' into 'master'
GtkApplication: Call setlocale early

Closes #4234

See merge request GNOME/gtk!3928
2021-10-19 02:48:41 +00:00
Matthias Clasen
8b02e87529 Merge branch 'gdkdisplay-c-stdlib-h' into 'master'
gdkdisplay.c: Include stdlib.h

See merge request GNOME/gtk!4041
2021-10-19 02:46:48 +00:00
Matthias Clasen
f04e10238b Merge branch 'wip/hadess/quiet-broadway' into 'master'
broadway: Quiet initialisation failures

See merge request GNOME/gtk!4053
2021-10-19 02:45:42 +00:00
Matthias Clasen
e946ee4040 Merge branch 'file-list-get' into 'master'
Add getter to GdkFileList

See merge request GNOME/gtk!4047
2021-10-19 02:44:19 +00:00
Matthias Clasen
46ba4b9d8c Merge branch 'fix-win11-sdk' into 'master'
Fix building against the Windows 11 SDK (GTK master/4.x)

See merge request GNOME/gtk!4063
2021-10-19 02:42:15 +00:00
Matthias Clasen
464f76ce5d 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
2021-10-19 02:41:09 +00:00
Matthias Clasen
9965f26d97 Merge branch 'wip/exalm/levelbar' into 'master'
levelbar: Fill the whole space for discrete level bars

See merge request GNOME/gtk!4042
2021-10-19 02:40:26 +00:00
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