When told to, MetaMonitorConfigStore will save the current
configuration state by replacing the monitors-experimental.xml file
(while backing a backup).
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Derive the logical monitor position not by looking at the main output
(the (0, 0) tile), but the one that is placed on the top-left corner.
This might be the non-main output on certain transformations.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Only the first output of the first monitor of the primary logical
monitor should be made primary. This fixes an issue where the wrong
logical monitor ended up as primary when the logical state was derived.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Make the nested backend emulate how the real backends actually draw,
i.e. by drawing each CRTC separately. This makes it possible to test
different configuration paths that can take place on different
hardware, without having said hardware.
For example, by setting MUTTER_DEBUG_TILED_DUMMY_MONITORS and
MUTTER_DEBUG_NESTED_OFFSCREEN_TRANSFORM to "1", one can test a system
with MST (tiled) monitors where the GPU doesn't support some transform.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add the transform as a logical monitor parameter, both when getting the
current state and applying a new configuration. The transform is defined
to be identical to MetaMonitorTransform.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Adds a <transform> element to <logicalmonitor>. It has two possible sub
elemenst: <rotation> which can be normal, right, left or upside_down,
and <flipped> which can either be true or false.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add support for rotated monitors. This is done per logical monitor, as
every monitor assigned to a logical monitor must be transformed in the
same way. This includes being transformed on the same level; e.g. if
the backend does not support transforming any monitor of a logical
monitor natively, then all monitors will be transformed using the
offscreen intermediate framebuffer.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Always draw the stage to an offscreen framebuffer when using the nested
backend, so that we more emulate things more similarly to how it works
real-world, i.e. it'll work the way whether stage views are enabled or
not.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
The CRTC position depends on the transform and how the transform is
implemented. The function calculating the positions still doesn't
support anything but the non-transformed case; this commit is in
preparation of adding support for transforms.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Keep track of the logical monitor transform. When a logical monitor is
transformed, all of its monitors are also transformed in the same way.
A logical monitor can either be transformed on the CRTC level, or using
an offscreen intermediate buffer. In both cases will the logical
monitor be transformed, but only in the latter will the view be
transformed.
MetaCrtcs::transform currently does not represent whether the CRTC is
configured to be transformed or not; only when the backend can handle
it does it correctly correspond to the actual CRTC configuration. This
is intended to change with MetaMonitorConfigManager.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Split up the MetaRendererX11 class into one for when running as a
X11 compositing manager, and one for when running as a nested Wayland
compositor.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Instead of using a environment variable, add a new 'experimental
feature' gsetting keyword "monitor-config-manager" that enables the use
of the new MetaMonitorConfigManager. This commit also makes it possible
to switch between the two systems without restarting mutter.
The D-Bus API is disabled when the experimental feature is not enabled,
and clients trying to access it will get a access-denied error in
response. A new property 'IsExperimentalApiEnabled' is added to let the
D-Bus client know whether it is possible to use the experimental API or
not.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
The logical monitor config array ownership was transferred to the
config object when it was created, but was not unset when the config
verification failed, causing the clean up path for invalid configs to
try to clean up the same list again.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit adds support for rendering onto enlarged per logical
monitor framebuffers, using the scaled clutter stage views, for HiDPI
enabled logical monitors.
This works by scaling the mode of the monitors in a logical monitors by
the scale, no longer relying on scaling the window actors and window
geometry for making windows have the correct size on HiDPI monitors.
It is disabled by default, as in automatically created configurations
will still use the old mode. This is partly because Xwayland clients
will not yet work good enough to make it feasible.
To enable, add the 'scale-monitor-framebuffer' keyword to the
org.gnome.mutter.experimental-features gsettings array.
It is still possible to specify the mode via the new D-Bus API, which
has been adapted.
The adaptations to the D-Bus API means the caller need to be aware of
how to position logical monitors on the stage grid. This depends on the
'layout-mode' property that is used (see the DisplayConfig D-Bus
documentation).
https://bugzilla.gnome.org/show_bug.cgi?id=777732
This gsetting will allow the adding of keywords to a array, where each
keyword may enable an experimental feauter, if the given mutter version
supports that particular experimental feature. Emphasis is put on the
lack of guarantee that any such keyword has any effect. Currently no
keywords are defined.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Make the concept of maximum screen size optional, as it is not
necessarily a thing on all systems (e.g. when using the native backend
and stage views).
The meta_monitor_monitor_get_limits() function is replaced by a
meta_monitor_manager_get_max_screen_size() which fails when no screen
limit is available. Callers and other users of the previous max screen
size fields are updated to deal with the fact that the limit is
optional.
The new D-Bus API is changed to move it to the properties bag, where
its absence means there is no applicable limit.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add a new D-Bus API that uses the state from GetCurrentState to
configure high level monitors, instead of low level CRTCs and
connectors. So far persistent configuration is not implemented, as
writing to the configuration store is still not supported.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Logical monitors in a configuration must be adjecent to each other,
meaning there will be at least one pixel long side touching some other
logical monitor.
The exception to this is when there is only one logical monitor, which
cannot be adjecent to any other.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
We don't want to limit ourself to whole integers for configuration, as
that'd mean it wouldn't be able to provide configurations for
fractional scalings. Thus, change scales to be referred to as floats
instead of ints.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add a 'is_underscanning' entry to the properties map, if the monitor
supports underscanning. The client should assume a monitor does not
support underscanning if no property was added.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add a D-Bus method for getting the current monitor and logical monitor
state. Currently does not contain information about transforms or any
limitations (such as limited CRTCs and cloning).
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Let the backends decide whether to just rebuild a derived state, or use
the NULL config to rebuild an empty logical state.
This also changes the expected screen size values of the no-outputs
test; as this case is actually handled now.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add support to configure the logical monitor scale. With this, it
becomes possible to override the automatically calculated scaling
number per logical monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Replace the 'scale' of an output with a vfunc on the MetaMonitorManager
class that takes a monitor and a monitor mode which calculates the
scale. On X11 this always returns 1, on KMS, the old formula is used.
On the dummy and test backends, the already configured values are
returned.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
The default (calculated) scale is derived from the output, but
ultimately set via the monitor scale. This will enable config files to
override the scale. Yet to be done is handling when a scale is not
supported by a backend (i.e. the X11 backend).
https://bugzilla.gnome.org/show_bug.cgi?id=777732
In some cases the hardware cursor is invisible when Mutter is launched from the
TTY, due to drmModeSetCursor2 failing without a fallback being set.
This patch captures the return value of drmModeSetCursor2 and in case of an
error, enables the texture based fallback. It adds a `broken` state, that is
checked in should_have_hw_cursor() and
meta_cursor_renderer_native_realize_cursor_from_*() to avoid copying every
cursor into a gbm buffer when we know it will fail every single time.
https://bugzilla.gnome.org/show_bug.cgi?id=770020
Quick motions can come across as too fast (or slow) if it crosses outputs
with different scales. If this happens, rebuild the motion delta applying
the scale that applies to each logical monitor the pointer is crossing.
https://bugzilla.gnome.org/show_bug.cgi?id=778119
To allow for more natural pointer movements from relative pointer
devices (e.g. mouse, touchpad, tablet tool in relative mode, etc), scale
the relative motion from libinput with the scale of the monitor. In
effect, this means that the pointer movement is twice as fast (physical
movement vs numbers of pixels passed) as before, but it also means that
the same physical movement crosses the distance in a GUI no matter if
it is on a HiDPI monitor or not.
https://bugzilla.gnome.org/show_bug.cgi?id=778119
Clutter's evdev input backend has no support for setting double
click timeout set by gnome-settings-daemon. This results in
touchpad click events timing out on wayland, because the
default timeout value wasn't enough.
This patch moves timeout setting to mutter and removes X11
backend specific setting from clutter.
https://bugzilla.gnome.org/show_bug.cgi?id=771576
The code calculating the output scale involves calculations around pixel
and mm sizes, however we do compare post-transformation pixel sizes to
untransformed mm sizes, which breaks the DPI calculations. Fix this by
transforming back pixel sizes back to untransformed.
While we're at it, actually compare the output height to HIDPI_MIN_HEIGHT
instead of its width, it seems right according to the #define name and
comment.
https://bugzilla.gnome.org/show_bug.cgi?id=777687
The mitigation to avoid missing EDID blob was incorrect; the reason it
sometimes failed to read was a race between different applications all
trying to read the EDID at the same time. E.g. gnome-shell as GDM would
at the same time as the session gnome-shell try to read the EDID of the
same connector at the same time, triggering a race in the kernel,
making the blob reading ioctl occationally fail with ENOENT.
Remove this mitigation, as it didn't really mitigate anything; the race
could just as well happen when doing the actual read later.
https://bugzilla.gnome.org/show_bug.cgi?id=779837
When mutter is paused (i.e. not the DRM master), stop listening on
hotplug events. Instead read the current state and set modes when
resumed.
This avoids a race condition in the drm API which currently only
manages to properly deal with one application querying the EDID state
at the same time when there are multiple mutter instances running at
the same time (e.g. gnome-shell driving gdm at the same time as
gnome-shell as the session instance).
https://bugzilla.gnome.org/show_bug.cgi?id=779837
A MetaOutput is a connector, not exactly a monitor or a region on the
stage; for example tiled monitors are split up into multiple outputs,
and for what is used in input settings, that makes no sense. Change
this to use logical monitors instead of outputs.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
When no output was specified, the screen limit was used to calculate the
aspect ratio. The screen limit, however, is either just an arbitrary
number if no screen limit is applicable, or a hardware graphics buffer
limit, which has nothing to do with anything actually displayed. Change
it to use the screen size instead, to get something that makes more
sense when no output is found.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
Expose via a new API whether the transform on a logical monitor is
handled by the backend. This was previously only exposed only in the
native backend. This will be used to emulate not supporting transforms
in the backend in the nested backend.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
Previously, the size of the logical monitor was derived directly from
the tiling information. This works fine until we add transformations,
or set modes with a dimension different from the resulting resolution
when tiled. Fix this by traversing the assigned CRTC rects, as these
are already transformed by the configuration system.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
By setting the environment variable MUTTER_DEBUG_TILED_DUMMY_MONITORS
to "1", the dummy MetaMonitorManager backend used when running mutter
nested will create tiled monitors instead of single-output/CRTC
monitors. This makes it possible to test tiled monitor configuration.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
Refactor monitor generation by splitting the generation of modes, CRTCs
and outputs into a separate function. A side effect is that each output
will have its own set of possible modes.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
Split up logical monitor cration into derived (when derived from
current underlying configuration) and non-derived (when creating from a
logical monitor configuration). This avoids that type of logic in the
logical monitor creation function.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
Add support for non-tiled monitor modes on tiled monitors. This is done
by adding all the other supported modes, except the modes with the
same resolution as the tile dimensions.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
When adding a monitor and all its outputs, don't try to set the logical
monitor of the outputs CRTC if none was assigned. This might happen if
a tiled monitor only uses a subset of the connectors it are connected
via.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
Don't set the CRTC rect and screen size at in read_current(), as those
depends on how the configuration is done. Instead, don't set the CRTC
rect at all, and update the screen dimensions when being configured.
https://bugzilla.gnome.org/show_bug.cgi?id=779745
No XDnD events which notify DnD status change comes in Wayland. To emulate XDnD
behavior, MetaDnd checks whether there is a grab or not when the modal window
starts showing. When there is a grab, it processes the raw events from
compositor, and emits DnD signals for plugin.
https://bugzilla.gnome.org/show_bug.cgi?id=765003
Implement MetaDnd for emitting DnD signals to plugins such as gnome-shell. The
xdnd handling code comes from gnome-shell, and it is hidden behind MetaDnd now.
https://bugzilla.gnome.org/show_bug.cgi?id=765003
When running nested, the pointer can be outside of the stage, meaning
outside of any logical monitor. Handle this when getting the current
logical monitor by falling back to the first logical monitor when the
pointer coordinate is outside of any logical monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=779001
Whenever an EGLOutput consumer is temporary unable to handle
eglStreamConsumerAcquire() operations (e.g. during a VT-switch),
an EGL_RESOURCE_BUSY_EXT error is generated.
This change adds the appropriate error handling to flip_egl_stream() in
order to recover from such errors.
https://bugzilla.gnome.org/show_bug.cgi?id=779112
This change adds descriptions for the following errors to
get_egl_error_str():
- EGL_BAD_STREAM_KHR
- EGL_BAD_STATE_KHR
- EGL_BAD_DEVICE_EXT
- EGL_BAD_OUTPUT_LAYER_EXT
https://bugzilla.gnome.org/show_bug.cgi?id=779112
Set up things so that if the INTEL_swap_event extension is not present,
but the driver is known to have good thread support, we use an extra
thread and call glXWaitVideoSync() in the thread. This allows idles
to work properly, even when Mutter is constantly redrawing new frames;
otherwise, without INTEL_swap_event, we'll just block in glXSwapBuffers().
https://bugzilla.gnome.org/show_bug.cgi?id=779039
Split up the X11 backend into two parts, one for running as a
Compositing Manager, and one for running as a nested Wayland
compositor.
This commit also cleans up the compositor configuration calculation,
attempting to make it more approachable.
https://bugzilla.gnome.org/show_bug.cgi?id=777800
As all the relevant backends are expected to provide
ClutterPadButtonEvents, it makes no sense to split the information,
plus all other event fields are now available and might be needed
in the future.
https://bugzilla.gnome.org/show_bug.cgi?id=771098
Using ClutterInputDeviceEvdev::output-aspect-ratio. This only applies
to devices which are not calibratable, so again we need to implement
this at the toolkit level.
https://bugzilla.gnome.org/show_bug.cgi?id=774115
We couldn't properly merge output-mapping matrix and calibration into
one. Now that libinput calibration matrix is free to use, we can
actually implement tablet calibration with it.
https://bugzilla.gnome.org/show_bug.cgi?id=774115
The initial state of the hardware cursor is not known, so always force
update it the first time we update the cursor. Do this by changing the
'force' flag of update_hw_cursor() to an 'invalidated' hw cursor state.
https://bugzilla.gnome.org/show_bug.cgi?id=771056
Clutter assumed seat0 which is most usually, but not always correct.
Add an evdev-backend specific function to allow passing the seat
that will be used for ClutterDeviceManager construction, which we
already obtain in MetaLauncher.
https://bugzilla.gnome.org/show_bug.cgi?id=778092
The MetaOutput::is_primary state was not correctly managed in two cases:
* for tiled monitors, the primary state got overridden when setting
the preferred resolution
* for laptop lid, it was not set if the laptop panel happened to be
the first output
https://bugzilla.gnome.org/show_bug.cgi?id=777732
MetaMonitorConfigStore provides an XML storage mechanism for
MetaMonitorConfigManager. It stores configuration files defined in the
same level as the MetaMonitorsConfig format, i.e. refers to high level
"monitors" and "monitor modes" instead of connectors and CRTCs.
Only reading custom files are implemented and so far unused.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Handle headless setup gracefully by having no logical monitors. This
commit only makes the monitor management code deal with it; other areas
may still not be able to handle it.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add a meta_monitors_config_new() helper. It's exposed outside of
meta-monitor-config-manager.c already, as it'll be used externally in a
later commit.
https://bugzilla.gnome.org/show_bug.cgi?id=777732