1
0
Fork 0
Commit graph

6442 commits

Author SHA1 Message Date
Jonas Ådahl
5f2bb43061 backend/native: Don't double-scale pointer motions on scaled monitors
We manually scaled pointer motions when they travel over a scaled
monitor. When a stage view of a monitor is also scaled, in practice this
meant we scaled twice. Avoid this by only manually scaling the pointer
motion when stage views are not scaled.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Marco Trevisan (Treviño)
3e8d0204bd monitor: Dynamically calculate supported scales per resolution
When using logical sized monitors we are allowed to use fractional scaling
but only if the resulting scaled logical monitor size is in integer form.
So, in order to get this, we allow to scale the monitor to up to
8 fractional values per integer, doing some computation in order to
fetch the nearest values which are closer to the scaling factors we can
permit.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Jonas Ådahl
b2a530b326 DisplayConfig: Make supported scales per mode
This changes the API to pass supported scales per mode instead of
providing a global list. This allows for more flexible scaling
scenarious, where a scale compatible with one mode can still be made
available even though another mode is incompatible.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Jonas Ådahl
5ab116a87f tests: Add tests for fractional scaling
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Jonas Ådahl
10b0351a59 Add support for rudimentary fractional scaling
When the logical layout mode is used, allow configuring the scaling to
be non-integer. Supported scales are so far hard coded to include at
most 1, 1.5 and 2, and scales that doesn't result in non-fractional
logical monitor sizes are discarded.

Wayland outputs are set to have scale ceil(actual_scale) meaning well
behaving Wayland clients will provide buffers with buffer scale 2, thus
being scaled down to the fractional scale.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Jonas Ådahl
b64c69e4bc logical-monitor: Make scale a float
To support fractional scaling, the logical monitor scale must be stored
as a float. No other functional changes is part of this commit.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Jonas Ådahl
c2e49f1bb5 clutter: Change stage view scale to be float
To support fractional scaling, change the stage view scale to be a
float instead of an int. Also change the places where it is retrieved
and used when scaling things.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Jonas Ådahl
88cae8bd3d settings: Manage our own font DPI
Previously gnome-shell listened on the Xft Xsettings via GTK+s
GtkSettings to get the font DPI setting. The Xsetting might not
be what we want, and we should not rely on Xsettings when we don't need
to, so lets manage it ourself.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2017-07-14 20:54:26 +08:00
Carlos Garnacho
a6ec2b1d42 backends: Set error when opening /sys file fails
The caller in clutter really expects an error if fd==-1, so make
sure we set one here. Otherwise we get a nice crash in addition to
the failure to open the /sys file. Also, retry on EINTR.

https://bugzilla.gnome.org/show_bug.cgi?id=784881
2017-07-14 12:28:32 +02:00
Jason Gerecke
ca600973ba wayland: Store and retrieve implicit grab information for tablet tools
Window moving and resizing depends on the `meta_wayland_seat_get_grab_info`
function succeeding. At the moment, tablet tools do not generate implicit
grabs like the pointer and touch. This commit adds the necessary elements
to track implicit grabs and retrieve their information.

https://bugzilla.gnome.org/show_bug.cgi?id=777333
2017-07-13 19:10:52 +02:00
Carlos Garnacho
4b8dd51c4d backends: Fix dangling callback not being disconnected
This fixes possible crashes if configuration is changed on a device that
was added and then removed.

https://bugzilla.gnome.org/show_bug.cgi?id=784881
2017-07-13 19:05:44 +02:00
Carlos Garnacho
10b30eaba5 backend: Set mapping-mode on X11 pen/eraser devices
And use it in the generic code for the checks about whether mapping to
an specific display applies or not.

https://bugzilla.gnome.org/show_bug.cgi?id=784402
2017-07-12 23:43:23 +02:00
Jonas Ådahl
7bd69f0b32 window: Don't crash when moving across non-adjecent logical monitors
When moving a window between two non-adjecent logical monitors, don't
try to tile a window when the window position is outside of any logical
monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=783630
2017-07-12 12:30:54 +08:00
Jonas Ådahl
538e402d71 wayland: Random whitespace fixes
https://bugzilla.gnome.org/show_bug.cgi?id=784080
2017-07-12 12:08:57 +08:00
Jonas Ådahl
9af6ec78ab wayland: Add support for wl_surface.damage_buffer
Implements support for the wl_surface.damage_buffer request, which
damages the buffer using buffer coordinate space.

https://bugzilla.gnome.org/show_bug.cgi?id=784080
2017-07-12 12:08:57 +08:00
Jonas Ådahl
1303c626b1 renderer-native: Fix compilation when EGLDevice renderer not enabled
When --enable-egl-device is not passed to ./configure, the
egl_device_error will not be declared; don't try to free it when its not
declared.
2017-07-07 17:59:20 +08:00
Miguel A. Vico
7eea82d3d7 MetaRendererNative: Give EGLDevice backend priority over GBM
With GLVND, whenever we have both Mesa's and NVIDIA's drives installed
in the system, initializing the GBM backend will always succeed,
regardless of what GPU you have on your system.

This is due to GBM's software rendering fallback.

It seems better to initialize the EGLDevice backend first, which will
fail to find a device match when given a non-NVIDIA GPU.

https://bugzilla.gnome.org/show_bug.cgi?id=784272
2017-07-07 11:55:18 +08:00
Florian Müllner
80e5955918 screen: Remove stray assert
When the number of (static) workspaces decreases, we relocate windows
from extra workspaces before removing them. As removing a non-empty
workspace is not allowed, we assert that it doesn't contain any windows
before removing it.

However that assert is

 - pointless, because meta_workspace_remove() already asserts that
   the workspace is empty

 - wrong, because even empty workspaces contain windows that are set
   to show on all workspaces

Simply drop the assert to avoid a crash when trying to remove a workspace
while on-all-workspaces windows are present.

https://bugzilla.gnome.org/show_bug.cgi?id=784223
2017-07-05 16:31:18 +02:00
Carlos Garnacho
ce989976fa backends: Apply tablet settings on all tablet device types during startup
This skipped the device types that are in use on X11.

https://bugzilla.gnome.org/show_bug.cgi?id=782027
2017-07-03 13:57:35 +02:00
Carlos Garnacho
529e5adb2e wayland: Base tablet tool coordinates on the current event
Instead of the last device position. This was copied a little bit too
straight from MetaWaylandPointer.

https://bugzilla.gnome.org/show_bug.cgi?id=783535
2017-07-03 13:56:21 +02:00
Jason Gerecke
74882b2502 backends/x11: Account for non-zero device origin when setting tablet area
Wacom's display tablets typically do not have (0,0) coincident with the top
left corner of the screen. This "outbound" area must be taken into account
when setting the area or else an unexpected offset of the pointer will
occur.

https://bugzilla.gnome.org/show_bug.cgi?id=784009
2017-07-03 13:49:14 +02:00
Florian Müllner
5f49bda591 window: Include window itself in transient loop check
While it doesn't make sense to set a window as transient to
itself, our existing check whether making a window transient
doesn't cover it, so it's still possible to create an infinite
loop.

https://bugzilla.gnome.org/show_bug.cgi?id=783502
2017-06-22 08:49:40 +02:00
Silvère Latchurié
8153c5b544 compositor: Handle EXIF orientation for backgrounds
Apply the embedded EXIF orientation when the background is loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=783125
2017-06-21 20:23:09 +02:00
Jason Gerecke
a4cef8586c backends/native: Interpret tablet padding as being input-centric
It is possible to interpret the ammount of padding provided to the
*_set_tablet_area functions in two different and incompatible ways. The X11
backend effectively treats them as being input-centric (i.e., the padding
defines the size of the "dead zone" on the tablet) while the native backend
has an output-centric viewpoint (i.e., the padding defines the size of the
"dead zone" on the display) viewpoint. This difference in opinion causes the
cursor offset to change when switching between Xorg and a Wayland sessions.

The calibration utility within g-c-c does its calculations with an input-
centric viewpoint, so this patch modifies the native backend to work
correctly with these values. To change viewpoints, we can simply invert
the scale and negate the offset. It should be noted that this function
also forgot to apply scaling to the offsets (as required by the matrix
transform done by libinput) which would have further compounded the
cursor offset issue under Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=784009
2017-06-20 23:42:38 +02:00
Carlos Garnacho
9b9bb9cf86 backends: Fix output cycling in non display-attached tablets
It would only allow to alternate between the logical monitors, we actually
want to return NULL here so it can cycle to the whole span of monitors.

https://bugzilla.gnome.org/show_bug.cgi?id=782032
2017-06-20 22:02:04 +02:00
Carlos Garnacho
dc5b2e396c backends: Fix typo
Instead of checking all MetaMonitors in the monitor manager, we want to
look (as the function name says) in the MetaMonitors contained in the
given logical monitor.

Otherwise, it will return TRUE for every logical monitor, given we are
querying for an existing EDID.

https://bugzilla.gnome.org/show_bug.cgi?id=782032
2017-06-20 22:02:04 +02:00
Carlos Garnacho
d23275bc76 backends/x11: Handle left-handed mode on pen/eraser devices correctly
Due to the pen/eraser device separation in X11, CLUTTER_TABLET_DEVICE does
not apply there, this device type is only used in native/evdev. Checking
for CLUTTER_PEN/ERASER_DEVICE makes the left-handed mode correctly applied
on tablets.

https://bugzilla.gnome.org/show_bug.cgi?id=782027
2017-06-20 22:02:04 +02:00
Carlos Garnacho
48e820235e backends/x11: Fix c&p issue in tablet area calculation
instead of filling in the last array value, it overwrote the previous one.

https://bugzilla.gnome.org/show_bug.cgi?id=781703
2017-06-20 22:02:04 +02:00
Benoit Gschwind
e1950ed76f texture-tower: Fix usage of G_*_DECLS
https://bugzilla.gnome.org/show_bug.cgi?id=783505
2017-06-14 11:15:04 +02:00
Christian Kellner
7938f41c11 monitor: invert logic for 4k TV scaling
For devices connected via HDMI (supposedly TVs) we want have a
scale factor of 1 if we are *below* the smallest 4k resolution
width (not equal or above) and do the scaling factor computation
if we are above the limit. This check was apparently wrongly
ported from gnome-settings-daemon.

Based of a patch by Caolan McNamara <caolanm@redhat.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=777347
2017-06-07 14:03:03 +02:00
mitchmindtree
8457e2bad6 wayland/pointer: Check for subsurfaces when grabbing
Previously, the function only returned `TRUE` if the given surface was
equal to the given pointer's focused surface. This changes the behaviour
to also return `TRUE` if any of the given surface's subsurfaces are
equal to the pointer's focused surface.

https://bugzilla.gnome.org/show_bug.cgi?id=781811.
2017-06-07 09:47:29 +08:00
Florian Müllner
4d7329a7e2 window: Include STATE_CHANGED flag when tiling
For size change animations, plugins rely on the size change effect being
followed by size changed signal (or effects being kill altogether).
However unless the move_resize operation included the STATE_CHANGED flag,
the size changed event emitted when the compositor syncs the window
geometry only happens when the operation resulted in an actual change.

To avoid animations getting stuck in that case, make sure to include the
flag when tiling a window.

https://bugzilla.gnome.org/show_bug.cgi?id=783293
2017-06-06 15:35:06 +02:00
Jonas Ådahl
b4120a75e0 wayland/pointer: Track lifetime of current surface
Clear the pointer->current when the surface is destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=783113
2017-06-01 12:46:32 +08:00
Jonas Ådahl
b19e4592df wayland/pointer: Use glib signals tracking focus surface
Use the "destroy" MetaWaylandSurface signal instead of the wl_resource
destroy signal for tracking the lifetime of the surface with pointer
focus.

As unsetting the focus may have side effects due to handlers of the
"focus-surface-changed" signal, connect the signal after the default
handler to make sure other clean up facilities have the chance deal with
the surface destruction before we try to unset the focus.

https://bugzilla.gnome.org/show_bug.cgi?id=783113
2017-06-01 12:46:32 +08:00
Ikey Doherty
e9c9ee844c backends/x11: Ensure reply is initialised to NULL 2017-05-31 19:15:39 -04:00
Bastien Nocera
f5f0ff0a2f monitor-manager: Fix crash when UPower is not available
Don't access the upower client if it doesn't exist

https://bugzilla.gnome.org/show_bug.cgi?id=780407
2017-05-31 16:11:24 +02:00
Christian Kellner
68dacb531b keybindings: handle multiple keycodes for keysym
A single keysym can resolve to multiple keycodes. Instead of only using
the first one and ignoring the others, we store all codes in
MetaResolvedKeyCombo and then handle all of them in keybinding
resolution. If we already have bound a keycode for a keybinding with a
specific keysym then this can get overwritten by a new keybinding with a
different keysym that resolves to the same keycode. Now that we resolve
and bind all keycodes for a keysym this might happen more often; in that
case warn but still overwrite, but only for the first keycode for each
keysym. If a secondary (i.e. all non-first keycodes) is already indexed
we just ignore that; this should resemble the old behavior  where we
only took the first keycode for any keysym as close as possible.

https://bugzilla.gnome.org/show_bug.cgi?id=781223
2017-05-30 15:23:00 +02:00
Jonas Ådahl
82325cbcfd monitor: Don't get the monitor manager from the backend
We will both create and destroy monitors during initialization (when
using the X11 backend), so don't try to access the monitor manager from
the backend, but store a pointer to it instead.

It's stored in MetaMonitor even though only MetaMonitorTiled uses it,
mostly because it makes more sense to store such a pointer there.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
fb5ebffb8d tests/monitor-unit-tests: Check handling of odd tiled monitors
Add tests for handling tiled monitors where the origin tile output is
not the main output.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
94d843b80e tests/monitor-unit-tests: Check meta_monitor_is_active()
https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
c32e2d17d9 monitor: Handle tiled monitors where (0, 0) is not the main output
In some circumstances, the origin tile (0, 0) is not the one that
should be used to drive the monitor when using a non-tiled mode. Update
MetaMonitorTiled to support this case. It also seems to be so that the
preferred mode might be some low resolution or bogus mode on these
monitors, so also adapt MetaMonitorTiled to manage to ignore the
preferred mode of a tiled monitor if the preferred mode doesn't use
both tiles.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
2b05748d5c monitor: Move get_suggested() behind behind vfunc
Only support suggested monitor positioning if the monitor is non-tiled.
Normally this functionality is used by virtual machines to provide a
hint of how to place the virtual monitors, and they don't tend to use
tiled monitors anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
cd775929bf monitor: Move tiled CRTC mode identification into helper
It'll be used in more places later.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
7303a78b06 monitor: Generate spec struct earlier
By generating the spec struct earlier, code executed later can use the
fields in the spec.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
07b8cc0773 monitor: Fix naming of spec generation function
It was at one point referred to as 'id', but was changed to 'spec', but
the name of this function was not updated.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
2017-05-26 14:32:43 +08:00
Jonas Ådahl
1bb0e18042 monitor-manager/xrandr: Allow configuring scales on X11 too
This commit makes it possible to configure logical monitor scale also
when running on top of an X11 server using Xrandr. An extra property
'requires-globla-scale' is added to the D-Bus API is added to instruct
a configuration application to only allow setting a global logical
monitor scale.

This is needed to let gsd-xsettings use the configured state to set a
XSettings state that respects the explicit monitor configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 14:31:48 +08:00
Jonas Ådahl
3b097c7e77 monitor-manager/kms: Move scale calculation to MetaMonitor
The scale calculation doesn't really have anything to do with KMS, and
eventually we'll want to have mutter calculate the monitor scale for
non-KMS backends too, so move the scale calculation to MetaMonitor.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 14:31:48 +08:00
Jonas Ådahl
0bc312a54b monitor-manager/kms: Move global ui scaling setting to MetaSettings
It'll be used elsewhere, so shouldn't be in MetaMonitorManagerKms.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 14:31:48 +08:00
Jonas Ådahl
2718699ccc backend: Move settings into a new MetaSettings object
Introduce MetaSettings and add the settings managed by MetaBackend into
the new object. These settings include: experimental-features and UI
scaling factor.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 14:31:48 +08:00
Jonas Ådahl
be175558c3 backend: Make X11 display opened function explicitly named
It didn't say anything about being the X11 display, so make it say so.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 14:31:48 +08:00
Jonas Ådahl
df39a7d0fd monitor-manager/xrandr: Use xcb API to configure CRTC
Use xcb-randr instead of libXrandr to set the CRTC configuration. This
is needed because data from the reply will later be used.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 14:31:48 +08:00
Jonas Ådahl
43cdf81f6b backend: Make the getter use the cached ui scale
The cached ui scale is kept up to date, so don't recalculate it
everytime meta_backend_get_ui_scaling() is called.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-05-26 14:31:48 +08:00
Marco Trevisan (Treviño)
183f4b0c13 MetaMonitorManager: ignore hotplug_mode_update at startup
hotplug_mode_update is used (mostly by VMs nowadays, and
VMware has implemented it) to inform that modes list (including
the preferred one) might change after an uevent.

However, when using MetaMonitorConfigManager we should
ignore this value at initialization level, or mutter
won't restore the configured values at startup.

https://bugzilla.gnome.org/show_bug.cgi?id=783073
2017-05-25 16:50:29 +08:00
Alessandro Bono
270da95cbc window: Notify about size-change when tiling
Call meta_compositor_size_change_window while tiling in order
to emit the size-change signal. Since the untiling action is
considered a unmaximize size change, treat tiling as a maximize
size change for consistency.

https://bugzilla.gnome.org/show_bug.cgi?id=782968
2017-05-24 09:51:29 +02:00
Evan Welsh
76198e0b3b Implements disable-while-typing in mutter.
Disable-while-typing disables the touchpad while the user is typing.

This patch introduces the necessary backend code to implement the
org.gnome.desktop.peripherals.touchpad.disable-while-typing setting of
gsettings-desktop-schemas which was implemented in commit
4c5b1c1df399d6afaaccb237e299ccd1d5d29ddd and released as part of 3.24.
This is known as dwt in libinput.

This patch has been tested on X11 and Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=764852
2017-05-24 11:56:54 +08:00
Jonas Ådahl
efc190789f backend: Couple of whitespace fixes
https://bugzilla.gnome.org/show_bug.cgi?id=782152
2017-05-24 11:18:56 +08:00
Jonas Ådahl
81e99c2680 input-settings: Minor structural cleanup
Let the backend implementations create their own input settings
backend, as is done with other backend specific special purpose
backends. Also use the macro for declaring the GType.

https://bugzilla.gnome.org/show_bug.cgi?id=782152
2017-05-24 11:18:56 +08:00
Jonas Ådahl
755755a2f3 backend: Move out some code from post_init()
meta_backend_real_post_init() had some open coded initialization with
some unexpected interdependencies. Split these up and move them to their
own functions in order to make meta_backend_real_post_init() a bit more
readable.

https://bugzilla.gnome.org/show_bug.cgi?id=782152
2017-05-24 11:17:46 +08:00
Carlos Garnacho
498200776c wayland: Ensure we repick the pointer on synthesized crossing events
Relayouts in clutter may trigger synthesized crossing events if the
actor below the pointer changes. In that situation we do need to
repick() the MetaWaylandPointer to end up with the right current
wayland surface.

https://bugzilla.gnome.org/show_bug.cgi?id=755164
2017-05-22 17:45:17 +02:00
Carlos Garnacho
27b949d6ba compositor: Remove MetaSurfaceActorWayland::painting signal
It's now unused.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-22 17:27:11 +02:00
Carlos Garnacho
27ea62a79d wayland: Use notify::allocation to update pointer as per confinements
There is no need to constraint the pointer to the confinement on each redraw
if the surface actor didn't move/resize.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-22 17:27:11 +02:00
Carlos Garnacho
cf1edff9ed wayland: Use notify::allocation notification to update surface outputs
Instead of updating the surface outputs on each actor ::paint.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-22 17:27:11 +02:00
Jonas Ådahl
05d15f8885 window/wayland: Don't try to resize window on tear down
When terminating mutter running as a display server, don't try to resize
maximized windows when unmanaging, as at this point, they will have no
MetaWaylandSurface. Originally this was done instead of setting the
net_wm_state to not mess with future window managers, but when we're a
Wayland compositor, this does not matter.

https://bugzilla.gnome.org/show_bug.cgi?id=782156
2017-05-22 21:17:39 +08:00
Olivier Fourdan
561d71b8ae wayland: place window if maximized before placement
If a client changes the state of a surface to issue a set_maximize, this
causes apply_pending_state() to be called before mutter has placed the
window.

If the monitor on which the window is to be shown initially is different
from the one where the pointer is placed, this causes the effect to be
played at the wrong location before the window eventually reaches its
location on another monitor.

Force the window to be placed prior to change its state to maximized in
xdg-shell so that mutter won't relocate the window afterwards.

This also avoids sending an xdg_toplevel.configure with a size of 0x0
which would cause the client to initially draw its surface with some
arbitrary size.

https://bugzilla.gnome.org/show_bug.cgi?id=782183
https://bugzilla.gnome.org/show_bug.cgi?id=781353
2017-05-22 09:22:11 +02:00
Carlos Garnacho
fe5138dfc4 core: Replace close dialog implementation with MetaCloseDialog
src/core/delete.c now entirely relies on MetaCloseDialog in order
to handle the "Application is not responding" dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=711619
2017-05-15 15:09:15 +02:00
Carlos Garnacho
68a9675d42 compositor: Expose MetaPlugin vmethod to create a MetaCloseDialog
So the actual close dialog can be overridden by MetaPlugin implementations.

https://bugzilla.gnome.org/show_bug.cgi?id=711619
2017-05-15 15:09:15 +02:00
Carlos Garnacho
020e0bb2ac core: Implement MetaCloseDialogDefault
This is basically a copy of the implementation currently residing
in src/core/delete.c, which will be eventually deleted in favor
of this one.

https://bugzilla.gnome.org/show_bug.cgi?id=711619
2017-05-15 15:09:15 +02:00
Carlos Garnacho
b47de58edd core: Add MetaCloseDialog
This is an interface that can be used to implement the "application
is not responding" dialog. One instance is created per window, which
is initially hidden, and can be shown/hidden on demand.

https://bugzilla.gnome.org/show_bug.cgi?id=711619
2017-05-15 15:09:15 +02:00
Chris Vine
2f30098ab5 build: Fix non-wayland builds
Add the necessary preprocessor guards that were missed in commits
65e9c89ed9 and 6d64123849 ...

https://bugzilla.gnome.org/show_bug.cgi?id=780533
2017-05-11 13:45:44 +02:00
Carlos Garnacho
5758401443 xwayland: Use the right atom type for further selection requests to X11
If we translate between text/plain;charset-utf-8 from the wayland side to
UTF8_STRING on the X11 side, we want to continue all further X11 selection
requests using the same translated UTF8_STRING atom than we use in the
first XConvertSelection call.

https://bugzilla.gnome.org/show_bug.cgi?id=782472
2017-05-10 21:00:37 +02:00
Olivier Fourdan
f241bdba93 wayland: Apply size hints regardless of geometry
Previously we would bail out early in xdg_toplevel_role_commit() if no
geometry change was set, ignoring the possible min/max size hints
changes.

But setting a min/max size hint without changing the geometry is
perfectly valid, so we ought to apply the min/max changes regardless of
a geometry change.

https://bugzilla.gnome.org/show_bug.cgi?id=782213
2017-05-10 10:44:42 +02:00
Olivier Fourdan
410d66ca37 wayland: Make sure we have a pending geometry
If the client doesn't set a geometry using xdg_shell, we'll compute its
geometry based on its surface and subsurfaces.

Yet, we translate that as a window (re)size only when there is a pending
geometry, that we don't have when we computed the geometry by ourself.

Make sure we set the pending new geometry flag when computing the
geometry when it actually changed.

https://bugzilla.gnome.org/show_bug.cgi?id=782213
2017-05-10 10:44:37 +02:00
Carlos Garnacho
f2309cdb55 backends: Store MUTTER_STAGE_VIEWS envvar content just once
No need to poke this regularly while drawing the stage.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-09 11:53:46 +02:00
Carlos Garnacho
d6d01c85a6 wayland: Collect frame completion time once for all surfaces
Dispatch all surface frames with the same monotonic time to avoid
querying it too often.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-09 11:53:14 +02:00
Carlos Garnacho
d0bfb94ff0 backends/native: Avoid generic closure marshaler for page flip handling
This turns out more expensive than necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-09 11:52:57 +02:00
Florian Müllner
891cab3bb3 window-props: Fix frame update on hide-titlebar-when-maximized changes
Since we started caching frame borders in commit b4036e061, we need to
invalidate the cache for changes of the GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED
property to take effect immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=781862
2017-04-27 23:04:08 +02:00
Jonas Ådahl
704bd4c331 wayland/subsurface: Handle clients committing on destroyed subsurface
A client can still commit state to a destroyed subsurface. It wont
update anything on the screen, since the subsurface will not be
visible, but mutter should still handle it and not crash.

https://bugzilla.gnome.org/show_bug.cgi?id=781391
2017-04-21 17:46:17 +08:00
Jonas Ådahl
0608ae2d4e monitor-config-store: Replace key when replacing config
g_hash_table_insert() doesn't replace the key. This was a problem
because the key was owned by the value inserted into the hash table, so
when a value was removed, the key was freed, meaning that the key in
the hash table was no pointing to freed memory. Fix this by using
g_hash_table_replace() instead, which work the same except that it
replaces the key with the one passed. This means that the key of a
value in the hash table is always the key owned by the value.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-17 13:26:40 +08:00
Jonas Ådahl
3f107da479 monitor-config-manager: Handle comparing different sized config keys
The guard for handling size differences between keys were broken, it
only checked if the key passed by the second argument ended up being
shorter.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-17 13:26:40 +08:00
Rui Matos
612432ac3e monitor-manager: Fix format-security gcc warnings 2017-04-12 16:53:30 +02:00
Jonas Ådahl
c214eb15bf monitor-manager: Check active monitors when looking for logical monitor
An inactive monitor will not be assigned to a logical monitor, so don't
try to match against those. This avoids a dereferencing a NULL when the
main output of an inactive monitor doesn't have an assigned CRTC.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 23:53:51 +08:00
Jonas Ådahl
e6eac46629 backend: Get the UI scaling factor from the logical monitors
Instead of looking at the GTK+ settings, check the logical monitor
state and determine the UI scaling factor given the maximum logical
monitor scale. This is only enabled when the monitor config manager
feature is enabled, as only then can a scale be explicitly configured.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:51 +08:00
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