These actors are expected to be destroyed along with their surface, this
however happens later in the process, so there is a moment where actors
are eligible for picking, but do not have a surface anymore.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
That was only there to force updating MetaFrame's bounds
but that is something that is already updated in
MetaWindowX11.move_resize_internal. So just drop all of that
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
By ignoring obcured surfaces we can generalize the single-pixel-buffer
background check to work with arbitrary surface trees, as long as the
two top ones are the background and content surfaces.
As a nice side effect of this, clients like Firefox now usually take the
shorter `meta_window_is_fullscreen (window) && n_visible_surface_actors == 1`
route.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3699>
As we are getting close to have a Wayland-only build, guard those usages
so we don't 'regress'.
Once Kiosk figures it use case, we can revert both this commit and the
previous one.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3652>
Using `meta_wayland_single_pixel_buffer_from_buffer()` can fail if
the buffer resource is already gone. Given that we release the buffer
immediately, that is actually expected - but the client this was tested
with did/does not do so.
This made the single pixel black bar optimization fail for
GstWaylandsink, while working for the mpv Wayland backend.
Access the object directly, which is both faster and works as long as
the buffer is alive.
Fixes: ed50cbbfe4 (window-actor/wayland: Update scanout candidate check)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3662>
priv->current_drag is the property that
meta_compositor_get_current_window_drag() and therefore also
meta_display_is_grabbed() bases its check on. We use
meta_display_is_grabbed() to select which cursor to use (window cursor
vs root cursor) when updating the cursor in MetaCursorTracker.
Since meta_window_drag_begin() sets a new cursor, and therefore triggers the
cursor tracker to update the current visible cursor, we should set
priv->current_drag before the call to meta_window_drag_begin(). This makes
sure the cursor tracker sees that there's a window drag and changes the
cursor right away when the window drag begins (instead of doing so on
subsequent pointer events).
Fixes: 525ed1166c ("wayland/pointer: Unset current surface during window drags")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3630>
Find a surface actor that meets the criteria to drive the refresh
rate for the view. If a new surface actor is found, add a
reference to it and request frame synchronization to be enabled
for the relevant MetaRendererViewNative.
Whenever the surface actor schedules a repaint or an update, and
in case frame synchronization is enabled for the
MetaRendererViewNative, schedule the update to occur "now". This
effectively makes the surface actor's frame rate drive the refresh
rate of the monitor.
If the actor is frozen or destroyed, it is no longer expected to
schedule repaints or updates and should stop driving the refresh
rate.
When there is no surface actor to drive the refresh rate, request
frame synchronization to be disabled for the MetaRendererViewNative.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This function allows scheduling a stage update in the context of a
surface actor and emit the "update-scheduled" signal. This signal is
similar to "repaint-scheduled", but can be used to be notified of
updates that do not necessarily result in a repaint.
With variable refresh rate, any update potentially affecting the
frame pacing of a surface actor needs to be handled differently
depending on whether that surface actor drives the refresh rate or
not.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This is added as a hint so that the caller can optionally use it, e.g.
in the case that a window drag is driven by the mouse. This will be used
to more accurately follow the drag position, other than starting at the
current pointer position.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3546>
The existing comment tells us this is necessary:
> there may be drawing between the last damage event and the
> XDamageSubtract() that needs to be flushed as well.
But the commit message for 551101c65c also tells us that
synchronization is necessary before-update. Assuming both are correct
then it needs to be done in both places.
I did try optimizing out the second sync to only do it if damage
arrived during the update, but that doesn't seem to be the issue.
The damage event is arriving before the update starts and it's some
secondary changes within the damage region running late that need
flushing. So this means the client is reporting damage more frequently
than the frame rate and we're ignoring the secondary damage reports
for efficiency (XDamageReportBoundingBox), which is still a good thing.
Fixes: 551101c65c ("compositor-x11: Move synchronization to before-update")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2880
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3590>
Do not include it at header side as it is not part of the installed headers.
Only keep it in cogl-gl-headers.h as it is a private header.
Add it to all the source files that depend on it.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3593>
The function was used only once so just move it content where it is
called. It allows us to drop more cairo paths from the API surface even
if it is not part of a public api
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3581>
Enable grabbing input for popups, and drag-and-drop. Since the very
switch to using ClutterGrab underneath Wayland grabs will challenge
assumptions in existing code, these had to change in one go. A notable
one is that meta_display_windows_are_interactable() is not 100% true
anymore for xdg_popups, at least not the same.
Another change happening in lockstep is MetaDnD no longer having
to funnel events to Wayland, since the grab triggered by Wayland DnD
is now a cause of "compositor grabs", and will naturally receive events
as long as it hold. while "modal".
A number of ad-hoc checks for grabbing state has also been dropped
from src/wayland/ internals, since again Wayland grabs are a reason
for Clutter grabs, plus the mechanism itself will already take care
of focus loss and restoration.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3420>
This check was originally added because `window` was actually used.
While technically correct, there's no reason to keep it around.
Fixes: 4736f873f2 ("compositor/native: Add support for direct scanout per view")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3177>
Until now we only supported direct scanout to the primary plane if the
buffer size perfectly matched the display size.
Since display controllers usually support scaling and cropping buffers
highly efficiently, try to let them do the job. This is usually helpful
if wp_viewporter is used by the client or Mutter uses fractional
scaling.
This has several advantages:
- Games (e.g. SDL2 based ones) can almost always hit direct scanout
paths in fullscreen mode. Notably when fractional scaling is used or
the game renders in a non-native resolution (or both).
- Video players using YUV buffer formats and wp_viewporter can easily
hit direct scanout paths, making displaying video very power
efficient as the 3D engine is not used at all.
Note that this still only uses the primary plane, no overlay or underlay
planes, making this change comparatively low risk.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3177>
In a following commit we will start supporting scaled and croped
surfaces, thus, in preparation, update the logic to three common cases:
1. only one surface, fullscreen (most apps)
2. a content surface and a black background surface which the client
does not want to unmap, fullscreen
3. top-level subsurface covers the whole window and is opaque (Firefox)
The remaining currently supported cases should be fairly uncommen and
and harder to compute.
Note that we already check that the window cover the stage view in
MetaCompositorView.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3177>