This uses the ref test infrastructure inside the cursor tests screen
cast client, and verifies the content on the screen cast matches the
content of the compositor, both when using the 'embedded' cursor mode,
and the 'metadata' cursor mode.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
It doesn't contain anything screen cast specific, except the
XDG_RUNTIME_DIR, so make it usable from elsewhere. While at it, prepare
it for being able to run the glib test functionality.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
This also avoids loosing precision since the float won't be casted to an
int before being used to configure the test output.
Currently there is only one test that expects the scale to be calculated
dynamically, all the other always assume scale ending up being 1.0
unless explicitly configured in some way.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
Only actively test MemFd, and don't ever ask for or expect MemPtr, since
we don't support those anyway. Also, for convenience, ask the buffers to
be automatically mmap:ed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
It took a MetaTestClient, which wasn't used. To allow it be used for windows
that doesn't come from a MetaTestClient, remove the MetaTestClient
namespace, and update the callers.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
This adds wl_seat and wl_pointer boilerplate, and a pointer-entered
signal on the surface helper struct. It's intended to be used by a
future cursor test case client.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3859>
As those tests are not really useful, see previous commit. Removing them
allows us
to get rid of gdk-pixbuf in this code path and so, allowing to
completely remove it
once the MetaBackground API is refactored.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4133>
As is, ClutterImage is not really useful, it only serves for rendering a
CoglTexture as an actor. Shell, has a subclass that adds more features
that unfortunately cannot be upstreamed without bringing more gdk-pixbuf
usage inside libmutter, eg implementing GIcon/GLoadableIcon.
It also has requirements based on whether the image is symbolic or not.
Things that Clutter so far doesn't care about.
So just remove ClutterImage & let shells re-implement it themselves if
needed based on their needs.
Note, that once we have ClutterSnapshot, it should be straightforward to
write a custom actor that renders a CoglTexture or so.
This "un"fortunately means getting rid of various interactive tests that
either didn't compile at all or are not useful as is, like all the
remaining interactive tests.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4133>
The same MetaCrtcMode objects can be reached via the
MetaOutputInfo::modes array & MetaMonitorMode::crtc_modes arrays and via
the MetaGpuPrivate::modes list, so all of them need to hold their own
references.
In turn, those references need to dropped in meta_output_info_unref and
meta_monitor_mode_free. (meta_gpu_finalize is already dropping the
MetaGpuPrivate::modes list references)
Fixes leak:
==4092== 123 (32 direct, 91 indirect) bytes in 1 blocks are definitely lost in loss record 11,396 of 13,056
==4092== at 0x4F81D57: g_type_create_instance (gtype.c:1929)
==4092== by 0x4F64ABF: g_object_new_internal.part.0 (gobject.c:2606)
==4092== by 0x4F676BA: g_object_new_internal (gobject.c:2923)
==4092== by 0x4F676BA: g_object_new_valist (gobject.c:2945)
==4092== by 0x4F67A0C: g_object_new (gobject.c:2418)
==4092== by 0x4AB578B: meta_crtc_mode_virtual_new (meta-crtc-mode-virtual.c:51)
==4092== by 0x4B081BB: meta_virtual_monitor_native_new (meta-virtual-monitor-native.c:83)
==4092== by 0x4AC58CC: meta_monitor_manager_native_create_virtual_monitor (meta-monitor-manager-native.c:603)
==4092== by 0x496803B: meta_monitor_manager_create_virtual_monitor (meta-monitor-manager.c:621)
==4092== by 0x4A4A204: create_virtual_monitor (meta-screen-cast-virtual-stream-src.c:625)
==4092== by 0x4A4A39D: ensure_virtual_monitor (meta-screen-cast-virtual-stream-src.c:663)
==4092== by 0x4A4A461: meta_screen_cast_virtual_stream_src_notify_params_updated (meta-screen-cast-virtual-stream-src.c:684)
==4092== by 0x4A568C5: on_stream_param_changed (meta-screen-cast-stream-src.c:1565)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4149>
Most of the implementation at color state was specific to a color state
generated from parameters so move it to a new class Params.
In the next commits a new color state ICC class will be added.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
clutter_stage_schedule_update() sets the field `update_scheduled` to
`TRUE` as an optimization to make redundant updates a no-op. This failed
if there was a pending event and if the stage was not yet mapped.
What happened is:
* clutter_stage_schedule_update() is called
- ClutterStage::update_scheduled is set to TRUE
- frame clock scheduled
* frame clock dispatches
- frame is discarded early, no actual stage update happens
* device is created (e.g. virtual device from remote desktop session)
- `device-added` event reaches ClutterStage::event_queue
* stage is shown
- clutter_stage_schedule_update() is called
- ClutterStage::update_scheduled is TRUE
- ClutterStage::event_queue has events in it
- These two conditions means clutter_schedule_update() becomes a
no-op
At this point, no more updates will happen from
clutter_stage_schedule_update().
Fix this by resetting `ClutterStage::update_scheduled` to `FALSE` even
if the frame was discarded due to the stage not yet being mapped.
A test case is added that replicates the above descibed events.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3804
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4152>
To allow tests to emulate GNOME Shell behavior, where the stage showing
is delayed. Do so by adding the `"options"` property to the plugin
object type. The property expects a vararg GVariant, and supports
the `"show-stage"` (boolean) vararg entry.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4152>
In contrast to realtime scheduling, this doesn't risk us getting
SIGKILL:ed when the kernel is doing busy looping in
drmModeAtomicCommit() for some reason, but will according to testing,
right now, give us more or less the same benefit when it comes to
dispatch lateness and commit lateness.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4124>
Either prefer "normal" or "realtime", via an enum, instead of a boolean.
Also make it configurable with an env var
`MUTTER_DEBUG_KMS_SCHEDULING_PRIORITY`, which can be set to either
`normal` or `realtime`.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4124>
There's a workaround (ec18a559c687 ("monitor-manager: Ignore
tablet-mode-switch on initial config of native portrait mode panels")) for
panels that default to portrait mode, where touch mode is disabled, but
a touchscreen is present. This workaround gets applied when we receive
the first reading from the orientation manager.
Make sure this workaround is applied as expected by adding a test for it.
The test needs to be first in the list of orientation tests, because mutter
only applies the workaround on the first orientation event it receives.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4126>
Add a flag to MetaMonitor indicating if the monitor is available for
lease and store/update it from the monitor configuration.
Also, add unit tests validating that the configuration is applied and
that invalid configurations fail.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4112>
As they are not used anywhere, in the next commit
we will just remove the whole thing and use glib helpers directly as
there is nothing specific about ClutterThread anymore
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
The hook would be optional if anything called `meta_plugin_get_info()`,
except that since commit 4fdbb466e1c ten years ago, nothing has done so.
It seems a bit pointless to export information that is completely
unused, so stop doing that.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4104>