Commit Graph

71866 Commits

Author SHA1 Message Date
Benjamin Otte
0a31201c88 boxlayout: Split loop into if statmement
Turns it into 2 loops, one for the homogeneous part and one for the
complicated part.
2021-11-09 03:41:43 +01:00
Benjamin Otte
afe94e303a boxlayout: Don't listen to comments
... when they are wrong.

Instead, remove them.

Or in other words: GTK4 does not have a fill child property anymore, so
we don't need to run the measuring loop above to determine the size.
2021-11-09 03:41:43 +01:00
Benjamin Otte
b004706009 Revert "sizerequest: Only check reported baselines if requested"
This reverts commit cf7fa931d3.

We store the baseline in the cache and we do not know if baselines might
be queried in the future. So always store them.

No reftest because I don't know how to write one.

premature optimization == √😈
2021-11-09 03:41:43 +01:00
Benjamin Otte
129042425d demos: Update for climate change and Covid 2021-11-09 03:41:43 +01:00
Benjamin Otte
81169d18c3 label: max-width-chars should be ignored sometimes
When a widget is neither wrappable nor ellipsizable, we cannot modify
the label to fit into any size. So we cannot respect max-width-chars.
2021-11-09 03:41:43 +01:00
Benjamin Otte
cce6a603a6 label: max-width-chars has no effect on smaller text
Having a short text and a large max-width-chars should request the
natural width of the text, not the limit from max-width-chars.

This caused huge message dialogs.

Reftests added.
2021-11-09 03:41:43 +01:00
Ian Douglas Scott
1c6608f426 gdk/wayland/surface: Remove unused argument 2021-11-08 14:46:38 -08:00
Ian Douglas Scott
fcdc5538cf gdk/wayland/surface: Move *idle_inhibitor* to GdkWaylandToplevel 2021-11-08 14:46:34 -08:00
Ian Douglas Scott
dd327bc8a6 gdk/wayland/surface: Move *exported to GdkWaylandToplevel 2021-11-08 14:43:19 -08:00
Ian Douglas Scott
b878353f0b gdk/wayland/surface: Move server_decoration to GdkWaylandToplevel 2021-11-08 14:00:00 -08:00
Jordi Mas i Hernandez
27d286eb7a Update Catalan translation 2021-11-08 20:35:15 +00:00
Jordi Mas i Hernandez
01cf559d9d Update Catalan translation 2021-11-08 19:58:52 +00:00
Matthias Clasen
20fd760a52 Merge branch 'small-caps' into 'master'
Handle new pango api

See merge request GNOME/gtk!4137
2021-11-08 19:39:55 +00:00
Matthias Clasen
cca8ae04b6 Bump the pango requirement to 1.49.3
Required for new PangoVariant enumeration values.
2021-11-08 14:17:42 -05:00
Matthias Clasen
60c45dac56 css: Change the way case variants are handled
Instead of translating font-variant-caps directly
to OpenType features, translate them to a PangoVariant,
now that that enumeration reflects all the css values.

This allows pango to emulate Small Caps for fonts that
don't support the OpenType feature.
2021-11-08 14:17:42 -05:00
Matthias Clasen
7bee4fa44b Handle new pango api
The PangoVariant enumeration has gained new values
to match css. Handle those in switches.
2021-11-08 14:17:42 -05:00
Matthias Clasen
4c029af6cd textview: Don't leave embedded children behind
When scrolling embedded widgets out of view,
they sometimes get left behind because we don't
reallocated them. To avoid that, move _all_ children
out of view in size_allocate, and let the current
child allocation plumbing move the visible ones
back in place.
2021-11-08 14:17:42 -05:00
Matthias Clasen
1c6efea370 Remove a confusing comment
It talks about propagating to unanchored children,
but then iterates over anchored_children. That does
not add up.
2021-11-08 14:17:42 -05:00
Matthias Clasen
895dc94cc9 gtk-demo: Avoid a missing icon
The hypertext demo was using an icon that we no longer
include in our embedded icon theme. Use a different one.
2021-11-08 14:17:42 -05:00
Luca Bacci
9f9479a50f Merge branch 'forward-port-mr-3931-to-gtk4' into 'master'
Remove the GdkWin32 global screen offset

Closes #4348 and #1477

See merge request GNOME/gtk!4104
2021-11-08 18:55:07 +00:00
Hugo Carvalho
13d559119f Update Portuguese translation 2021-11-08 11:27:19 +00:00
Emmanuele Bassi
018388d321 Unrealize ATContext on unroot
Non-root widgets should unrealize their ATContext, if they have one,
when they are unrooted, as they don't have a connection to a top level
any more.

Fixes: #4421
2021-11-08 10:18:22 +00:00
Daniel Mustieles
cf69d917c1 Updated Spanish translation 2021-11-08 10:32:50 +01:00
Chun-wei Fan
41599e5e90 GDK-Win32: Make EGL a runtime opt-in
Use the debug envvar 'GDK_DEBUG=gl-egl' to determine whether we want to try to
initialize EGL first before trying WGL, as a means for people to more easily
enable EGL support on Windows to test EGL there (such as to debug the shaders,
for instance)
2021-11-08 15:40:59 +08:00
Chun-wei Fan
1b2e69f6c0 GDK-Win32: Realize EGL using common realization code
This will clean up the EGL code in GDK-Win32, as well as fixing crashes caused
by using an invalid EGL context in gdk_gl_context_make_current() as we did not
store up the EGL context in the correct place (lost during the transition to
the common EGL initialization code).

On the Windows/libANGLE side, the initialization of EGL has now fully moved to
the common code in GDK, but we will still default on WGL for now.  Help is
really appreciated for fixing the shaders on libANGLE!
2021-11-08 15:40:49 +08:00
Chun-wei Fan
ee45869759 gdkdisplay.c: Fix builds without EGL
We need to ensure that gdk_display_get_egl_display() is available even if EGL
is not enabled in the build, so that things will continue to link and work.

For builds without EGL, just return NULL.
2021-11-08 15:25:24 +08:00
Chun-wei Fan
048fe84888 GDK-Win32: Port to common EGL handling code
This will port the EGL code in GDK-Win32 to use the common GDK code to
initialize EGL.  However, at the current state, although EGL is
correctly initialized, this code is disabled for now since
gdk_gl_context_make_current() fails as the shaders do not work for EGL
via libANGLE on Windows.

We can now clean things up in gdkglcontext-win32-egl.c as a result.
2021-11-08 15:25:24 +08:00
Chun-wei Fan
480031439f GDK-Win32: Drop GDK_WIN32_ENABLE_EGL flag
Instead, use HAVE_EGL check macro instead, which is used by the other
platforms as well.
2021-11-08 15:25:24 +08:00
Emmanuele Bassi
dc9b145e27 Merge branch 'ebassi/for-master' into 'master'
docs: Fix typo in link

See merge request GNOME/gtk!4135
2021-11-07 23:40:14 +00:00
Emmanuele Bassi
0e27a49d1a docs: Fix typo in link 2021-11-07 23:23:36 +00:00
Hugo Carvalho
4afd416840 Update Portuguese translation 2021-11-07 21:30:40 +00:00
Hugo Carvalho
25142abebf Update Portuguese translation 2021-11-07 21:27:49 +00:00
Emmanuele Bassi
60d50bcb13 Merge branch 'ebassi/docs-link-fixes' into 'master'
docs: Fix wrong fragments in type links

See merge request GNOME/gtk!4134
2021-11-07 19:08:16 +00:00
Emmanuele Bassi
59f45aa30c docs: Fix wrong fragments in type links
Due to a bug in gi-docgen we're not getting a warning if a fragment to a
type does not match the actual type, and we're generating a broken link.

See: https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/120
2021-11-07 18:40:24 +00:00
Emmanuele Bassi
14c32a7cf0 Merge branch 'these-are-flags' into 'master'
docs: Tag Gdk.ModifierType as flags

See merge request GNOME/gtk!4133
2021-11-07 18:21:28 +00:00
Luca Bacci
4c8e703803
GdkWin32: Remove the global screen offset
Removes the _gdk_offset_x / _gdk_offset_y variables,
as today are not needed anymore.
2021-11-07 19:08:30 +01:00
Luca Bacci
8338e55549
GdkWin32: Use a signed integral type for the DPI scale 2021-11-07 19:01:32 +01:00
Marco Melorio
da72cfea40 docs: Tag Gdk.ModifierType as flags 2021-11-07 18:14:15 +01:00
Hodong Kim
0632e94e68 Fix typos 2021-11-07 16:48:39 +09:00
Yuri Chornoivan
4a356ae331 Update Ukrainian translation 2021-11-06 04:16:55 +00:00
Benjamin Otte
4f4f2d169a Merge branch 'wip/otte/for-master' into 'master'
boxlayout: Be more careful with what to consider natural size

See merge request GNOME/gtk!4129
2021-11-06 03:54:08 +00:00
Benjamin Otte
577d520006 reftests: Add reftest for last 2 issues
Use a label that is long enough to require wrapping and force it into a
hardcoded width. Use a sentence where all the words have the same size
to not get unwanted wrapping behavior.

Also append a 2nd row to check that the first row gets the proper height
allocated.

Found by Marco Melorio.
2021-11-06 04:30:50 +01:00
Benjamin Otte
222d6f1db1 label: Don't deduce label width from logical rect
The width of a logical rect after line breaking is sometimes not
wide enough to cause line breaking to break at the exact same points.
(Is that by design or a bug in Pango? I don't know.)

So don't use the width, and only relyon values we actually set to
pango_layout_set_width().
2021-11-06 03:15:04 +01:00
Benjamin Otte
4ffa60be50 boxlayout: Be more careful with what to consider natural size
Don't just use the natural size as the max size, the natural size
is the ideal size, not necessarily the maximum size.

Also check the nat size for opposite min size.
2021-11-06 00:56:55 +01:00
Matthias Clasen
7da72d1295 Merge branch 'remove_some_unused_declarations' into 'master'
remove some unused declarations

See merge request GNOME/gtk!4125
2021-11-05 23:08:56 +00:00
Matthias Clasen
c9735e8ea9 Merge branch 'wip/baedert/for-master' into 'master'
paned: Don't pass values < -1 to gtk_widget_measure()

Closes #4404

See merge request GNOME/gtk!4126
2021-11-05 23:08:28 +00:00
Benjamin Otte
8a7868d006 Merge branch 'wip/otte/for-master' into 'master'
Revert "label: Never measure more than max-width-chars"

Closes #4399

See merge request GNOME/gtk!4120
2021-11-05 22:11:00 +00:00
Benjamin Otte
c4e5242be0 picture: Setting can-shrink requires a resize
So queue one.
2021-11-05 20:51:00 +01:00
Matthias Clasen
935f7f19f3 Merge branch 'yurchor-master-patch-77064' into 'master'
Fix minor typo: Unsupportd -> Unsupported

See merge request GNOME/gtk!4127
2021-11-05 19:41:05 +00:00
Benjamin Otte
5c9ae28937 boxlayout: Compute opposite size properly
For size -1 in the opposite orientation, GtkBoxLayout used to measure
the children based on their min size in the box's orientation instead of
-1. That wasn't really intended, but was a side effect of how the sizing
code did (not) distribute extra size above the minimum size.

This is clearly not what we want.
What we want is measuring the orientation as is for size -1. Then we
want to just take the maximum of all children and use that.

A reftest is incldued that ensures a vbox wraps a label just like an
hbox does.
2021-11-05 20:30:49 +01:00