GNOME Bugzilla – Bug 782785
Introduce a new API for display configuration
Last modified: 2017-09-15 20:07:44 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Review of attachment 352092 [details] [review]: This needs ui-review. Best to file in a separate bug, with screenshots and all.
(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.
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
(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.
*** Bug 776548 has been marked as a duplicate of this bug. ***