Allow scale-aware Xwayland clients to scale by an integer scale
themselves, instead of letting them render them at 1x scale and then
scaling up the texture, making it look blurry.
When monitor framebuffers are scaled, this special cases Xwayland and
sends output regions in a way that Xwayland think everything is N times
as large as the logical region, where N is the ceil of the max monitor
scale.
This is done by introducing a "stage" vs "protocol" coordinate space for
X11, where the "protocol" coordinate space is "stage" multiplied by a
scaling factor.
Xwayland thus will have its own "effective scale", sent via
wl_output.scale. The effective Xwayland scale is also used for the
internal MetaWaylandSurface scale internally, unless there is a viewport
dst size set on the same surface, in which case the scale is still set
to 1, to not interfere with wp_viewport semantics.
We're guarding this behind a new experimental feature
"xwayland-native-scaling", which can only come into effect when enabled
together with "scale-monitor-framebuffer".
[v2]:
Move stage_to_protocol/protocol_to_stage to generic window class.
This means parts that aren't aware of any windowing system specific
logic, only that coordinates originate from there for a given window,
can still get their coordinates properly handled.
In particular, this means coordinates from IBus that originates from the
client, can be scaled properly when that client is using X11.
Also make them properly introspected.
[v3]:
Split up coordinate transform API.
Make it one that takes a MtkRectangle, and another that takes a point.
This means the rounding strategy becames explicit when transforming a
point, while when it's a rectangle, it's still always "grow".
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
This scale is currently a lie, it doesn't do anything. What it
represents is the current highest monitor scale, and will eventually be
used to, when configured to do so, scale X11 coordinates as well as
coordinates given to Xwayland.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
We know let Xwayland set the RANDR names from the connectors. To stop
relying on layouts and coordinates to match the primary logical monitor,
instead use the connector name of the first monitor.
Also make the X11 client sanity checking check that the right X11 output
is primary as part of the monitor tests.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
With the next commits we'll introduce a new mode for scaling of Xwayland apps,
we'll want to put this mode behind an experimental setting though, so add
that setting.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
This replaces the `legacy-ui-scaling-factor` entry in
`org.gnome.Mutter.DisplayConfig`, with the motivation being to no longer
expose X11 specific state via the monitor configuration API.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
Hooks up the wayland protocol to the color state luminances. The color
state handles the default levels so we can just pass everything through
after we checked for all the error conditions.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3953>
Hiding it in debug logging was a little too hidden. Someone might want
to know why performance has degraded without having to restart in debug
mode hoping they can reproduce the issue.
Also remove an assertion that would issue spurious warnings. We should not
always expect IMPORT_STATUS_NONE (implying the first failure must be on
the first frame). Instead we might start with IMPORT_STATUS_OK for a number
of frames and then have a sporadic failure some time later.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3928>
To expose it, run mutter/gnome-shell with `--debug-control` and then call
`./tools/debug-control.py --enable ColorManagementProtocol`, or set
`MUTTER_DEBUG_COLOR_MANAGEMENT_PROTOCOL=1`.
Co-authored-by: Joan Torres <joan.torres@suse.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3893>
Instead, get it from the context. See next commit
For ClutterText, we had to switch to using constructed
as the ClutterContext will be set for the ClutterActor in the
constructor phase
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
Or, optionally, when the MUTTER_FRAMES_PLATFORM_LIBRARY env var is set
to "adwaita". For debugging purposes, it is possible to disable loading
any platform library with MUTTER_FRAMES_PLATFORM_LIBRARY set to "none".
Add the CSS class "ssd-frame" to the MetaFrame (i.e. GtkWindow)
instances
as that lets libadwaita pick the right style, and won't do anything for
non-Adwaita styles.
This patch is specially careful not to link against libadwaita.
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/2830
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3981>
Launching pipewire and wireplumber is racy, as there is an arbitrary
amount of time between pipewire is launched, and that the socket is
bound.
In order to eliminate this race, bind the pipewire sockets ourselves,
and launch pipewire (and wireplumber) when there is activity on the
socket. This is using the systemd method of doing socket activation,
which consists of passing the number of passed file descriptors via
$LISTEN_FDS, and the pid of the launchee via $LISTEN_PID.
The former is easy, just pass the file descriptors, but the former is
more tricky when using python, as executing code before exec() is poorly
supported and likely to be deprecated. To address this, socket
activation services are wrapped in a socket-launch.sh helper which sets
the $LISTEN_PID to itself before calling exec().
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3973>
list = ['one']
list.append('two,three'.split(','))
results in ['one', ['two', 'three']]
while
list += 'two,three'.split(',')
results in ['one', 'two', 'three']
which is what is expected.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3973>
While when running with meson, we want the output to be in meson-logs
for convenience, such a path isn't feasible when running as an installed
test. To address this, make the destination path configurable via an
environment variable.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3973>
This aims to replace a reoccuring arbitrary sleep followed by a focus
assertion. The problem with these is that the sleep does not reliably
wait for long enough, due to arbitrary system resource usage in CI and
elsewhere. By instead waiting, and instead asserting we don't have any
intermediate wrong focus, we remove the race, and test for more invalid
situations.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3973>
See previous commit log on the effects of this.
This means the deadline evasion needs to be added in both cases in
clutter_frame_clock_notify_presented.
v2:
* Use meta_kms_update_set_sync_fd. (Jonas Ådahl)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3958>
If the KMS thread is using the deadline timer, and a valid sync_file
descriptor is passed in:
1. The update is deferred, and the deadline timer is left armed, until
the sync_fd signals (becomes readable).
2. Implicit synchronization is disabled for the KMS update.
This means cursor updates should no longer miss a display refresh
cycle due to mutter's compositing GPU work finishing too late.
v2:
* Use g_autoptr for GSource in meta_kms_impl_device_handle_update.
(Sebastian Wick)
v3:
* Use meta_kms_update_get_sync_fd, don't track sync_fd in
CrtcFrame::submitted_update. (Jonas Ådahl)
v4:
* Clean up CrtcFrame::submitted_update members in crtc_frame_free.
v5:
* Coding style cleanup in meta_kms_impl_device_handle_update.
(Jonas Ådahl)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3958>
If the window_drag->handle ClutterActor:visible property is FALSE,
then we avoid a full-framebuffer damage on the monitor when beginning
and ending a drag.
Testing with `mutter --wayland --display-server` still shows a full-
framebuffer damage on the first drag, but that appears to be unrelated
to this. Subsequent full-framebuffer damage which would occur on
drag-begin and drag-end have been elided.
Related: #3630
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3975>
Toplevels get the main monitor from their MetaWindow and have no main
monitor when the toplevel is not mapped.
Subsurfaces get the main monitor from their parent surface.
DnD and cursors get the main monitor from the current cursor position no
matter if the cursor is actually being shown or not.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3941>
The main monitor is role dependent. For a toplevel this comes from the
MetaWindow main monitor, for a subsurface from the parent surface, for
pointer and dnd from the cursor position.
The next commit will use meta_wayland_surface_set_main_monitor in the
different roles to keep the property up-to-date.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3941>
So far, the tests relied on the host system to provide pipewire and
wireplumber. This seperates the tests from the host system which is
especially useful if the tests are run in a toolbox which has a
different pipewire installed than the host. It also should make it
harder to have a mismatch between the pipewire library and the pipewire
daemon.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3966>
We're already inhibiting real time scheduling when reading new KMS state
after hot plugs, as well as when during mode sets, due to the kernel not
being able to reliably handle these within the 250 ms limit. However, we
didn't do this during initial probing, which meant that occasionally
we'd run into these kind of issues during startup.
Handle this by always inhibiting real time scheduling up front, and
don't uninhibit until all initially discovered device have finished
processing their initial mode set.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3628
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3960>
If an application is maximised, clutter_stage_pick_and_update_device()
goes into the
if ((flags & CLUTTER_DEVICE_UPDATE_IGNORE_CACHE) == 0)
condition and returns the current actor for the device. This means no
CLUTTER_LEAVE/ENTER events are generated and in turn means the focus is
never invalidated and updated.
This leads to tool->focus_surface always being NULL and all events are
discarded.
Notably, tool->current is set to the right surface but
that one never changes either so meta_wayland_tablet_tool_set_current_surface()
exits early too because surface == tool->current and we thus never call
meta_wayland_input_invalidate_focus().
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3616
Fixes: fb8ac5dff7 ("wayland: Track current tablet tool focus surface")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3956>
Clutter's "device-removed" signal is sent in
clutter_seat_handle_event_post(). Our tablet code is set up to handle
that signal to then notify wayland clients of removed tablet devices.
However, returning CLUTTER_EVENT_STOP for a DEVICE_REMOVED event means
we never get to the point where we send out the signals and thus never
remove the tablets.
Fixes: a37fd34bbb ("wayland: Make MetaWaylandSeat in charge of its own tablet seat")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3615
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3955>
This leads to possibly missed key release events being propagated down to
clients, and in the case of X11 clients, to stuck keys e.g. after switching
workspace with Ctrl+Alt+Left/Right and ending up with a X11 client focused.
Fixes: 11a4d56185 ("keybindings: Send trigger when a key accelerator is deactivated")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3935>
And take it into account in meta_kms_crtc_get_deadline_evasion.
This uses the same fundamental approach as clutter frame clock scheduling:
Measure the deadline timer dispatch duration, keep track of the longest
duration, and set the timer to fire such that the longest measured
dispatch duration would result in it completing shortly before start of
vblank.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3612
v2:
* Move DEADLINE_EVASION_CONSTANT_US addition from
meta_kms_crtc_determine_deadline to meta_kms_crtc_get_deadline_evasion.
* Calculate how long before start of vblank dispatch completed for
debug output in crtc_frame_deadline_dispatch.
* Shorten over-long lines in crtc_frame_deadline_dispatch.
v3:
* Take VRR into account in crtc_frame_deadline_dispatch &
meta_kms_crtc_update_shortterm_max_dispatch_duration. (Robert Mader)
v4:
* Check if deadline has already passed in meta_kms_crtc_determine_deadline,
set the deadline for one refresh interval later if so.
* Fix indentation in crtc_frame_deadline_dispatch.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3934>
Let's add a bunch of tests for the newly introduced monitor config
migration code. We're verifying that:
- monitor configs get migrated and monitors.xml is updated on startup
- existing monitor configs in LOGICAL layout mode (ie.
"scale-monitor-framebuffers" was enabled before updating mutter) get
migrated
- the migration of various more complex monitor layouts from PHYSICAL
to LOGICAL layout mode works
- for monitor layouts where conversion to LOGICAL fails, the PHYSICAL
layout mode still is migrated, while for LOGICAL at least primary
monitor and disabled monitors are preserved
- simple monitor configurations (with no scaled monitors, or with only
"irrelevant" scaled monitors at the end of the layout) do not go through
the conversion code paths
- monitor configs in PHYSICAL layout mode with integer scale factors
which will result in non-integer logical monitor sizes get converted
to the closest fractional scale factor
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
We don't want to do the work of the layout mode detection and conversion
every time we read the monitors.xml file.
Instead, when the detection logic is used, set a flag to automatically
update the config files after the parsing is finished.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
Introduce some "best effort" conversion code to migrate monitor configurations
from PHYSICAL (the old default) to LOGICAL (the new default on wayland)
layout mode.
This conversion will only be used when the old PHYSICAL layout-mode
configuration is not compatible with the new LOGICAL layout-mode one.
This only applies if 1) there's a monitor that needs scaling in the
layout, and 2) the scaled monitor comes before other monitors in the
coordinate system (ie. it's not the rightmost or bottommost monitor).
There are two algorithms added here to convert monitor layouts:
- One for "simple" 1-dimensional monitor layouts, where all monitors are
aligned on a vertical or horizontal strip.
Here's a few (inaccurate) examples of how this would look with different
layouts (left side is PHYSICAL, right side is LOGICAL, x is the origin of
the coordinate system, the numbers are scales of the monitors):
```
x──────┬──────┬──────┐ x ┌──────┐
│ 2 │ 1 │ 2 │ 2┌──┤ 1 ├──┐2
│ │ │ │ ──► └──┤ ├──┘
└──────┴──────┴──────┘ └──────┘
x ┌──────┐ x ┌──────┐
┌────┤ 1 │ ┌──┤ 1 │
│ 2 │ │ ──► └──┤ │
└────┴──────┘ 2 └──────┘
x ┌────┐
┌──────┤ │ x──────┐
│ │ │ │ ├─┬────┐
│ 1 │ 3 │ ──► │ 1 │3│ 1 │
│ │ │ │ ├─┴────┘
└──────┤ │ └──────┘
│ ├────┐
│ │ 1 │
└────┴────┘
```
- A second more complex algorithm for 2-dimensional monitor layouts with
a common baseline that all monitors are aligned to.
And examples for this one:
```
x ┌──────┐
┌──────┤ │
│ 1 │ 2 │ x──────┐
│ │ │ │ 1 ├────┐
└──┬───┴───┬──┘ ──► │ │ 2 │
│ 3 │ ├──┬───┴────┘
│ │ └──┘3
└───────┘
x ┌──────┬──────┐
│ 1 │ │
│ │ │ x──────┬──────┐
┌─────┴──────┤ 1 │ │ 1 │ │
│ │ │ │ │ │
│ │ │ ──► └──┬───┤ 1 │
│ 3 │ │ │ 3 │ │
│ ├──────┘ └───┤ │
│ │ │ │
│ │ └──────┘
└────────────┘
x ┌───────┐
┌──────┐ │ │ x ┌───────┐
│ 2 │ ┌──────┤ 1 │ │ │
│ │ │ 1 │ │ 2 ┌──────┤ 1 │
└────┬─┴────┴─┬────┴───────┘ ──► ┌──┤ 1 │ │
│ │ ├──┴┬─────┴───────┘
│ 2 │ │ 2 │
│ │ └───┘
└────────┘
```
These algorithms will fail for any more complex 2d monitor layout, eg.
```
x ┌───┬────┐
│ 2 │ 1 │
│ ├────┘
┌───┴┬──┘
│ 1 │
└────┘
x───┬───┬───┐
│ 1 │ 2 │ 1 │
├───┼───┼───┤
│ 1 │ 1 │ 1 │
├───┼───┼───┤
│ 1 │ 1 │ 1 │
└───┴───┴───┘
```
In those cases where the conversion failed, we fall back to aligning
the monitors on a horizontal line, preserving the scale, the primary
monitor and the disabled monitors.
Note that we also need to convert the scale factor in some cases,
because LOGICAL layout mode also behaves different here:
When the scale results in a fractional logical monitor size (eg.
the native monitor width is 2560px, and a scale of 3 is set =>
2560px / 3 = 853.333px), in LOGICAL mode we won't use that scale.
Instead we have an algorithm (see
meta_monitor_get_closest_scale_factor_for_resolution()) to find
the nearest fractional scale factor which doesn't result in
fractional logical monitor size. We reuse this algorithm here for
the conversion.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
We'll reuse meta_monitor_get_closest_scale_factor_for_resolution() for the
conversion of monitor configs, and during those conversions, we probably don't
want to impose the same limits to fractional scales that we usually impose.
This means that we can even convert physical layout configs where the user
manually changed to a value higher than what our fractional scale calculations
would allow.
Move this check into the calling function so that it's not imposed by
meta_monitor_get_closest_scale_factor_for_resolution() directly.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
When there is no layout mode set in a logical monitor config, we currently just
assume the configuration matches the mode that the system expects. This blows
up when the layout mode expected by the system changes (eg. by turning on
"scale-monitor-framebuffers" in mutter): Suddenly configs fail the validation
check and get thrown away.
Since we now can add one configuration for each layout mode to the config store,
we can do better here: Let's only add configurations to the store where we
verified beforehand that the monitor layout is compatible with that mode, either
because we set it ourselves using the <layout_mode> key, or by detecting which
modes the layout is compatible with.
Also update monitor config ifiles to adjust for the new layout_mode, as
they all are assumed to be "logical".
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
Verify even more assumptions we make about logical monitor configs:
- Have a more explicit check that the monitor modes in the logical monitor are
all equal
- Complain if scale factor with physical layout mode is fractional
- Make sure that scale factor with logical layout mode actually scales to a
non-fractional width and height
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
We'll need a few of those things from the monitor config store soon, also it's
generally useful to have a prefix which makes it clear where functions are
defined.
So factor some things out into a new monitor-config-utils.c file.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
Store and load the layout mode for each logical monitor configuration in
monitors.xml by introducing a new <layoutmode> element. The value of the
element can be either "logical" or "physical". The layout mode is also
made part of the monitor configuration key.
Right now this isn't doing a lot:
When no <layoutmode> is found on the config (this is the case with all
existing configs), we'll keep using the layout mode expected by the system,
without updating the config file.
When changing an existing, or introducing a new configuration, we'll now
store the current layout mode with the config though, and load it again
on the next start of mutter. This is still not problematic as long as
mutters expected layout mode doesn't change (eg. by turning on/off
"scale-monitor-framebuffers").
When the expected layout mode of mutter switches between
restarts, the monitor config is now still loaded but remains unused,
and mutter will create (and store) a new one with the other layout mode.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
We'll introduce some new migration code with the next few commits to introduce
a layout_mode property in monitors.xml. This will be significantly easier
without keeping around the old monitor migration code, so drop it.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
We have meta_verify_logical_monitor_config() already, and it does a few checks that
meta_verify_monitors_config() doesn't do yet, so let's also call
meta_verify_logical_monitor_config() when verifying the whole config.
We'll rely on this being part of meta_verify_monitors_config() soon, because we'll
stop calling meta_verify_logical_monitor_config() from the config parser.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
We forgot to check whether multiple groups of monitors are actually
all connected with each other, so fix that.
[jadahl: Rewrote algorithm to detect split groups]
[jadahl: Added test case]
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3596>
The first event happening for a new touch will be the CLUTTER_ENTER
event generated when picking it. Use this event for registration of
the touch info, so that MetaWaylandEventHandler.get_focus_surface may
get the right focus surface for the device/sequence on the first try.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3889>
And notably, don't cancel touch when an event handler is being
removed. Touch events are largely unaffected by most Wayland
grabs (pointer constraints, popups), so we might be cancelling
input too early if one of these wayland grabs was effective when
touch interaction began, but stopped sometime between touch updates.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3889>
Touch events are implicitly grabbed to the surface they began in,
and are not affected by the focus handler. However these events
will appear to come from the core pointer device, which might lead
to the wrong device being updated.
Ignore events with a sequence, since the default focus handler
does not intend to do anything with them.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3889>
On a hybrid machine with i915 primary and nvidia-drm (470) secondary,
`meta_render_device_egl_stream_initable_init` calls
`meta_kms_inhibit_kernel_thread` to change from the default 'kernel'
thread type to 'user'. And soon after that it would
`meta_render_device_egl_stream_finalize` because I'm not actually
using that GPU, and calls `meta_kms_uninhibit_kernel_thread`.
So during startup Mutter would default to a realtime kernel thread,
switch to a user thread (which doesn't support realtime), and then
switch back to a realtime kernel thread.
In the middle of all that, while the thread type was 'user' and
realtime disabled, something was invoking `ensure_crtc_frame` which
created a `CrtcFrame` without a deadline timer. Soon after that the
thread type changed back to 'kernel' with deadline timers expected, but
our existing `CrtcFrame` has no deadline timer associated with it. And
so it would never fire, causing the cursor to freeze whenever the primary
plane isn't changing. And the problem was permanent, not just the first
frame because each `CrtcFrame` gets repeatedly reused (maybe shouldn't
be called a "Frame"?).
Now we adapt to switching between kernel and user thread types by adding
and removing the deadline timer as required.
Close: https://gitlab.gnome.org/GNOME/mutter/-/issues/3464
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3950>
Colord is a system service which will result in a polkit dialog showing
up when connecting a remote session.
We want to get rid of colord eventually anyway, so disconnecting virtual
monitors from colord isn't an issue.
Fixes: f5ce2ddf3c ("color-manager: Create color devices also for virtual monitors")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3942>
If we finish compositing in time, the composited result will be
submitted prior to the deadline timer is triggered, and we'll be fine,
and if not, at least the cursor updates will be smooth, which makes it
appear smoother than not.
There is a risk that this can negatively impact composited updates when
moving the cursor, so make it possible to toggle a paint-debug flag for
now until this has been more tested.
This also mean we need to disarm the deadline timer after handling
update, as there might be a scheduled cursor update pending, but we
already handled it, so disarm the timer.
Here is an illustration of the difference.
In the following scenario, with disarming, the composited frame E, and
the cursor movement C gets presented. With this branch, only the cursor
movement C gets presented.
```
* A: beginning of composited frame
* B: begin notification reaches KMS thread
* C: cursor moved
* D: calculated deadline dispatch time (disabled with the branch)
* E: KMS update posted
* F: KMS update reaches KMS thread
* G: actual deadline (and with branch and gets committed)
Compositor thread: --------A---------------E---------
\ \
\ \
KMS thread: -----------B------C----D---F-G----
```
In the following scenario, by not disarming, the cursor update C will be
presented, and the would-be-delayed composited frame E would be delayed
anyway, i.e. fixing cursor stutter.
```
* A: beginning of composited frame
* B: begin notification reaches KMS thread
* C: cursor moved
* D: calculated deadline dispatch time (and with branch will be dispatched)
* E: KMS update posted
* F: actual deadline
* G: KMS update reaches KMS thread (and with branch gets postponed)
Compositor thread: --------A---------------E---------
\ \
\ \
KMS thread: -----------B------C----D-F-G------
```
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3184>
Although we track updates for EGL_DEVICE, they are often empty because
the primary plane has a custom page flip method. That means there's
no CRTC latched yet, but we do know exactly which CRTC is associated
with the flip. Set it so the update can still be processed.
Fixes: 27ed069766 ("kms/impl-device: Add deadline based KMS commit scheduling")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3939>
If other handlers (e.g. DnD) are on top of the popup grab focus, we
may want it to move outside same-client surfaces as the popup grab
specifies.
Check that it is the current handler before making same-client checks,
so that these handlers on top have an opportunity to find other
surfaces, e.g. during DnD from a popup.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1681
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3937>
Move away from tracking presses/releases directly, since there might be
other event handlers on top that might prevent the popup event handler
to fully track all events. The replacement is using event state modifiers,
which will use information set from the backend, and is enough to determine
there's no more pressed buttons without tracking prior event history.
This makes the popup event handler able to interact with other event
handlers that might be on top, and consume button release events for
themselves (e.g. DnD), no longer resulting in a stuck popup grab.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3937>
The relationship between MetaKmsConnector and MetaDrmLease is already
stored in MetaDrmLeaseManager::leased_connectors.
Change the type of MetaDrmLeaseManager::connectors to a GList.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3922>
As in the protocol definition for wp_drm_lease_connector_v1::withdrawn:
Sent to indicate that the compositor will no longer honor requests
for DRM leases which include this connector. [...] Compositors are
encouraged to send this event when [...] the connector gets leased
to a client.
Withdrawn the leased connectors and, if they are available once the
lease finishes, advertise them again.
Related to: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/322/
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3922>
And stop passing in the color states from the RendererNative. We also
keep the color states updated by listening for changes in the color
device.
The RendererX11Cm has a single view and no mapping to a specific color
device, so we handle the absense of a color device as well and rely on
ClutterStageView to have the default color states.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3930>
This allows us to destroy and create a new offscreen dynamically, when
the rotation or color state changes.
An idle gsource with priority higher than CLUTTER_PRIORITY_REDRAW is
used to ensure the an offscreen exists when required without having to
allocate in the redraw process.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3930>
This is usually an indication of a failed drop operation if the
drop site didn't request any target. Check for this specifically
on XDnD button release, so that we can cancel the DnD operation
right away.
Inspired on a fix from Jonas Ådahl.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3821>
We were relying on the drag source surface to keep receiving events
thanks to it being implicitly grabbed by the button press. This
broke at some point, making the Xdnd drag source unable to keep
directing the DnD operation as it is expected by X11 clients.
To fix this, make the Xdnd MetaWaylandEventInterface stick itself
to the drag source surface keeping the focus of the device driving
the DnD operation, so that the X11 client can still handle events
from it.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3511
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3821>
Currently, we would only disable a11y if a certain flag is passed
but the function is always called with NONE flag. Instead
drop the flag, use a new environment variable for that
That value is then used by actors to short-circuit get_accessible
implementation and return NULL if the accessibility is not enabled
Also clean the other accessibility functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
Instead of doing that in both MetaStage & CallyStage.
This allows ClutterStage to also emits the relavant acessibility
bits directly without having a roundtrip through Cally
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
The generic term updated can mean anything. This is specifically about
calibration related updates like changing the sink colorimetry
(Colorspace, HDR metadata) and changes to the white point for night
light etc.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3904>