1
0
Fork 0
Commit graph

32757 commits

Author SHA1 Message Date
Bilal Elmoussaoui
e0291b4e8f clutter/pango: Don't take a callback for dirty glyphs
As the callback had nothing to do wth the renderer

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
269c3723be clutter/pango: Simplify show_layout
As it is a private function now, make it take the color & target color
states
De-duplicating the setup function between ClutterText & ClutterTextNode

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
de7eb11ed8 clutter/pango: Remove no mipmap cache
As it is always disabled, given that nothing can change that externally, remove all of that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
d75503d5f6 clutter/context: Free font map
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
76b2655495 cogl: Remove pango debug flag
As there is no pango usage as part of cogl anymore

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
7cae64fccd clutter/pango: Mark helpers as private
As they were public only for clutter to be able to use them
from pango. So simplify that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
40dc151e82 clutter/pango: Remove FontMap type
It was created just to keep an instance of the corresponding renderer /
context
Instead, move those fields into ClutterContext.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
fe3192169a Merge CoglPango inside of Clutter
As that is where the whole text rendering integration happens
And would allow us to get rid of some over-abstraction in cogl-pango,
simplify
ClutterSnapshot integration as well

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
b6b004b437 cogl/pango: Make FontMap type private
It is an implementation detail, nothing really makes use of any of it
specific APIs

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
cdc43065e0 cogl/pango: Remove font map helper
It only calls into pangocairo API and only used inside clutter
so just call pangocairo API directly

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
f5a4309f3c cogl/pango: Mark get_renderer as private
Nothing uses it externally

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
022977e7ba cogl/pango: Remove private cogl headers usage
As we will be merging CoglPango inside Clutter, so prepare for that
Note this removes the Cogl shared atlas debug usage, as it is private to Cogl

The usage of cogl_c_args was replaced with cogl_debug_c_args to avoid COGL_COMPILATION
pre-moving to clutter. The whole meson file will be removed later anyways.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
7c6effecb7 cogl/pango: Don't check if parent has a constructed override
There is always one

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
24af7ffc16 cogl/pango: Make Renderer private & final
Nothing uses it externally, so simplify pre-merging with clutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
2955b4b855 cogl/pango: Remove unused functions & declarations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Marco Trevisan (Treviño)
9872512c8a clutter/actor: Use g_set_str to duplicate owned strings
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
5ef581d8bd clutter/actor: Use g_clear_pointer when possible
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
57fb071499 clutter/actor: Avoid double-checking on NULL during free
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
009ca767aa clutter/actor: Use more auto pointers
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
2aac24deac clutter/actor: Steal instead of duplicating the last token value
Instead of duplicating a string we own already we can just steal it from
the array that we're using.

This is safe since we're sure about the tokens GStrv length and we are
always stealing the last element, so there is no risk that g_strfreev
would eventually leak something.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
101126176a clutter/actor: Use autopointer for GStrv everywhere
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
1985d9ccdd clutter/actor: Avoid computing GStrv length for simple checks
No need to do a full iteration of the tokens or doing null-checks here
since g_strsplit() is not nullable, while there's no need to do a full
length check either.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Christian Hergert
61c722881d clutter: Classify ClutterStageWindow
Previously ClutterStageWindow was an interface with only one base
implementation (MetaStageImpl) which others inherit from.

This just makes it a class so that we can use _GET_CLASS() API instead of
the costly (by comparison) _GET_IFACE() vtable lookups.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4048>
2024-10-07 13:06:26 +00:00
Jason Gerecke
d7d92c68bd backends/x11: Avoid potential crash in pad_switch_mode
The meta_input_device_get_wacom_device function may return NULL, so
we should check it before use. I'm not 100% sure that the code as
currently written could reach here with a NULL wacom_device, but
that could change in the future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4070>
2024-10-04 20:49:58 +00:00
Jason Gerecke
d46352b23f display: Do not crash attempting to display OSD for unknown Wacom device
The gnome-control-center has recently allowed unknown tablets to appear
in its UI. The UI provides a "Map Buttons" button that tries to open the
OSD, but if a device is not known there may be no Wacom object to actually
act on.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3722
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4059>
2024-10-04 20:38:55 +00:00
Florian Müllner
c215faaeef ci: Don't build our own gtk3
The gtk3 package in F41 includes the necessary bugfixes, so no need
for our own build.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4068>
2024-10-04 15:42:52 +02:00
Joan Torres
0ed0367d74 wayland/color-management: Add support for bt.709 TF
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:41:25 +02:00
Joan Torres
f671fea7b9 wayland/color-management: Add support for NTSC primaries
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:41:24 +02:00
Joan Torres
1d4061f21e wayland/color-management: When sending colorspace info send primaries too
clutter_primaries_to_wayland made sense when there only existed
ClutterColorspace. Now that ClutterPrimaries also exist, it makes more
sense to change that func to clutter_colorspace_to_wayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:40:51 +02:00
Sebastian Wick
077eb80a8d gir: Correct usage of the closure annotation
Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/:

    Whenever you’re describing a function that takes a callback, you
    should always annotate the callback argument with the argument that
    contains the user data using the (closure argument) annotation

    You should not annotate the data argument with a unary (closure).

    The unary (closure) is meant to be used when annotating the callback
    type

Recently gobject-introspection became a bit more strict with this and
that generated some warnings:

    Warning: Cogl: invalid "closure" annotation: only valid on callback
    parameters

This commit fix all the closure annotations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4058>
2024-10-01 15:39:18 +02:00
Sebastian Wick
b218fc5b7f tests/wayland-drm-lease: Let the test be skipped if not on a tty
By passing META_TEST_RUN_FLAG_CAN_SKIP instead of
META_TEST_RUN_FLAG_NONE.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4049>
2024-10-01 11:38:51 +00:00
Kamil Szczęk
57812546b9 udev: Use current tags when looking for preferred primary devices
In some use cases there is a need to dynamically change the preferred
primary GPU, or get rid of the preference altogether. This is currently
not possible due to a change in udev introduced by systemd v247. This
version made the tags "sticky", meaning there is no way to remove them
once attached. When a tag gets removed, only the CURRENT_TAGS property
reflects that change, the removed tag will remain in the TAGS property.

This also bumps libgudev version to 238, since that version introduces
a function, which we need to get the current tags.

Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1562
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4055>
2024-10-01 11:18:13 +00:00
Joan Torres
36f1a38c3b clutter/color-state: Compare chromaticity with 0.0001f epsilon
This follows the precision used by the color management protocol on
primaries.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
2636ff7430 tests/wayland: Add color-management test
Right now multiple image_descriptions are created with different
parameters and are set to a surface.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
fcbd2e3840 clutter/color-state: Add support for gamma TF
This TF can't be defined as a TransferFunction enum because it needs a
gamma_exp value too.

Add to EOTFType enum a new type: EOTF_TYPE_GAMMA.

With this new type, now EOTFs are unions that can have either
a TransferFunction enum or a gamma_exp.

Set gamma_exp as uniform.

Add the support of it in the color management protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
3b53f7cb6c clutter/color-state: Drop using default colorspace and default tf
Use the defaults explicitliy, which is SRGB for both.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
eff17bf1b5 clutter/color-state: Encapsulate primaries, tf and luminance
These properties now are tagged unions:
- ClutterColorimetry:
    Can be from colorspace or primaries;
- ClutterEOTF:
    Can be from known tf or custom gamma exp (next commit);
- ClutterLuminance:
    Can be defined explicitly or derived;

Make the color management protocol use them too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
8d9c70acda clutter/color-state: Drop GObject properties
ColorState is inmutable so the GObject properties aren't necessary.

Also move ClutterColorstate and ClutterTransferFunction enums to
color-state.h now that they are not used as GObject properties.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
dbfacc06bc clutter/color-state: Add missing endline in get_inv_eotf
Keep consistency with get_eotf.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
2a3c5db4de clutter/color-state: Use to_string funcs and drop enum_to_string
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Jürgen Benvenuti
9eadeec742 Update German translation 2024-09-27 09:30:05 +00:00
Florian Müllner
f251e1f491 Add gvdb subproject to .gitignore
gvdb always uses a subproject wrap, so we never want to check
in the checked out sources.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4047>
2024-09-25 13:49:29 +02:00
Robert Mader
8e912a09d1 build: Disable asserts and cast checks in Mutter
For non-debug and non-plain cases - i.e. mainly release builds.

This ensures we use the same options in all places and draws a cleaner
distinction between g_assert() and g_return_if_fail() - the later will
still be done in release build while the former are meant for debug
only.

One advantage of doing this is that it allows us to use non-trivial
asserts more generously, such as calling `g_list_length()`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3424>
2024-09-24 14:07:23 +00:00
Christian Hergert
2666aabde2 tests: Avoid g_assert() use in unit tests
This is aimed towards allowing g_assert() to be compiled out of
release builds by ensuring they do not affect the testsuite.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4011>
2024-09-24 14:51:43 +02:00
Jonas Ådahl
bce2790f7f Revert "window/wayland: Use scale for configured rect in configuration"
This caused https://gitlab.gnome.org/GNOME/mutter/-/issues/2616.

This reverts commit 2a62e690a2.


(cherry picked from commit 2ea002c0df)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4041>
2024-09-23 22:53:01 +00:00
José Expósito
562beb9314 tests/wayland: Add lease without connectors error test
Add a test that:
- Creates a client
- Creates and submits a lease without connectors
- Check that the compositor returns the correct error

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
973454dbdd tests/wayland: Add duplicated connector lease error test
Add a test that:
- Creates a client
- Creates a lease with a duplicated connector
- Check that the compositor returns the correct error

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
c804222e40 tests/wayland: Add connector lease with leased connector test
Add a test that:
- Creates 2 clients
- Leases a connector using the first client
- Tries to lease the same connector using the second client
- Checks that the first lease succeeded
- Checks that the second lease failed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
e6178fae6d tests/wayland: Add connector lease test
Add a test that:
- Creates 2 clients
- Leases a connector using the first client
- Checks that the first client receives a lease_fd event
- Checks that both clients receive a connector withdrawn event
- Finishes the lease
- Check that both clients have access to the connector

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
c366e32da6 tests/wayland: Add DRM lease device release test
Add a test that:
- Creates 2 clients
- Releases a device for each client
- Checks that releasing a device for one client doesn't affect the other
- Checks that an error is raised if a released client is used

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00