After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782785 - Introduce a new API for display configuration
Introduce a new API for display configuration
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Display
unspecified
Other All
: Normal normal
: ---
Assigned To: Debarshi Ray
Control-Center Maintainers
: 776548 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-05-18 12:41 UTC by Rui Matos
Modified: 2017-09-15 20:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
display: Introduce an abstract API for display configuration (21.47 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Provide a GnomeRR based implementation for the new api (29.84 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Port the display panel to the new abstract API (67.66 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Provide an implementation for mutter's new display config API (59.00 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Choose config manager implementation according to DBus API (6.38 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Unset primary from a turned off monitor (998 bytes, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Don't do automatic layout adjustments with the new API (2.11 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Add a slider to select a monitor's scale when available (2.89 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review
display: Handle monitor scales on the arrange displays dialog (5.65 KB, patch)
2017-05-18 12:41 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2017-05-18 12:41:03 UTC
This adds support for mutter's new GetCurrentState() and
ApplyMonitorsConfig() APIs. See
https://git.gnome.org/browse/mutter/tree/src/org.gnome.Mutter.DisplayConfig.xml
Comment 1 Rui Matos 2017-05-18 12:41:07 UTC
Created attachment 352085 [details] [review]
display: Introduce an abstract API for display configuration

This will allow us to switch the display panel away from using the
GnomeRR api directly in order to gracefully move to a new DBus display
configuration API to be provided by mutter while still keeping the
existing functionality on top of the GnomeRR api while the new one
is developed.
Comment 2 Rui Matos 2017-05-18 12:41:14 UTC
Created attachment 352086 [details] [review]
display: Provide a GnomeRR based implementation for the new api

This allows us to keep the panel working with GnomeRR while the new
mutter api develops.
Comment 3 Rui Matos 2017-05-18 12:41:20 UTC
Created attachment 352087 [details] [review]
display: Port the display panel to the new abstract API

This removes the direct dependency on GnomeRR while keeping the
existing functionality.

All the tiled monitor special casing was removed since the new API
doesn't expose tiled monitors in the first place.

A check for virtual size limits was removed but it wasn't being
enforced anyway.

We also introduce a blank error state for when the backend API isn't
available.
Comment 4 Rui Matos 2017-05-18 12:41:27 UTC
Created attachment 352088 [details] [review]
display: Provide an implementation for mutter's new display config API

This adapts as much as possible mutter's new display config API to the
current display panel's expectations. In particular we keep the
concept of logical monitors hidden from the panel. They will later be
exposed when we re-design the panel to make full use of the new API.
Comment 5 Rui Matos 2017-05-18 12:41:33 UTC
Created attachment 352089 [details] [review]
display: Choose config manager implementation according to DBus API

Use mutter's new display configuration API if it's available or
fallback to the old API via GnomeRR. The new API requires a new way to
identify outputs so we also need to use an alternative monitor labeler
API.
Comment 6 Rui Matos 2017-05-18 12:41:38 UTC
Created attachment 352090 [details] [review]
display: Unset primary from a turned off monitor

When setting the primary monitor off we were setting all other
monitors as non-primary which is clearly wrong. It only worked
correctly because the backend code in GnomeRR would implicitly
select a primary for us.
Comment 7 Rui Matos 2017-05-18 12:41:44 UTC
Created attachment 352091 [details] [review]
display: Don't do automatic layout adjustments with the new API

The new API checks with mutter every time update_apply_button() is
called and mutter is very strict about this so it already does these
adjustments internally.
Comment 8 Rui Matos 2017-05-18 12:41:50 UTC
Created attachment 352092 [details] [review]
display: Add a slider to select a monitor's scale when available

Mutter's new display configuration API allows configurable per-monitor
scales within a finite set determined by mutter. We expose the
available values in a simple slider widget for each monitor.
Comment 9 Rui Matos 2017-05-18 12:41:55 UTC
Created attachment 352093 [details] [review]
display: Handle monitor scales on the arrange displays dialog

We need to simply scale monitors' width and height where appropriate
and the API allows us.
Comment 10 Bastien Nocera 2017-05-18 14:09:32 UTC
Review of attachment 352085 [details] [review]:

I'd rather we just ported to the new API, rather than adding a new layer. Looks fine otherwise.
Comment 11 Bastien Nocera 2017-05-18 14:11:49 UTC
Review of attachment 352092 [details] [review]:

This needs ui-review. Best to file in a separate bug, with screenshots and all.
Comment 12 Rui Matos 2017-05-18 16:21:16 UTC
(In reply to Bastien Nocera from comment #11)
> Review of attachment 352092 [details] [review] [review]:
> 
> This needs ui-review. Best to file in a separate bug, with screenshots and
> all.

Well, this is temporary UI that I added basically to make use of the new API. The end result will be in the panel UI redesign. So, I'll land this as is for now.
Comment 13 Rui Matos 2017-05-18 17:00:36 UTC
Attachment 352085 [details] pushed as 918fd9a - display: Introduce an abstract API for display configuration
Attachment 352086 [details] pushed as f82bd7d - display: Provide a GnomeRR based implementation for the new api
Attachment 352087 [details] pushed as 71aef22 - display: Port the display panel to the new abstract API
Attachment 352088 [details] pushed as 8a175d1 - display: Provide an implementation for mutter's new display config API
Attachment 352089 [details] pushed as d83d613 - display: Choose config manager implementation according to DBus API
Attachment 352090 [details] pushed as e1d5885 - display: Unset primary from a turned off monitor
Attachment 352091 [details] pushed as 39c6db2 - display: Don't do automatic layout adjustments with the new API
Attachment 352092 [details] pushed as 4b30ecb - display: Add a slider to select a monitor's scale when available
Attachment 352093 [details] pushed as 8bf07fc - display: Handle monitor scales on the arrange displays dialog
Comment 14 Rui Matos 2017-05-18 17:03:00 UTC
(In reply to Bastien Nocera from comment #10)
> Review of attachment 352085 [details] [review] [review]:
> 
> I'd rather we just ported to the new API, rather than adding a new layer.
> Looks fine otherwise.

For the record, we agreed on IRC to drop the gnome-rr code when mutter starts using only the new API by default.
Comment 15 Benjamin Berg 2017-09-15 13:45:27 UTC
*** Bug 776548 has been marked as a duplicate of this bug. ***