Commit Graph

77561 Commits

Author SHA1 Message Date
Daniel Mustieles
5e17b56135 Updated Spanish translation 2023-09-21 11:32:58 +02:00
Ekaterine Papava
0c3d86865b Update Georgian translation 2023-09-21 03:44:05 +00:00
Emin Tufan Çetin
f814b2f636 Update Turkish translation 2023-09-20 23:56:15 +00:00
Anders Jonsson
ffdce120e7 Update Swedish translation 2023-09-20 20:58:08 +00:00
Matthias Clasen
5ac7778407 Post-release version bump 2023-09-20 16:29:26 -04:00
Matthias Clasen
d6b966ba32 4.12.2 4.12.2 2023-09-20 16:17:25 -04:00
Matthias Clasen
0a72ca9cc1 gtk4-demo: Fix a crash
This conversion of GtkStatusbar was a bit too
quick.

Fixes: #6107
2023-09-19 16:32:27 -04:00
Carlos Garnacho
1f774e2044 gdk/wayland: Use toplevel surface for activation
At the moment of launching/activating an application, the
keyboard focus may be on a transient surface that quickly
disappears after activation. If this happens, and the
compositor handles surface destruction before the activated
application gets to reply, the activation request may be
deemed outdated, and the "demands attention" paths be taken.

Peek the toplevel from the focus surface, as that has larger
guarantees to remain valid for the whole duration of the
operation.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5820
2023-09-19 16:32:27 -04:00
Carlos Garnacho
abf22e3edd gtkwindow: Pick a suitable widget to continue the implicit grab
When a widget in the GtkPointerFocus stack becomes insensitive, we've
so far broken the implicit grab entirely. This has the side effect of
breaking accounting of the active state on the widgets that are
ancestors of the widget that became insensitive.

The easiest, and most consistent thing to do (i.e. giving widgets
in the GtkPointerFocus stack certain level of isolation wrt state
changes in other widgets) is to transfer the implicit grab to the
topmost actor of the GtkPointerFocus stack that can keep handling
events.

This fixes the unbalanced accounting of active state on ancestors
of widgets becoming insensitive, and avoids thorny questions about
how to handle implicit active state with broken implicit grabs.
2023-09-19 16:32:27 -04:00
Carlos Garnacho
ff0d7443ee gtkwindow: Clear active state on sensitiveness changes
When altering the broken implicit grab due to sensitiveness changes,
also ensure to clear the active state from the affected actors. This
fixes unbalanced implicit active state accounting on the widgets going
insensitive.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5529
2023-09-19 16:32:27 -04:00
Carlos Garnacho
70bf8ca928 gtkmain: Drop redundant code
The common ancestor is already figured out at the beginning of the
function, no need to find it again.
2023-09-19 16:32:27 -04:00
Sergey Bugaev
c071c73ce0 text: Respect focus-on-click property
It does make sense to have GtkText not focus on click in some cases,
such as when its editable property is set to false.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 16:32:27 -04:00
Sergey Bugaev
83112f942c colorbutton, fontbutton: Propagate focus-on-click to inner buttons
These widgets wrap a GtkButton internally. Make it possible to prevent
the inner button from grabbing focus on click by propagating the value
of the focus-on-click property from the widget to the inner button.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 16:32:27 -04:00
Benjamin Otte
152c09ee86 gsk: Fix clipping error when drawing shadows
When shadows were offset - in particular when offset so the original
source was out of bounds of the result - the drawing code would create a
pattern for it that didn't include enough of it to compose a shadow.

Fix that by not creating those patterns anymore, but instead drawing the
source (potentially multiple times) at the required offsets.

While that does more drawing, it simplifies the shadow node draw code,
and that's the primary goal of the Cairo rendering.

Test included.
2023-09-19 16:32:27 -04:00
Benjamin Otte
521f8a11d8 gl: gradients should transition in unpremultiplied space
So make the gradient shaders do that.
2023-09-19 16:32:27 -04:00
Matthias Clasen
5a8f1a7aa0 inspector: Don't set a NULL fontdesc
The font dialog button does not like that.

Fixes: #5988
2023-09-19 16:32:27 -04:00
Benjamin Otte
122a989009 treeview: No gcc, node is not NULL
... so I'll add an assertion just for you.
2023-09-19 16:32:27 -04:00
Benjamin Otte
4305adf9e0 treemodelfilter: Yes gcc, both if branches are empty
... if assertions are disabled.
2023-09-19 16:32:27 -04:00
Benjamin Otte
e711c92196 render-node-tool: Actually load files properly 2023-09-19 16:32:27 -04:00
Benjamin Otte
6f89d258b0 gl: Change rounded_rect_shrink()
The code now follows gsk_rounded_rect_shrink() and with it the behavior
of the Cairo renderer and Webkit.

The old code did what the GL renderer and Cairo do, but I consider that
wrong.

I did not test Chrome.

Test attached
2023-09-19 16:32:27 -04:00
Benjamin Otte
17c3a1ed73 css: Snapshot opacity filter as opacity node
We were using color-matrix because it was easier, but opacity can often
be optimized when color-matrix needs offscreens.
2023-09-19 16:32:27 -04:00
Benjamin Otte
a0bd59e76d glrenderer: Shadows without offset do exist
Not for opaque contents, but stuff can be semi-transparent.

Testcase included.
2023-09-19 16:32:27 -04:00
Benjamin Otte
77d5b5e94f rendernode: Shadow nodes need offscreen for opacity
Otherwise the shadow will not be properly computed as opaque regions
become translucent after applying opacity.

Testcase included.
2023-09-19 16:32:27 -04:00
Sergey Bugaev
2873d7e046 switch: Fix CSS nodes documentation
A switch contains two GtkImage's whose nodes are named 'image',
not 'label'.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 16:32:27 -04:00
Sergey Bugaev
86d2bf746c switch: Respect text direction
In RTL, we want the active state to mean the handle is on the left.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1489

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 16:32:27 -04:00
Matthias Clasen
ca02190e47 gl renderer: Don't assume an atlas
The source uniform may or may not point
to a glyph atlas. The optimization we do
for color nodes is only possible if it does,
so check this.

Fixes: #6094
2023-09-19 16:32:27 -04:00
Matthias Clasen
09de769304 gl renderer: Keep track of source
We have an optimization that depends on having
the source be a glyph atlas, so keep track of
that information in the render job.
2023-09-19 16:32:27 -04:00
Matthias Clasen
53cb64351d rendernode: Fix handling of color glyphs
The rendernode parser was mixing up its flags.

Test included.

Related: #6075
2023-09-19 16:32:27 -04:00
Luca Bacci
6f0a2bd973 macOS: Fix typos 2023-09-19 16:32:27 -04:00
Michael Catanzaro
f6b96186d8 Fix documentation of gdk_display_put_event()
This function is deprecated, but we should still document it properly.
It appends, not prepends. This is clear enough from its implementation,
but also we have practical experience with WebKit in:

https://github.com/WebKit/WebKit/pull/8663

Matthias prefers to avoid the prepend, append, start, and end
terminology altogether.
2023-09-19 16:32:27 -04:00
Jonas Ådahl
5a6074814c wayland: Bind correct xdg_wm_base version
Otherwise we won't get the suspend state.
2023-09-19 16:32:27 -04:00
Michael Catanzaro
56edb0c9fb Fix typo 2023-09-19 16:32:27 -04:00
Benjamin Otte
373d2d2682 rendernode-tool: Fix array size
Also add an assertion, so things explode properly if we forget to
update the array size when adding new nodes, instead of writing random
memory.
2023-09-19 16:32:27 -04:00
Benjamin Otte
552a7dc308 rendernode: Fix Cairo rendering of repeating gradients
Cairo and the GL renderer have a different idea of how to handle
transitioning of colors outside the defined range.

Consider these stops:
  black 50%, white 50%

What color is at 0%?

Cairo would transition between the last and first stop, ie it'd do a
white-to-black transition and end up at rgb(0.5,0.5,0.5) at 0%.
GL would behave as it would for non-repeating gradients and use black
for the range [0%..50%] and white for [50%..100%].
The web would rescale the range so the first stop would be at 0% and
the last stop would be at 100%, so this gradient would be illegal.

Considering that it's possible for code to transition between the
different behaviors by adding explicit stops at 0%/100%, I could choose
any method.
So I chose the simplest one, which is what the GL renderer does and
which treats repeating and non-repeating gradients the same.

Tests attached.
2023-09-19 15:23:24 -04:00
Sergey Bugaev
6ffbaa6bb0 entry, searchentry: Fix measuring baseline
If the entry has icons, we may end up increasing our minimum and natural
height compared to the values the text child returned. In that case, we
should also adjust the baseline values to account for the text being
shifted down.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 15:20:57 -04:00
Sergey Bugaev
317b64e599 centerlayout: Fix measuring in presence of baselines
The measure logic (unlike the allocation logic) was enforcing strict
baseline alignment of child widgets even if no child widget had valign
set to baseline. This was causing GtkCenterLayout to request more size
than it actually needed.

Instead, bring the logic closer to that of GtkBoxLayout by introducing
explicit have_baseline and align_baseline variables. We track and report
baseline if have_baseline gets set, but it only affects our reported
minimum and natural sizes if align_baseline ends up set, which happens
if there's a child widget that has valign set to either one of the two
baseline values, and itself reports a valid baseline.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 15:20:47 -04:00
G.Willems
b0c1658642 theme: use relative font sizes
This allows text to properly scale when changing the default font size.
2023-09-19 15:20:09 -04:00
Matthias Clasen
0df887014f composetable: Warn for things we can't handle
The compose table stores the keyvals to match against
in a guint16 array, so it can't handle directly encoded
Unicode codepoints (which have a high bit set). Warn
if we encounter those.
2023-09-19 15:19:51 -04:00
Matthias Clasen
8957f9f5a8 composetable: Accept short compose sequences
Followup to 8931169e00. That commit did
not do enough work to actually accept sequences
of lenth 1, as pointed by Mike Fabian.
2023-09-19 15:19:35 -04:00
Mike FABIAN
f495f9cf7d Add test case for single char compose sequence 2023-09-19 15:19:27 -04:00
Matthias Clasen
f1e09eb692 gsk: Clean up standalone headers
We require folks to include gskglrenderer.h in order
to create a GL renderer. So we be careful to only
include header in gskglrenderer.h that won't trigger
ugly warnings.

See !6363
2023-09-19 15:19:10 -04:00
Michael Orlitzky
2eb6194604 testsuite/gsk: add explicit dimensions to <svg> elements
Without an explicit width, height, and viewBox, there is no single
correct way to render an SVG. In the absense of said information,
librsvg is capable of making a guess by rendering the SVG to a Cairo
surface and then analyzing that surface; however, this process is
merely heuristic.

There are three GTK tests for SVG images that are missing dimensions.
While this is not a violation of the SVG specification, it does
implicitly couple the test to the librsvg rendering heuristic. In this
commit we add that dimension information so that the expected result
is unambiguous.
2023-09-19 15:18:51 -04:00
Sergey Bugaev
6171070153 snapshot, gsktransform: Mention that rotation happens around (0, 0)
...and not around the center of the render node, as one could expect
given that the render node syntax for rotation, transform: rotate(90);,
happens to match the CSS syntax for the same thing, and CSS does rotate
around the center by default.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 15:16:38 -04:00
Sergey Bugaev
7e931fca41 snapshot: Fix push_repeat () with empty child bounds
The logic would confuse empty child bounds (in which case nothing should
get rendered) with NULL child bounds (in which case the child node's own
bounds should get used). In fact, if the child bounds are empty, we can
discard the descendant render nodes completely, getting a nice little
optimization.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-19 15:16:25 -04:00
Matthias Clasen
2117afbbb5 demo: Fix a bug without GL
The gears widget was just not unrealizing properly
when GL is not available. Fix that.

Fixes: #6059
2023-09-19 15:15:53 -04:00
Luca Bacci
7062a374ee GdkWin32: Unref GdkMonitor after calling gdk_monitor_invalidate ()
Ensure that we have a reference when calling gdk_monitor_invalidate ()

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6080
2023-09-19 18:52:39 +02:00
Nathan Follens
d66f590a86 Update Dutch translation 2023-09-19 12:31:33 +00:00
Boyuan Yang
1f00d62610 Update Chinese (China) translation 2023-09-19 01:39:41 +00:00
Boyuan Yang
b6458ebe8c Update Chinese (China) translation 2023-09-19 01:35:49 +00:00
Rūdolfs Mazurs
7b6b31f0d8 Update Latvian translation 2023-09-18 13:29:49 +00:00