1
0
Fork 0
Commit graph

32041 commits

Author SHA1 Message Date
Jonas Dreßler
76f689195e tests/utils: Actually block while waiting for input thread flushing
meta_flush_input() creates and runs a main loop in order to block until the
input thread has flushed all its events. This main loop is created on the
default main context though (NULL is passed to g_main_loop_new()), which
means that while the main loop runs, the default main context is active (aka
stage updates will happen).

This causes an issue with tests, specifically when there already is a stage
update queued before running meta_flush_input(): meta_flush_input() will
(as expected) block until the input thread flushed all its events to the
main thread. But while that is happening, the main thread will be doing the
stage update that was already queued, without the new events (the input
thread is just starting to flush those). Then meta_flush_input() returns,
and in our test we see that the stage has been updated, except it wasn't
updated with the latest events. The test now continues and fails.

To fix the issue, make meta_flush_input() truly blocking, so that it only
flushes the input thread, but doesn't drive the global main context while
waiting for that. After the flushing is finished, tests must now manually
iterate the main context themselves to ensure that a stage update happens.

This breaks a few stacking tests, because "move_cursor_to" and "click" use
meta_flush_input() internally. For those commands we now need to dispatch
a stage update afterwards.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3807>
2024-06-19 13:54:15 +00:00
Bilal Elmoussaoui
23a4261736 cally: Remove Actor.[add|remove]_actor vfuncs
They were not doing anything special other than forwarding the calls.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3814>
2024-06-18 15:59:09 +02:00
Bilal Elmoussaoui
03032805a6 cally: Move AtkAction from Actor to Text
Currently AtkActor iface is implemented by CallyActor as well
as a ton of infrastructure just for one action in ClutterText, the
activate action.

Instead, simplify the whole thing and move the AtkAction implementation
where it supposed to be.

This refactoring would help with merging Cally within Clutter in
the future

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3814>
2024-06-18 15:50:34 +02:00
Bilal Elmoussaoui
b0aacf4093 cogl: Mark XlibRenderer.get_display private
Nothing uses it externally, take the opportunity to remove an unused function
as well

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3813>
2024-06-18 13:32:13 +00:00
Bilal Elmoussaoui
8b2aa05103 cogl: Remove no longer useful headers
I suppose they were useful at times when cogl was a separate library
where you could use cogl- but that is no longer a thing

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3813>
2024-06-18 13:32:13 +00:00
Bilal Elmoussaoui
f004b560fc cogl/texture: Avoid helper methods that just chain up
This was needed pre-GObjectified CoglTexture, not neccessary anymore
so clean those up a little bit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3818>
2024-06-18 13:21:56 +00:00
Bilal Elmoussaoui
a71e39b0e0 cogl: Remove unused TextureChangeFlags
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3818>
2024-06-18 13:21:56 +00:00
Bilal Elmoussaoui
06402fd756 cogl: Remove unused TexturePixel
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3818>
2024-06-18 13:21:56 +00:00
Bilal Elmoussaoui
c9c64f0990 cogl/pango: Remove various unused private functions
A quick cleanup in preparation for moving cogl-pango to libst later

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3823>
2024-06-18 10:43:20 +00:00
Jonas Ådahl
2e2c54e356 onscreen/native: Track next and presenting buffers via ClutterFrame
Let the ClutterFrame (or rather MetaFrameNative) own both the scanout
object and the framebuffer object, and let the frame itself live for as
long as it's needed. This allows to place fields that is related to a
single frame together, aiming to help reasoning about the lifetime of
the fields that were previously directly stored in MetaOnscreenNative.

Also take the opportunity to rename "current" to "presenting", to make
it clearer that frame's buffer is what is currently presenting to the
user.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3799>
2024-06-18 10:24:40 +00:00
Sebastian Wick
42102006b0 tests/wayland-test-clients: Reuse surface for XDG toplevels
It's possible to destory the xdg_toplevel and xdg_surface which removes
the surface role and then re-use the surface on a new toplevel.

Mutter used to not create new SurfaceActors for the new toplevel which
were then shared between the old and new toplevel. This happens because
the actors can stay around after the wl resource is destroyed (e.g. for
closing effects).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3667>
2024-06-17 15:27:20 +00:00
Sebastian Wick
82c71426cc wayland/xdg-shell: Reset XDG surface roles when role is assigned
Instead of resetting in the xdg_surface.get_toplevel call.

It also changes XDG popus handling to deal with cases where the surface
was part of a window before, the same way the toplevel does.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3667>
2024-06-17 15:27:20 +00:00
Sebastian Wick
e775052429 wayland/actor-surface: Reset the actor on role-assignment
This makes sure we always have new SurfaceActors when reassigning the
same role to a previously used surface

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3667>
2024-06-17 15:27:20 +00:00
Daniel van Vugt
807c99fca6 x11: Add another fallback to legacy X11 cursor names
For X11 apps that don't specify their own.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3403
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
2024-06-17 11:39:00 +00:00
Daniel van Vugt
d2c6b77059 backends: Restore support for loading X11 cursor themes missing "default"
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3184
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
2024-06-17 11:39:00 +00:00
Daniel van Vugt
4a4ab8c533 backends: Add meta_cursor_get_legacy_name()
To aid loading of legacy cursor themes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
2024-06-17 11:39:00 +00:00
Daniel van Vugt
13b2803a03 backends: Fix parameter alignment check-code-style complains about
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
2024-06-17 11:39:00 +00:00
Daniel van Vugt
847f015017 backends/x11: Avoid defining (and freeing!) nonexistent cursors
Such as "default" for legacy X11 themes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3454
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
2024-06-17 11:39:00 +00:00
Jonas Ådahl
6d8c93ba66 tests: Mark some tests as skippable
Wayland tests also get kvm and tty test variants, but running tty tests
on your main session makes them fail. The intention for tty tests is to
skip when not run from a tty, so fix that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3811>
2024-06-17 11:24:20 +00:00
Jonas Ådahl
d9c768da0e ci: Don't build again for creating references
Enable the docs in the main build, then inherit the artifacts. It should
result in less CPU resources being used.

GitLab doesn't support multiple artifacts per job, so we still have to
download the whole build, as the build job can't hand out just the
references, and it seems to be planned as a premium-only feature sadly:
https://gitlab.com/gitlab-org/gitlab/-/issues/18744

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3816>
2024-06-15 22:27:29 +02:00
Bilal Elmoussaoui
0064bf240e cogl: Remove unused immutable_ref
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3810>
2024-06-14 21:16:05 +02:00
José Expósito
4ae305f19e backends/eis-client: Release buttons on device remove
Due to a copy and paste error, buttons were not released when the device
was removed.

Found by Coverity.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3809>
2024-06-14 17:04:20 +02:00
Bilal Elmoussaoui
69835c9ec1 cogl: Remove CoglFence
Nothing was really using it...I am removing too much?

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:34 +02:00
Bilal Elmoussaoui
4eb555a2f0 cogl: Remove unused Texture2DSliced.new_from_data
Nothing uses it and can be re-implemented externally if needed anyways.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
4f896e55d6 cogl: Remove header-only functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
e638e5dfab cogl: Remove unused OnScreen dirty_closures
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
47d427a95d cogl: Remove unused BufferTarget
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
218b77c739 cogl: Replace DamageRectangle with MtkRectangle
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
aa0600bf27 cogl: Remove Framebuffer:stereo-mode
Nothing was setting it

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
9097deb69d cogl: Remove various Framebuffer functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
2c996a1b16 build/cogl: Simplify debug c-args
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Bilal Elmoussaoui
e79f460eb8 cogl: Remove FrameBuffer CoglObject leftover
Fixes: eb14da387 ("cogl: Turn CoglFramebuffer, CoglOffscreen and
CoglOnscreen into GObjects")

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
2024-06-14 12:12:33 +02:00
Daniel van Vugt
e951265806 backends: Handle null views instead of creating dummy views
If view initialization fails then don't add the view, rather than
adding a dummy offscreen view. This avoids flooding the log with
offscreen frame clock confusion:

Before:
```
libmutter-WARNING **: 15:47:27.763: Failed to allocate onscreen framebuffer for /dev/dri/card0: Failed to allocate surface: Function not implemented
Clutter-WARNING **: 15:47:28.557: (../clutter/clutter/clutter-frame-clock.c:419):clutter_frame_clock_notify_presented: code should not be reached
Clutter-WARNING **: 15:47:28.563: (../clutter/clutter/clutter-frame-clock.c:419):clutter_frame_clock_notify_presented: code should not be reached
Clutter-WARNING **: 15:47:28.567: (../clutter/clutter/clutter-frame-clock.c:419):clutter_frame_clock_notify_presented: code should not be reached
(repeats forever)

```

After:
```
libmutter-WARNING **: 16:09:04.945: Failed to create view for Unknown 46" on None-1: Failed to allocate onscreen framebuffer for /dev/dri/card0: Failed to allocate surface: Function not implemented
```

Relates to:
https://launchpad.net/bugs/1967707
https://gitlab.gnome.org/GNOME/mutter/-/issues/2489
https://gitlab.gnome.org/GNOME/mutter/-/issues/2295

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3115>
2024-06-14 16:12:52 +08:00
Daniel van Vugt
b684b5cf05 build: Compile schemas locally for use in build tests
So they don't need to be installed system-wide before build testing
can work.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3368
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3800>
2024-06-13 22:14:51 +00:00
Marco Trevisan (Treviño)
3b3feefcd5 ci: Save gnome-shell meson logs artifacts on failure
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
3e6cf75eec tests/cogl/read-texture-formats: Do not skip any test when using AMD
All the tests are correctly passing with an AMD card, so let's enable
them all in such case, so we can catch when the test will regress even
there

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
18fa5bd81e tests/cogl/journal: Use different behavior when running in AMD
AMD driver is buggy when it comes to generate textures of 1px height [1]
while this is not a mutter problem, we should not block on that either.

So, given that the test purpose is to check the journal flushing during
unref more than its behavior, we can still check this in all the drivers
keeping a warning in the AMD case.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11269
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
03ef333937 cogl/context: Add test util function to get the GL/GLES driver vendor
Some tests sadly behaves differently depending on the driver in use.
While this shouldn't happen we can't block on these driver issues, so
add a test utils private function to get the driver information so that
we can adapt test behavior depending on this.

This will allow to disable / enable tests at runtime instead of failing
in all the implementations, which is still better for catching
regressions in the parts we may be ignoring otherwise.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
615fe1e703 tests/cogl/conform: Skip known failing tests parts in undefined mode
When running the tests in non-undefined mode we should skip the known
failing tests instead of the whole suite, so mark them as such so that
we can still run the tests partially checking the things that still
work, avoiding to regress on them too.

We also run the tests in normal mode so that we can ensure that the
failures are still happening in that way.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
ed35ff72e0 tests/cogl/conform: Run known failures tests in no-undefined mode
In this way we can just skip the single test cases that are failing

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
9c181e2407 tests/cogl/read-texture-formats: Split tests by cases to improve logging
Use multiple test cases for each format test so that it's easier to
understand what's failing and in case just skip a single test.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
bce00cb9f4 tests/cogl: Add cogl winsys debug info when running tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
504e0386cc ci: Do not run create runtime dir on script setup
We do this per each test now.

As per this we need to ensure that one exists when running the virtme
tests

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
fec38819ac tests/dbusrunner: Use separate HOME, Temp and XDG Runtime dirs
We need to use a different $XDG_RUNTIME_DIR path to be able to start most
tests in parallel, and we can use a temporary directory for that which python
cleans up when done.

Also, given that most of settings are stored in HOME use temporary one
for that too, to prevent mutter to fail because it may load some local
configuration (e.g. monitors.xml) that don't meet the expectations or
that may change the test behavior in an unexpected way.

As per this, CI needs to be adapted for new args handling

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
adc43ba001 ci: Launch pipewire through the meta-dbus-runner
We can just launch pipewire first and then wireplumber so that the test
script can be simplified

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
d01d153f56 tests/dbusrunner: Print the subprocess PID that has been launched
It can be useful for debugging purposes

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
c6631077d7 backend/native: Ignore not found errors when adding drm device in headless
When testing mutter using `META_DBUS_RUNNER_WRAPPER=rr` we may get a
not found-device error, given that it's not a case we support, we can
ignore it as we do with permission denied one, limiting this to the RR
case.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Marco Trevisan (Treviño)
2a1cc195a3 tests/dbusrunner: Add shortcut for recording with rr
RR now supports mutter, as per some upstream fixes [1], so we can add a
simple shortcut for the recorder

[1] https://github.com/rr-debugger/rr/pull/3140/

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
2024-06-13 21:21:49 +00:00
Bilal Elmoussaoui
3e363a5421 cogl/pipeline-debug: Use Color helper to get a string representation
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3544>
2024-06-13 21:19:54 +02:00
Bilal Elmoussaoui
730783b670 clutter: Remove Color type
As it is no longer used now

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3544>
2024-06-13 15:25:40 +02:00