1
0
Fork 0
Commit graph

993 commits

Author SHA1 Message Date
Sebastian Keller
bac157b037 tests/wayland-unit: Fix typo
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3032>
2023-09-14 10:41:11 +00:00
Jonas Ådahl
4ff54997b6 cursor-renderer/native: Create all view objects before realizing
Realizing a cursor will assume view related state objects are valid so
they can mark them as dirty. This assumption broke when there were a
scale changed that happened with multiple CRTCs, as we'd create view
object by view object as we realized the texture. Realizing the texture
would trigger a signal that had the handler assuming the validity of all
view objects, but if we only had gotten to the first, the second view
would not be there yet, thus we'd be doing a NULL pointer dereference.

Creating the view objects first, then handling the updating avoids this
problem by making the already done assumption valid on hotplugs.

The test case added tests exactly this series of events, and uses a
virtual monitor as a cheap trick to make the KMS CRTC based view the
first one, and an arbitrary view the second that previously had its view
object initialized too late.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3012
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3262>
2023-09-13 10:38:06 +00:00
Jonas Ådahl
838d8881d9 tests/kms/cursor-hotplug: Remove extra trailing newline
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3262>
2023-09-13 10:38:06 +00:00
Jonas Ådahl
a4aaee06f6 tests/kms/hotplug: Add missing newline
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3262>
2023-09-13 10:38:06 +00:00
Jonas Ådahl
2e295e269c tests/kms-cursor-hotplug: Clean up virtual monitor at end of test
Otherwise it'll leak into the next test, when we add one.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3262>
2023-09-13 10:38:06 +00:00
Sebastian Wick
d382d55eae edid: Fix up libdisplay-info support
* The code did not compile before.
* Change the MetaEdidInfo struct to be more friendly to libdisplay-info
* Change to nit based luminance from encoded values

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2896
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3116>
2023-09-12 17:52:34 +02:00
Jonas Ådahl
b20d7a5cc4 renderer/native: Don't queue mode set on hotplug power-save on
We need to trigger a mode set when power-save changes to 'on' if it's
purely about power saving, but when they arrive as part of a hotplug
event, we'll handle all that later, in the monitors-changed handling,
that contains the new configuration.

This avoids a crash that happens due to the mode set being queued on now
disabled connectors.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2985
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3233>
2023-09-02 11:07:39 +00:00
Jonas Ådahl
efbb8df611 tests/kms/hotplug: Clean up signal handlers in switch-config test
They remained connected, and poked at subsequent tests stack, causing
unexplainable crashes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3233>
2023-09-02 11:07:38 +00:00
Jonas Ådahl
88fef1d021 wayland/idle-inhibit: Handle immediate inhibitor destruction
If the inhibitor object was destroyed immediately, the proxy
construction completing would try to update the inhibitation state, but
this didn't work since it was already freed. Fix this by adding an
'initializing' state that keeps track of this.

Fixes: a3c62bf8aa ("wayland/idle-inhibit: Add state tracking to fix races")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2998
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3234>
2023-09-01 23:17:06 +00:00
Jonas Ådahl
10d8c5fa82 tests/dbus-runner: Add mocked screensaver service
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3234>
2023-09-01 23:17:06 +00:00
Jonas Ådahl
4a600e1031 test/wayland: Don't double-free GThreads
g_thread_join() frees the thread object, so don't use g_autoptr
(Gthread) when they will all be joined.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3234>
2023-09-01 23:17:06 +00:00
Bilal Elmoussaoui
640cbf339f tests: Move Mtk specific tests from boxes
More of the boxes tests would be moved once we have a new region type

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
3d693e8309 mutter: Completely replace MetaRectangle with MtkRectangle
There are still various helpers that might be worth to move to mtk as
well

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
aec8e50df8 mtk: Move Rectangle.[contains|could_fit]_rect from Meta
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
eafe07de31 mtk: Move Rectangle.overlap_* from Meta
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
db77759938 mtk: Move Rectangle.area from Meta
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
af7c7befd8 mtk: Move Rectangle constructors from Meta
Also rename the rect constructor from mtk_rect to mtk_rectangle_new so
it is detected as a proper constructor instead of a random function by
g-ir-scanner

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
565acaed9c mtk: Move Rectangle.intersect from Meta
Also replaces it usage everywhere & remove the Clutter helper. Note the
tests were not moved yet to mtk.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
9b2cba4e86 mtk: Move Rectangle.equal from Meta
Moves equal the equal function and removes the clutter equivalent. The
tests were not moved until all the remaining helper functions are moved.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00
Bilal Elmoussaoui
918ae0f4d4 mutter: Replace cairo_rectangle_int_t with MtkRectangle
Note: the various helpers in boxes.c were not ported yet, see the next
commit. This was intentionally done to simplify the porting process

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00
Bilal Elmoussaoui
765a918a62 build: Add a Meta Toolkit private library
Currently, Meta/Cogl/Clutter makes use of cairo_rectangle_int_t despite
the existance of MetaRectangle.

In order to make MetaRectangle usable in Cogl/Clutter as well, Mtk would
provide such base types that are shared across the various private
libraries

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00
Sandro Bonazzola
ff4d87727b Update license access method
Dropped obsolete Free Software Foundation address pointing
to the FSF website instead as suggested by
https://www.gnu.org/licenses/gpl-howto.html
keeping intact the important part of the historical notice
as requested by the license.

Resolving rpmlint reported issue E: incorrect-fsf-address.

Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3155>
2023-08-30 08:48:23 +02:00
Jonas Ådahl
e683264051 tests: Add metatests for cloned windows and suspend state
Tests https://gitlab.gnome.org/GNOME/mutter/-/issues/2984.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213>
2023-08-25 21:15:07 +02:00
Jonas Ådahl
cb6290832e tests/test-runner: Add utilities for testing cloned windows
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213>
2023-08-25 21:15:07 +02:00
Jonas Ådahl
9df38c2126 tests/test-runner: Fix include order
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213>
2023-08-25 21:15:07 +02:00
Jonas Ådahl
baa0f62ced tests/shell: Restore minimized actor state in idle callback
This fixes the following
1. Minimize window; minimize animation starts
2. Do something that immediately destroys the animated actor (e.g. terminate)
3. This triggered the timeline of the animation to emit a "stopped"
   signal while all transitions of the actor were destroyed

Previously we'd implicitly animate the scale again (set_scale(..)) which
created a new transition The hash table iterator didn't like this and
abort():ed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213>
2023-08-25 21:15:07 +02:00
Jonas Ådahl
b743cc3528 tests/test-runner: Add 'sleep suspend_timeout' command
It's a tweak to the 'sleep' command to allow well known sleep lengths.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213>
2023-08-25 15:47:05 +02:00
Jonas Ådahl
0b9f5ae75b tests: Add test case for restoring focus after overview
This is a test case for
https://gitlab.gnome.org/GNOME/mutter/-/issues/2690.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185>
2023-08-16 15:34:46 +00:00
Jonas Ådahl
587c31b611 tests/test-runner: Add toggle_overview command
This will emit the `overlay-key` key which will be handled by the test
shell.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185>
2023-08-16 15:34:46 +00:00
Jonas Ådahl
8268ec2ee8 tests/test-shell: Emulate overview grabs
This mimics what gnome-shell does when the overview is shown. This means
having a grab active, and setting the keyboard focus to the stage
itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185>
2023-08-16 15:34:46 +00:00
Jonas Ådahl
524c9aa458 tests: Introduce and use a custom test shell
Except for the tests that launches `mutter`, use a custom shell
implementation. It's roughly a copy of default.c with some cleanups on
top. A custom shell allows for a bit more freedom when doing testy
things.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185>
2023-08-16 15:34:46 +00:00
Bilal Elmoussaoui
cd27cb5c85 cleanup: Fix various typos
Using the typos cli app

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3169>
2023-08-12 20:13:37 +00:00
Carlos Garnacho
1d6d8d45d0 clutter: Update ClutterActorClass event vmethods to use ClutterEvent
With the ClutterEvent subtype structs sealed, this remains the only useful
struct type that is now usable on the Javascript side. Make all
ClutterActorClass event vmethods use ClutterEvent, and update all users
to this change.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3163>
2023-08-09 11:53:18 +00:00
Carlos Garnacho
ba4795a5f9 tests: Use ClutterEvent getter methods
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
2023-08-08 04:11:13 +02:00
Carlos Garnacho
af9d406610 tests: Avoid getting the stage through ClutterEvents
Obtain the stage through other means, as this information will
eventually move away from events.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
2023-08-08 04:02:54 +02:00
Carlos Garnacho
6fd7f95ed3 tests: Port faked events to new constructors
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
2023-08-08 04:02:54 +02:00
Bilal Elmoussaoui
ead9a3024c cleanup: Switch to pragma once
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3157>
2023-08-07 22:24:36 +00:00
Bilal Elmoussaoui
68b4cc661d clutter: Remove deprecated & unnused enums
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3103>
2023-08-07 19:30:34 +00:00
Bilal Elmoussaoui
185058456f clutter: Remove deprecated BoxLayout pack-start property
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3103>
2023-08-07 19:30:34 +00:00
Bilal Elmoussaoui
8d038789f6 clutter: Remove deprecated macros usage
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3103>
2023-08-07 19:30:34 +00:00
Michel Dänzer
679457373a tests/kvm: Use git fetch --depth=1
Otherwise it fetches the full history of the target tag, which is a lot
of data for the Linux kernel.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3141>
2023-07-30 16:29:33 +00:00
Bilal Elmoussaoui
b852bbba47 cleanup: Stop translating nick/blurb for pspecs
As those strings are intended to be used by some UI but nothing uses
that in reality except GStreamer.
So drop them similar to what GTK did at
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4717

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3101>
2023-07-19 11:33:59 +00:00
Sebastian Wick
ae5512bc05 cogl/tests: Do not blend for texture format paint tests
The default cogl blend string is
`RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))` which is alpha
blending with premult fragment results. We do not clear the src
framebuffer and even if we did set alpha to 1 in the src fb, the
resulting alpha would be 1 and we want to check the alpha of the
fragment color.

Just turn off any kind of blending instead and write out the fragment
color to the fb.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3065>
2023-07-19 10:39:55 +00:00
Sebastian Wick
d79e4c182e cogl/tests: Fix float->int, int->float conversions
To obtain a float between 0 and 1 we have to devide the integer by the
highest possible value instead of the number of values.

Fixes off by one errors in the tests on some hardware/driver
combinations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3065>
2023-07-19 10:39:55 +00:00
Robert Mader
4097cbbb53 cogl: Extend tests and fix RGB2101010 opaque formats
Notably fix several cases where bitmap packing was broken, resulting in
visual corruption with the GLES2 backend. These were reproducible with
the gradient-test from
https://gitlab.freedesktop.org/jadahl/wayland-test-clients

Also extend testing similar to the RGB8888 formats.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3065>
2023-07-19 10:39:55 +00:00
Robert Mader
f04209dcbf cogl: Add RGB8888 opaque format variants
So we can properly handle matching DRM and WL_SHM formats in a unified
manner.

Add extensive testing between these and existing pre-multiplied alpha
formats, i.e. all formats we support on Wayland.

Note that unfortunately for some format combinations  the value in the
alpha channel is not cleared as expected, likely because of fast-paths
in Cogl. If both source and destination format is opaque, it always
works, however. This thereby includes all cases where they are the same.

Co-Authored-By: Jonas Ådahl <jadahl@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3065>
2023-07-19 10:39:55 +00:00
Jonas Ådahl
6841153ad7 tests/kms-device: Add test for scheduled no-ops
We can schedule an update from the cursor manager, but that doesn't mean
there will be an actual plane assignment changed at the time of the
update processing, since for example we might have "touched" a CRTC, but
already left it before the processing started, meaning we have nothing
to change after all.

Add a test case that checks that this works properly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
2023-07-18 23:51:34 +02:00
Jonas Ådahl
ade2aa71ed tests/kvm: Bump timeout to 60 s
It can be quite slow to set up the test environment inside the VM, as
well as outside, leaving very little time for the test itself. While
it'd be nice to not run the mock env etc outside the VM, let's just bump
the timeout for now, to avoid unnecessary timeout failures.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
2023-07-18 23:51:34 +02:00
Jonas Ådahl
7a821345db tests/kms/device: Test cursor updates just before turning off CRTC
If we turn of a CRTC, we might have invalidated the cursor manager for
the same CRTC, but that should not mean a cursor plane is assigned when
turning off the CRTC.

Add a test case for this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
2023-07-18 23:51:34 +02:00
Jonas Ådahl
3b2f95cb1f kms/update: Add destroy-notify to result listener user data
No thread guarantees, users need to handle it themselves.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
2023-07-17 23:42:38 +02:00