1
0
Fork 0
Commit graph

6310 commits

Author SHA1 Message Date
Jonas Ådahl
de61da16ae monitor-manager: Reconfigure when 'scale-monitor-framebuffer' is toggled
When the experimental feature 'scale-monitor-framebuffer' is enabled or
disabled, reconfigure the monitors.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:51 +08:00
Jonas Ådahl
bdcb395b33 DisplayConfig: Add 'supports-changing-layout-mode' property
This property may be used by a client to determine whether it is
allowed to change the layout mode.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:51 +08:00
Jonas Ådahl
1caa7f7627 monitor-manager: Add public API to get logical monitor from connector
This adds a function to be used by gnome-shell to get the logical
monitor given a connector name. For now, use the same index integer
method to reference a logical monitor, but this should be revisited by
providing a better API later.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:51 +08:00
Jonas Ådahl
5b4a96e3a3 monitor: Add API to get connector
The connector returned is the one of the main output. In other words,
for tiled monitors, it is the connector of the (0, 0) tile, and for
non-tiled, it is simply the connector of the output.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:51 +08:00
Jonas Ådahl
15dd23a323 monitor-manager: Fix gtk-doc of .._get_monitor_for_output
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:51 +08:00
Jonas Ådahl
04d7fcf60d DisplayConfig: Add display-name monitor property
This is the same property as the one associated with an output in
GetResources.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
9755cd469c DisplayConfig: Make naming convention consistent
Always use hyphens as delimit words in property keys. Underscore to
delimit words in method arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
1bdadfa3e1 backend: Add API to get UI scaling
The UI scaling depends on whether the framebuffers are scaled. Enable
the caller to determine the what scale its UI should be drawn in, in
relation to the stage coordinate space by calling this function. A new
singal "ui-scaling-factor-changed" is added in order to liston for for
changes.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
20fcb88632 clutter: Remove window scaling feature
Window scaling is a clutter feature used to enable automatic scaling of
stage windows when running under as an application in windowing system.
Clutter in mutter does not support running as a stand-alone application
toolkit, so lets remove this unused feature.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
6791d1b8e2 backend: Use g_signal_emit instead of g_signal_emit_by_name
No functional changes, just a minor cleanup.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
6c8b103a7b DisplayConfig: Add "is_builtin" monitor property
Add a per-monitor property allowing the application to determine
whether the monitor is builtin or not, e.g. a laptop panel.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
95d0117784 monitor-manager: Hook up config manager to display config confirmation
Make it possible to confirm or cancel the new configuration also when
the new API is used.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
740436ab4d monitor-config-store: Add support for saving configuration
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
2017-04-07 22:30:50 +08:00
Jonas Ådahl
89fbf1e1d2 monitor-config-store: Read config file on startup
Read the file "monitors-experimental.xml" on startup and add parsed
configurations to the configuration store.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
c391cefd71 tests: Fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
52af529950 tests: Test non-native monitor transform
Test that configuration works as expected when the backend doesn't
support handling the transform and an intermediate offscreen
framebuffer is used.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
c30cb069f5 tests: Make it possible to emulate backend not supporting tranforms
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:50 +08:00
Jonas Ådahl
99a0b43f28 tests: Derive configuration when stage views is disabled
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
2017-04-07 22:30:50 +08:00
Jonas Ådahl
af4017de49 monitor-manager: Derive logical monitor position from top left CRTC
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
2017-04-07 22:30:50 +08:00
Jonas Ådahl
d804ecbd95 monitor-config-manager: Only make output primary if logical monitor
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
2017-04-07 22:30:50 +08:00
Jonas Ådahl
1ad3382bff tests: Test rotation of tiled monitors
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:49 +08:00
Jonas Ådahl
9787b1cfd5 backends/x11/nested: Emulate per CRTC drawing
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
0ac2eba4d3 DisplayConfig: Add logical monitor transforms
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
17c54c6e03 tests: Test that transforms are properly configured
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:49 +08:00
Jonas Ådahl
dd14e1cebc tests: Add monitor transform config parsing tests
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:49 +08:00
Jonas Ådahl
1e2266aa47 monitor-config-store: Add support for transform in config
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
472a434212 monitor-config-manager: Support logical monitor transforms
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
7c226462e0 core: Mark meta_fatal() as not returning
This also makes meta_fatal() not returning, even if a NULL format is
passed.

https://bugzilla.gnome.org/show_bug.cgi?id=780304

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:49 +08:00
Jonas Ådahl
93c6a869ec x11/nested: Always draw to an offscreen framebuffer
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
9d914091f5 stage-x11-nested: Remove unused field
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:49 +08:00
Jonas Ådahl
afcc1bf512 monitor: Don't keep CRTC position in MetaMonitorCrtcMode
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
8a29c51b73 renderer-view: Add view transform getter
This will later be used by the nested backend to emulate per CRTC
rendering.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:49 +08:00
Jonas Ådahl
d38c4c1f2d logical-monitor: Track whether the logical monitor is transformed
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
2091df3856 renderer-x11: Split up into CM and Nested renderers
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
2017-04-07 22:30:49 +08:00
Jonas Ådahl
744b4dcb7c tests/monitor-unit-tests: Add tests for custom tiled monitor modes
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
0c64c35a8a monitor-manager: Make the config manager an 'experimental feature'
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
2017-04-07 22:30:48 +08:00
Jonas Ådahl
57acbc53fb legacy-monitor-config: Let the manager listen on lid closed changes
This is in preparation for making config-manager work alongside the
legacy configuration system.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
ac68631f4c monitor-config-store: Don't crash when cleaning up after failing to load
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
2017-04-07 22:30:48 +08:00
Jonas Ådahl
8163ca6821 Add support for scaled logical monitor framebuffers
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
2017-04-07 22:30:48 +08:00
Jonas Ådahl
094e0356e8 backend: Add 'experimental-features' gsetting
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
2017-04-07 22:30:48 +08:00
Jonas Ådahl
0952409de4 monitor-manager: Always set current config when apply succeeds
No reason making any caller do it.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
1c54c7a1bb window: Replace monitor scale getter with geometry scale
All places that get the 'main monitor scale' of a window really just
wants the window geometry scale, so call it that.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
f25f14351c monitor-manager: Make max screen size optional
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
2017-04-07 22:30:48 +08:00
Jonas Ådahl
691e7951ea DisplayConfig: Add new API for configuring monitors
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
2017-04-07 22:30:48 +08:00
Jonas Ådahl
7eaeba520a monitor-config-manager: Verify monitor modes in logical monitor config
Verify that each monitor in a logical monitor has the same dimensions,
i.e. that it they all fill out the same logical monitor space.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
9a5b94a340 monitor-manager: Use better error code when using the wrong API
It has nothing to do with permissions, so 'not-supported' is a bit
better.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
079b125430 DisplayConfig: Group logical monitor parameters a bit better
Move around the parameters, just to put the always-there fields before
the monitor array and property box.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
770a5a5bff DisplayConfig: Drop width/height from logical monitor
It is redundant, and either side still need to do the equivalent
calculations, so lets drop it.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
0548c9e7d5 MetaMonitorConfig: Rename is_underscanning to enable_underscanning
Use better terminology to imply that the configuration enables
underscanning, not what already "is".

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
68a6cc5976 monitor-config-manager: Verify the layout origin is at (0, 0)
The extent of the layout regions must be a rectangle positioned at
(0, 0).

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
2035f2f2e2 monitor-config-manager: Verify that logical monitors are adjecent
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
2017-04-07 22:30:47 +08:00
Jonas Ådahl
1892a6b0c4 monitor-config-store: Finish logical monitor before verifying
If we verify the logical monitor before completing it (calculating the
size), we can't check what the result of the completion.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
b464004bb3 monitor-config-store: Move config verification to config manager
This way we can re-use it for example when verifying configurations
from D-Bus.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
ea4438284f DisplayConfig: Add 'properties' to GetCurrentState
Adds compositor wide DisplayConfig properties bag, and add a
"supports-mirroring" property.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
d050fdb17f monitor-manager: Add per backend capabilities
Add a private API for querying backend capabilities. For now, only
mirroring capability is reported.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
9003a42df3 monitor-manager: Add supported scales to D-Bus API
Let the configuring client know what scales are supported by the
display server.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
9e8ee491e6 monitor-manager: Add API to get scales supported by the backend
For the Xrandr backend, only scale 1 is supported, for the others, 1
and 2 are reported as supported.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
3b46345db4 monitor-manager: Make scale floats in D-Bus API
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
2017-04-07 22:30:47 +08:00
Jonas Ådahl
6b2a111428 DisplayConfig: Add an optional 'is_underscanning' monitor property
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
2017-04-07 22:30:47 +08:00
Jonas Ådahl
bc56971e18 DisplayConfig: Add new API for getting current state
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
2017-04-07 22:30:47 +08:00
Jonas Ådahl
fcc0288f0c monitor-manager: Let the backends handle no configuration
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
2017-04-07 22:30:47 +08:00
Jonas Ådahl
4e03e89869 tests: Check that mirroring is configured properly
This test checks that mirroring works when using separate CRTCs. It
does not check cloning.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
4e17017501 monitor-unit-tests: Check custom tiled monitor config
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
63bc86cd43 tests: Test configured custom logical monitor scale
Check that a configured logical monitor scale overrides any calculated
one.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
ee32ca3efe monitor-store: Support configuring logical monitor scale
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
2017-04-07 22:30:46 +08:00
Jonas Ådahl
a393a614a1 monitor-manager: Remove 'scale' from MetaOutput
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
2017-04-07 22:30:46 +08:00
Jonas Ådahl
753e9c65a1 meta-monitor-config: Pass logical monitor scale via config
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
2017-04-07 22:30:46 +08:00
Jonas Ådahl
409c92a68f monitor-manager: Update the monitor mode state before the logical state
This means we can use up to date monitor mode data when generating the
logical state.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:46 +08:00
Shantanu Goel
3a374a6db5 frames: use correct variable in for loop assignment
update_context_styles is using the wrong variable when advancing
to the next key in the hash table which can cause an infinite
loop if # of variants is ever greater than 1.

This problem was originally reported here:

https://github.com/linuxmint/Cinnamon/issues/5254

The following patch was commited in Mint:

https://github.com/linuxmint/muffin/commit/6120bdde

This patch is just a shorter version of the Mint patch
and they deserve all the credit for the idea.

https://bugzilla.gnome.org/show_bug.cgi?id=780254
2017-04-04 20:09:23 +02:00
Jonas Ådahl
2392432780 cursor-renderer/native: Warn when we start falling back on OpenGL
When the driver unexpectedly fails setting the cursor sprite, log a
warning that we from now on will use OpenGL.
2017-03-29 11:15:17 +08:00
Jente Hidskes
0d5274b3b7 cursor-renderer-native: fallback to texture cursor
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
2017-03-29 11:15:17 +08:00
Carlos Garnacho
420311b463 backends/native: Apply per-output scales when moving across outputs
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
2017-03-27 12:57:56 +02:00
Carlos Garnacho
efae039ad9 backends: Refactor MetaScreenDirection guessing into separate function
Make it a helper MetaLogicalMonitor API, and use it on the
MetaMonitorManager.

https://bugzilla.gnome.org/show_bug.cgi?id=778119
2017-03-27 12:57:56 +02:00
Jonas Ådahl
e60dfd5b23 backends/native: Scale relative input motions with monitor scale
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
2017-03-27 12:57:56 +02:00
Armin Krezović
a77da353f3 input-settings: Set double click timeout from gsettings
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
2017-03-24 20:47:00 +01:00
Carlos Garnacho
70a4f59960 backends: Calculate output scale correctly on vertical transforms
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
2017-03-24 18:11:01 +01:00
Jonas Ådahl
ac813d5285 x11: Use EGL instead of GLX when drawing using GLES
When running as a X11 CM we shouldn't use the GLX winsys when the
driver doesn't support it, i.e. OpenGL ES drivers.

https://bugzilla.gnome.org/show_bug.cgi?id=771636
2017-03-25 00:17:18 +08:00
Jonas Ådahl
5d3e7d6ffd window: Always sync window geometry on state change
When a state changed, e.g. a window went from unfullscreen to
fullscreen, always sync the window geometry, otherwise a compositor
application (e.g. gnome-shell) might end up with an unfinished window
state transition effect.

Without always syncing, the compositor plugin will see a 'size-change'
event, as a result of the state change, but if the size didn't change,
it would never see the 'size-changed' event. If an effect, for example
gnome-shell's fullscreen effect, is triggered on 'size-change' it might
rely on the actual size change to not get stuck. This commit allows it
to have this dependency.

This fixes a bug where a fullscreen effect gets "stuck" when a window
goes fullscreen without changing the window geometry.

https://bugzilla.gnome.org/show_bug.cgi?id=780292
2017-03-23 22:12:25 +08:00
Florian Müllner
2d8eaa082f build: Include missing file 2017-03-14 03:02:45 +01:00
Carlos Garnacho
29b240e883 wayland: Use clutter_input_device_is_grouped() for tablet grouping
Instead of poking the internal libinput device.

https://bugzilla.gnome.org/show_bug.cgi?id=779986
2017-03-13 19:34:10 +01:00
Jonas Ådahl
eb3ff3f44a monitor-manager-kms: Don't try to wait for EDID on hot plug
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
2017-03-11 09:16:33 +08:00
Jonas Ådahl
db14e6099e monitor-manager-kms: Don't listen on hotplugs when paused
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
2017-03-11 09:16:33 +08:00
Jonas Ådahl
5aa02c0378 monitor-manager-kms: Improve EDID error reporting
Include the connector name in the error message, and only include the
reason in the GError message.

https://bugzilla.gnome.org/show_bug.cgi?id=779837
2017-03-11 09:16:33 +08:00
Jonas Ådahl
73b2b30a1d monitor-manager-kms: Put uevent signal management in helpers
https://bugzilla.gnome.org/show_bug.cgi?id=779837
2017-03-11 09:16:27 +08:00
Jonas Ådahl
cf6b7bcb79 backends/native: Move pause/resume handling to backend
Move the handling of pause/resume events from the launcher to the
backend.

https://bugzilla.gnome.org/show_bug.cgi?id=779837
2017-03-10 17:19:33 +08:00
Olivier Fourdan
4b86af839f xwayland: Raise the dnd window each time
If the dnd window ends up lower in the overall stack than the window
it's supposed to fence, the drop might end up in some other window
underneath the expected target window.

Maps and raises the dnd window each time it's shown so that it's always
placed above.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=779800
2017-03-09 14:09:36 +01:00
Jonas Ådahl
cdedd017d6 input-settings: Use logical monitors instead of outputs
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
a48c9d6cd9 input-settings: Don't use screen limits when keeping aspect ratio
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
1039386e10 backend/x11/nested: Enable emulating offscreen transform framebuffer
Enable the usage of an offscreen transform texture, as used in the
native backend when the GPU doesn't support the transform configured.

https://bugzilla.gnome.org/show_bug.cgi?id=779745
2017-03-09 10:17:30 +08:00
Jonas Ådahl
944339f6a5 monitor-manager: Expose whether the backend handles a transform
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
4cfcd4bce0 monitor-tiled: Derive the dimension from what was configured
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
4f386e5131 monitor-manager-dummy: Add way to emulate tiled monitors
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
3ace913aed monitor-manager-dummy: Add non-preferred mode
Add an extra mode besides the preferred one. This makes it possible to
test monitor configuration paths when running nested.

https://bugzilla.gnome.org/show_bug.cgi?id=779745
2017-03-09 10:17:30 +08:00
Jonas Ådahl
8f2daed9e0 monitor-manager-dummy: Refactor monitor generation
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
615587cd06 monitor-manager: Split logical monitor creation
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
df068a3649 monitor-tiled: Generate non-tiled monitor modes
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
7967ceee98 logical-monitor: Don't set the CRTC logical monitor if not assigned
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
979bc4390a monitor-manager-dummy: Don't set up state at the wrong time
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
2017-03-09 10:17:30 +08:00
Jonas Ådahl
e20e60783a tests: Make test backend inherit MetaBackendX11Nested
The test backend must inherit the nested backend, as MetaBackendX11 is
not complete.

https://bugzilla.gnome.org/show_bug.cgi?id=779745
2017-03-09 10:17:30 +08:00
Carlos Garnacho
38c5a1610e xwayland: Use timestamp from XdndPosition/Drop on XConvertSelection
QT apps reject DnD if the timestamp received in the SelectionRequest
event isn't the same it gave in XdndPosition/Drop client messages.
Bookkeeping and using it in XConvertSelection makes it happy again.

https://bugzilla.gnome.org/show_bug.cgi?id=779757
2017-03-08 19:18:04 +01:00