1
0
Fork 0
Commit graph

49 commits

Author SHA1 Message Date
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
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
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
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
1ad386bc28 Introduce MetaMonitorConfigStore
MetaMonitorConfigStore provides an XML storage mechanism for
MetaMonitorConfigManager. It stores configuration files defined in the
same level as the MetaMonitorsConfig format, i.e. refers to high level
"monitors" and "monitor modes" instead of connectors and CRTCs.

Only reading custom files are implemented and so far unused.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
3f994646f2 monitor-config-manager: Handle headless setup gracefully
Handle headless setup gracefully by having no logical monitors. This
commit only makes the monitor management code deal with it; other areas
may still not be able to handle it.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
f7b6271d86 monitor-manager: Move UpClient signal listening into monitor manager
Move the UpClients notify::lid-is-closed signal handling into
MetaMonitorManager, and put the getter behind a vfunc. This means
Placing it behind a vfunc allows custom backends to implement it
differently; for example the test backend can mock the state.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
644ee666f6 Introduce new monitor configuration system
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
2017-01-25 16:28:55 +08:00
Jonas Ådahl
ee0677a021 monitor-manager: Let backend implementations handle inital config
How the initial configuration is done depends on the backend, so let
them do it themself.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
536ae8430b monitor-manager: Add API to get monitor from monitor spec
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
aaddf44d45 monitor-manager: Add API to find primary monitor
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
0c42faf34d monitor-manager: Some trivial style fixes
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
c041851fa5 monitor-manager: Rename read_current_config to read_current_state
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
2017-01-25 16:28:54 +08:00
Jonas Ådahl
b59a8b1de3 monitor-manager: Move configuration paths behind 'legacy' functions
In preparation of replacing the configuration system with one working
with high level monitors instead of low level outputs etc, move
configuarion handling code into obviously named function (containing
the word 'legacy'.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
e3b9fe7e58 monitor-manager: Use MetaMonitor to check laptop panel status
Instead of looking at the current configuration, just find the
MetaMonitor of the laptop display panel and check the currest status
directly.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
0637537355 monitor-config: Modernize type declaration
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
78799e58d2 monitor-manager: Make tiled Xrandr monitors based on monitors
Don't deal with adding/removing tiled Xrandr monitors in the generic
backend, but leave it to the Xrandr backend. The tiled monitor will
itself notify the backend when such a monitor is added and removed.

Tiled Xrandr monitors are now based no MetaMonitor instead of
MetaLogicalMonitor. This means that mirrored tiled monitors will now be
represented correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
d9a0f2a88d monitor-manager: Generate a monitor abstraction from outputs and crtcs
Generate a set of "monitors" abstracting the physical concepts. Each
monitor is built up of one or more outputs; multiple outputs being
tiled monitors. Logical monitors will later be built from these.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
4e812410cc monitor-manager: Move logical monitor into its own file
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
0873e3812b backends: Rename MetaMonitorMode to MetaCrtcMode
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
2017-01-25 16:28:53 +08:00
Jonas Ådahl
7eac28189b monitor-manager: Fix private header guard
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
1650c35e38 monitor-manager: Rename MetaCRTC(Info) to MetaCrtc(Info)
Change to follow the naming convention used everywhere else. This means
changing CRTC to Crtc even though it is an abbreviation.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
d188949101 backends/x11: Make the X11 backend derivable
Make the X11 backend derivable so that we can base a nested test backend
on it.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
bc5077f623 screen: Put xinerama monitor index outside of MetaLogicalMonitor
Put the monitor xinerama index in a separate struct that is attached to
the logical monitor using g_object_set/get_qdata(). Eventually this
should be moved to some "X11 window manager" object, but lets keep it
in MetaScreen until we have such a thing.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
6de3e4a07e Turn MetaLogicalMonitor into a GObject
This will make it easier to move various manually managed data and data
now in MetaLogicalMonitor into GObject QData fields.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
1fb0e8e9bb monitor-manager: Store logical monitors in a GList
Instead of storing the logical monitors in an array and having users
either look up them in the array given an index or iterate using
indices, put it in a GList, and use GList iterators when iterating and
alternative API where array indices were previously used.

This allows for more liberty regarding the type of the logical monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
c98bab8327 monitor-manager: Make logical monitor from point API take floats
Change meta_monitor_manager_get_logical_monitor_at() to use floats,
replace users of meta_monitor_manager_get_monitor_at_point() to use the
API that returns a logical monitor and remove the now unused function.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
a422d6fe08 Move logical monitor neighbor API into monitor manager
Move the last piece of monitor grid getter API to the monitor manager
away from MetaScreen. The public facing API are still there, but are
thin wrappers around the MetaMonitorManager API.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
af616c96d4 Move more logical monitor getters from the screen to the monitor manager
Turning a rectangle into a logical monitor also has nothing to do with
the screen (MetaScreen) so move it to MetaMonitorManager which has that
information.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
2df4ebff47 Put logical monitor grid lookup API in MetaMonitorManager
Don't falsely assume the screen has anything to do with the monitor
grid, and thus move the related API to MetaMonitorManager.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
e659b07c39 MetaMonitorManager: Add API turning monitor index into logical monitor
This is the current equivalent of looking up the logical monitor in the
logical monitor array using the number, but eventually that will be
deprecated, and before that done differently, so add a temporary helper
for the places that has not been ported yet.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
c936056663 MetaMonitorManager: Track primary monitor by pointer instead of index
Instead of keeping an index in an array to keep track of the current
primary logical monitor, just keep a pointer instead.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
e22bbd4b14 MetaScreen: Remove redundant copy of logical monitors array
It was just pointer to the actual list; having to synchronize a list of
logical monitors with the actual monitors managed by the backend is
unnecessary.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
842ff5d6aa Rename MetaMonitorInfo MetaLogicalMonitor
In preparation for further refactorizations, rename the MetaMonitorInfo
struct to MetaLogicalMonitor. Eventually, part of MetaLogicalMonitor
will be split into a MetaMonitor type.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Rui Matos
1141929bc5 backends: Add flags to MetaMonitorMode
And export them in the DBus API since they're useful for
gnome-control-center.

https://bugzilla.gnome.org/show_bug.cgi?id=763832
2016-05-13 18:44:45 +02:00
Florian Müllner
ab6c008e3e monitor-manager: Expose output_is_laptop() method
We currently duplicate the heuristics of whether an output is considered
a laptop or not. Avoid this by sharing a small helper method.

https://bugzilla.gnome.org/show_bug.cgi?id=765267
2016-04-21 17:36:22 +02:00
Rui Matos
bff75b64be monitor-manager: Expose a few helpers to clear structs
These are useful for child classes to unwind cleanly when constructing
their structures.

https://bugzilla.gnome.org/show_bug.cgi?id=756796
2015-10-30 17:47:00 +01:00
Jonas Ådahl
79c86ae890 Support scaling of cursor sprites given what output they are on
This commits refactors cursor handling code and plugs in logic so that
cursor sprites changes appearance as it moves across the screen.
Renderers are adapted to handle the necessary functionality.

The logic for changing the cursor sprite appearance is done outside of
MetaCursorSprite, and actually where depends on what type of cursor it
is. In mutter we now have two types of cursors that may have their
appearance changed:

 - Themed cursors (aka root cursors)
 - wl_surface cursors

Themed cursors are created by MetaScreen and when created, when
applicable(*), it will extend the cursor via connecting to a signal
which is emitted everytime the cursor is moved. The signal handler will
calculate the expected scale given the monitor it is on and reload the
theme in a correct size when needed.

wl_surface cursors are created when a wl_surface is assigned the
"cursor" role, i.e. when a client calls wl_pointer.set_cursor. A
cursor role object is created which is connected to the cursor object
by the position signal, and will set a correct texture scale given what
monitor the cursor is on and what scale the wl_surface's active buffer
is in. It will also push new buffers to the same to the cursor object
when new ones are committed to the surface.

This commit also makes texture loading lazy, since the renderer doesn't
calculate a rectangle when the cursor position changes.

The native backend is refactored to be triple-buffered; see the comment
in meta-cursor-renderer-native.c for further explanations.

* when we are running as a Wayland compositor

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Jonas Ådahl
4b667d1e09 Rename MetaCursorReference to MetaCursorSprite
It isn't really a reference to a MetaCursor enum, but a reference
counted cursor sprite, and enum value.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:52:30 +08:00
Jonas Ådahl
441efd17ce MetaMonitorInfo: Provide scale information
Tracking back from the monitor to the output every time we need to
figure out the scale of a window on a monitor is inconvenient, so
propagate the scale from the output to the monitor it is associated
with.

https://bugzilla.gnome.org/show_bug.cgi?id=744934
2015-07-16 11:53:40 +08:00
Cosimo Cecchi
94bce5a00f monitor-manager: add a property to discover if underscan is supported
So that clients such as the control center can decide to hide an
underscanning checkbutton when the output does not support it.

Support in the KMS / native backend to come later...
2015-07-01 18:20:57 -07:00
Dave Airlie
9f65edd4f5 backend/x11: add support for setting randr 1.5 monitors
This interface allows us to propogate back the constructed
monitors to randr using the randr 1.5 protocol. Apps
should pick it up from there.
2015-06-01 09:38:13 -07:00
Dave Airlie
ea2496c80a monitors: construct tiled monitors info
The monitors info structure is created from the tiled outputs
and this is used as the central storage for info about a monitor
as opposed to the output state.

It appears at least the EDID mm w/h is for the whole monitor and
not per tile.
2015-06-01 09:38:13 -07:00
Dave Airlie
6a77d9722a backend: add output tile info retrieval.
this just adds backend support for retrieving the tile
information from X11 (randr 1.5) and native backends.

It stores the tiling information into the output struct.
2015-06-01 09:38:13 -07:00
Jasper St. Pierre
48bf807430 monitor-manager-kms: Add support for underscan 2015-04-27 17:58:38 -07:00
Tomeu Vizoso
cc53d48fa8 MonitorManager: Add support for overscan compensation
Some DRM drivers have added a consistent set of properties that
allow compensating for the overscan that some TVs do, without the
user being able to disable.
2015-04-27 17:17:15 -07:00
Carlos Garnacho
8188cddcf7 backends: Add meta_monitor_manager_get_monitor_at_point()
This function returns the monitor_info index corresponding to the given
coordinates, or -1 if none is found at that point. The native backend
has been changed in places where it could make use of this function.

https://bugzilla.gnome.org/show_bug.cgi?id=746896
2015-03-30 14:00:31 +02:00
Jonas Ådahl
aac5a5dcaf MetaMonitorManager: Fix comment
https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-03-25 12:30:11 +08:00
Rui Matos
3f2d658f20 monitor-manager: Expose MetaMonitorManager to introspection
This just exposes the type and the singleton getter necessary to make
it available to introspection. We'll expose more functionality as it
becomes needed.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Renamed from src/backends/meta-monitor-manager.h (Browse further)