In order to test deriving the logical state from the underlying
configuration, as is always done on X11, make the test backend derive
the state when stage views are disabled.
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
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
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
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
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
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
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
Make sure that each logical monitor owns the expected actual monitors.
This currently needs special care when dealing with laptop lid the
configuration, as the MetaMonitorConfigManager path still deosn't
handle restoring the previous configuration, meaning the logical
monitor with the external monitor will continue being primary.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
This is partly redundant given that the current monitor mode is checked
against the CRTC mode, but this also checks the disabled CRTCs. Later
the configured mode position and transform will be checked.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Check that the crtc mode has the correct intra-monitor position. In
effect, this tests that the CRTCs in a tiled monitor are configured with
the correct mode on the correct position.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
The main output of the main (first) monitor of a primary logical
monitor should have the MetaOutput::is_primary field set; all other
outputs should have it not set.
All outputs associated with a logical monitor with presentation set
should have MetaOutput::is_presentation set. No other outputs should
have it set.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add a flag to the test setup creation function enabling the caller to
specify whether a stored config should be used. This is done by
changing the value of the hotplug_mode_update MetaOutput field,
normally used by VMs to do the same.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Both the monitor unit tests and monitor store unit tests will want to
check whether the config manager is used and set custom configuration
files.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Don't let a dummy option context consume the arguments; just let the
GLib test suite do it. It'll handle the basic command line arguments
and allow doing things such as specifying what test to run.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
This tests only the monitor configuration and basic functionality. It
does not test anything related to window management and Wayland client
interaction.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Use the g_assert_cmp(int|uint|...) macros when comparing integers and
unsigned integers. This means that the mismatched numbers are printed
in the test report.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Add a test case that checks that configuration works when the lid is
initialy closed then later opened. This test case is disabled when the
legacy configuration is used as it does not handle that situation.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
The new monitor configuration system (MetaMonitorConfigManager) aims to
replace the current MetaMonitorConfig. The main difference between the
two is that MetaMonitorConfigManager works with higher level input
(MetaMonitor, MetaMonitorMode) instead of directly looking at the CRTC
and connector state. It still produces CRTC and connector configuration
later applied by the respective backends.
Other difference the new system aims to introduce is that the
configuration system doesn't manipulate the monitor manager state; that
responsibility is left for the monitor manager to handle (it only
manages configuration and creates CRTC/connector assignments, it
doesn't apply anything).
The new configuration system allows backends to not rely on deriving the
current configuration from the CRTC/connector state, as this may no longer be
possible (i.e. when using KMS and multiple framebuffers).
The MetaMonitorConfigManager system is so far disabled by default, as
it does not yet have all the features of the old system, but eventually
it will replace MetaMonitorConfig which will at that point be removed.
This will make it possible to remove old hacks introduced due to
limitations in the old system.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
The function meta_monitor_manager_read_current_config() was renamed to
meta_monitor_manager_read_current_state() as it does not read any
configuration, but reads the current state as described by the backend.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
The MetaMonitorMode referred to the mode of a CRTC, and with the future
introduction of a MetaMonitor, theh old name would be confusing.
Instead call it what it is.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Set up the expected result in a declarative way in the same place as
the test case setup is declared. This way we have a completely
declarative way to create test cases.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
Since mutter was changed to be D-Bus activatable, the test cases has not
been working when running from inside a GNOME Wayland session. This
commit makes the test work again by ensuring the tests run in a nested
mutter instance.
https://bugzilla.gnome.org/show_bug.cgi?id=763125
Separate from meta-test-runner which runs metatests testing window
manager operations, a new test program (mutter-unit-tests) is
introduced. This is meant to run unit test like tests on various units
in mutter.
An initial test testing the order of MetaLater callback invokation was
added.
https://bugzilla.gnome.org/show_bug.cgi?id=755605
The test runner sends a "show" command to the test clients and assumes
this was enough work done by the client to enable the compositor to map
the window. Now that we wait to show a Wayland window until the first
buffer is attached (see bug 750552), we need to make sure that we attach
a buffer before assuming that we have the final stacking order.
So, to in order to continue relying on "show" to be enough to actually
show a window, let the test client wait until it has drawn the first
frame.
This makes the tests using Wayland clients test non-flaky.
https://bugzilla.gnome.org/show_bug.cgi?id=754711
Add commands to request the client to minimize or unminimize the window;
unminimize doesn't currently work for GTK+ because it expects XMapRequest
to be received by the window manager, but the window is already mapped.
https://bugzilla.gnome.org/show_bug.cgi?id=737233
Allow putting '|' into the list of windows for assert_stacking to
represent the position of the guard window. Not present is the same
as at the beginning (bottom) of the list.
https://bugzilla.gnome.org/show_bug.cgi?id=737233
Sometimes (for example with minimization) a request from the client
causes queued work rather than immediate work; so make the test client
'wait' command wait for a full frame cycle.
https://bugzilla.gnome.org/show_bug.cgi?id=737233
Restacking the frame for a window while unmanaging the window is
harmless, but for undecorated (in particular, client-side-decorated)
windows, this causes problems because the window is typically
destroyed by the client immediately after withredrawing the window.
Skip windows flagged as being unmanaged when assembling the new
stack and when comparing the old order to the new stack.
Add a stacking test for this.
Putting X windows and pointers to MetaWindows into a union had a number of
problems:
- It caused awkward initialization and conditionalization
- There was no way to refer to Wayland windows (represented by
MetaWindow *) in the past, which is necessary for the MetaStackTracker
algorithms
- We never even cleaned up old MetaStackWindow so there could be
records in MetaStackWindow pointing to freed MetaWindow.
Replace MetaStackWindow with a 64-bit "stack ID" which is:
- The XID for X Windows
- a "window stamp" for Wayland windows - window stamps are assigned
for all MetaWindow and are unique across the life of the process.
https://bugzilla.gnome.org/show_bug.cgi?id=736559
Add a basic framework for tests of Mutter handling of client behavior;
mutter-test-runner is a Mutter-based compositor that forks off instances
of mutter-test-client and sends commands to them based on scripts.
The scripts also include assertions.
mutter-test-runner always runs in nested-Wayland mode since the separate
copy of Xwayland is helpful in giving a reliably clean X server to
test against.
Initially the commands and assertions are designed to test the stacking
behavior of Mutter, but the framework should be extensible to test other
parts of client behavior like focus.
The tests are installed according to:
https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests
if --enable-installed-tests is passed to configure. You can run them
uninstalled with:
cd src && make run-tests
(Not in 'make check' to avoid breaking 'make distcheck' if Mutter can't be
run nested.)
https://bugzilla.gnome.org/show_bug.cgi?id=736505