To avoid mostly going through struct fields in macros as we might soon
move those first to a WindowConfiguration & maybe even make the window
struct private with time.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4111>
As it ends up using the global default context. So just call that
directly to easily spot the remaining usages of get_default_context.
Note that the helper will probably be removed later this cycle once the
remaining usages in meta & libst have been replaced with passing around
the context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
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>
cogl_framebuffer_finish can result in a CPU-side stall because it waits for
the primary GPU to flush and execute all commands that were queued before
that. By using a GPU-side EGLSync we can let the primary GPU inform us when
it is done with the queued commands instead. We then create another EGLSync
on the secondary GPU using the same fd so the primary GPU effectively
signals the secondary GPU when it is done rendering, causing the latter
to wait for the former before copying part of the frames it needs for
monitors attached to it directly.
This solves the corruption that cogl_framebuffer_finish also solved, but
without needing a CPU-side stall.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
This adds meta_egl_create_sync and meta_egl_destroy_sync to be able to
create and dispose EGLSync objects, respectively, as well as
meta_egl_wait_sync to be able to wait for an EGLSync on the GPU.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
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>
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>
While in double buffering we only care about one previous presentation,
triple buffering will sometimes need to refer to the presentation from
two dispatches prior. So it might help to separate those frame stats
more clearly. This way each frame's dispatch and presentation times are
stored more cohesively such as to not be overwritten during overlapping
frame lifetimes.
Having two types of frame reference (dispatch and presentation) moving
at difference speeds meant that they could not be stored in a ring. Not
all dispatches become presentations and so storing them in a ring would
necessitate very complex conflict avoidance. Instead, a simple reference
counting model was used.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
So that we maintain a perfectly balanced number of callbacks:
dispatch == notify_ready + notify_presented
Otherwise you can't put any useful logic inside notify_ready and be sure
you're handling all the empty frames.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
e994fbf02 moved warping the pointer to before the destruction of the
resource to prevent dereferencing the constraint after destruction.
This however meant that the constraint was still active when the motion
event caused by the warp is handled, which would constrain the pointer
back again to its original position.
This moves the warping of the pointer back to after the destruction of
the resource and instead just retrieves the seat earlier while the
constraint is still valid.
Fixes: e994fbf02 ("wayland/pointer-constraints: Warp pointer before destroying resource")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3696
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4098>
The sync_fd represents only the primary GPU work.
Fixes: c2621eca151d ("onscreen/native: Set latest cogl sync_fd on KMS update")
v2:
* Use g_steal_fd. (Georges Basile Stavracas Neto, Sebastian Wick)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4060>
This reverts commit bad48ea8155d94af7b62bf4ff42d747f27c7464c.
Commit 666e5f1f9 (keybindings: Port to Clutter, 2013-10-03) changed the
Meta.KeyEventHandler callback so that it would take a Clutter.KeyEvent
instead of an XIDeviceEvent. This removed the need for the "(type
gpointer)" annotation, since Clutter works with introspection.
The gpointer annotation caused GJS to simply skip over the callback
argument. Since this was only the second-last argument, reintroducing it
required updating gnome-shell JS code that used the last 'binding'
argument. This was likely inconvenient at the time, since work was
happening in a separate 'wayland' branch, and compatibility with the
X11-only branch had to be kept. So shortly after, the gpointer
annotation was reintroduced with commit bad48ea81 (introspection: Make
MetaKeyHandlerFunc compatible with master, 2013-12-09), unbreaking the
gnome-shell JS code.
But now that the 'wayland' branch has long been merged, we can fix this
properly by removing the gpointer annotation and updating the JS
handlers instead.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4079>
The script is used to install dependencies that are needed both
for the CI image and the gnome os system extension.
To avoid installing dependencies in an environment where they are
already satisfied, they should be guarded by an appropriate check,
most commonly pkgconf.
Right now these checks are straight-forward:
- if a dependency is not in the base image, it will
be built when building the CI image
- if a dependency is not in GNOME OS, it will be
built when building the GNOME OS system extension
However we will soon add another caller of the script, when
allowing to export a system extension from our development
toolboxes to the host.
That case is trickier, as the dependency *is* satisfied by
the build environment (because it is based on the CI image),
but it will still be needed by the exported system extension.
To account for that case, add a pkgconf wrapper that only searches
in PKG_CONFIG_DIRS in the specified destdirs.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4075>
When building a system extension for GNOME OS, any extra
dependencies are needed both in the container (for building)
and the extension's destdir (for running).
Because of that, the --destdir flag that was added in commit
8aeb6dc86 does not only install to the specified directory
as expected, but also runs a second install step without
destdir (i.e. to the system).
However that behavior is not a good fit when we extend our
existing toolbox tooling to build system extensions for
Fedora instead of GNOME OS.
To account for that, make the --destdir option cumulative
and install the project to all provided destdirs (or /
if omitted).
This gives us the flexibility to install to the system, a
different destdir, or both:
```
$ ./install-meson-project.sh # install to system
$ ./install-meson-project.sh --destdir /new/dest # install to destdir
$ ./install-meson-project.sh --destdir /new/dest --destdir / # both
```
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4075>
It will be used to force the color state of all monitors to be as if
they managed to turn on HDR mode. This is useful for debugging shaders
in an environment where an HDR mode capable display is not available,
such as the nested mode.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4035>
During an onscreen swap, the cogl_onscreen_swap_buffers_with_damage()
function ensures that the Cogl renderer creates a sync object every
frame. This sync object is later shared with the Wayland clients that
utilize the explicit sync protocol.
However, in headless mode, the function mentioned above is not called.
As a result, the sync object the Cogl renderer stores seems to be not
created. This causes cogl_context_get_latest_sync_fd() function to
return an invalid sync fd, causing Mutter to not be able to materialize
the sync timeline point that the clients wait for when the explicit sync
protocol is in use.
This change simply adds a call to the cogl_framebuffer_flush() function
to the offscreen swap path to make sure that there is a sync object that
can be shared with the clients, which will be signalled when all the
queued operations before the swap are completed.
Signed-off-by: Doğukan Korkmaztürk <dkorkmazturk@nvidia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4056>
While the events when processing keybindings are quite obviously
key events, the individual structs are all opaque and all public
API is provided by the generic ClutterEvent type. That means that
any handler that uses the passed in event must cast it to
ClutterEvent anyway, so drop the cast to ClutterKeyEvent when
processing key events.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4080>
The option is advertised as alternative to --help, but doesn't
actually work. While not super important for a script that isn't
user facing, it's a trivial fix and doesn't hurt.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4074>