[ffe/uife] "Match the display settings" checkbox

Bug #1294578 reported by Eleni Maria Stea
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-control-center (Ubuntu)
Invalid
High
Eleni Maria Stea

Bug Description

Here are some notes on the
https://code.launchpad.net/~hikiko/unity-control-center/u-c-c.checkbox-for-app-scaling/+merge/211681 MP:

After we introduced the HiDPI changes and the per-monitor Unity scaling factor (ui-scale gsetting) there was the following problem, discussed at UDS:

The Qt and Gnome applications would use the scaling-factor and text-scaling-factor for scaling and not our ui-scale, so their window contents would have a different size than their decorations, the menus and the launcher. Another problem was that the Gnome text-scaling-factor and scaling-factor are settings for the whole desktop whereas ui-scale is per monitor and there would be some inconsistency anyway when multiple monitors are plugged in.

So, as a quick partial solution to the problem, we promised to add a checkbox in each monitor's settings that sets the scaling-factor and text-scaling factor values in accordance with the ui-scale for that monitor when it's checked.

This way, the user will see the same size in Unity and the Gtk/Qt applications in 1 monitor if he checks the checkbox of a monitor.

To allow this, we had to introduce a new gsetting that stores the selected monitor name here: https://code.launchpad.net/~hikiko/gsettings-ubuntu-touch-schemas/gsettings-ubuntu-touch-schemas.selected-monitor/+merge/211680.

Of course this whole feature could be better designed so that the user receives more visual feedback. We discussed it with the designers team and they gave us a much better design that will be used in the future: https://wiki.ubuntu.com/BrightnessAndDisplays#Displays (credits Matthew Paul Thomas)

For the moment we will just use the checkbox to meet the deadline which is in a few days, as we promised at UDS.

-----------------------------------------
Some notes in the logic:
-----------------------------------------

First of all, here is the way we set the scaling-factor and text-scaling factor to be in accordance with the ui-scale. The idea is Marco Trevisan's and I paste his algorithm as it was in our Unity team document:

> Scaling the World…
> So, after scaling unity we should care also about the apps… There are still some troubles to get the best experience:
> Applications doesn’t care about the per-monitor scaling
> Gtk2 and Qt (using a gtk2 rendering style) apps only care about scaling factor, so there’s not much we can do with them
> Gtk3 apps support integer UI scaling only
> [...]
> When that option is true we set the gdk-interface-scaling factor to match the integer part of maximum scaling factor of the
> attached display, while we set the text-scaling-factor to a value that multiplied for the interface scaling factor will result our
> scaling factor (this will apply to both Gtk and Qt applications)
> [...]
> So, our monitor has the scaling factor of 2.25, we set:
> - scaling-factor: 2
> - text-scaling-factor: 2.25 / 2 = 1.125
(In the above example 2.25 is the ui-scale, the Unity scaling factor that is per monitor)

How the checkbox works:
-------------------------------------------

The first time the user runs the u-c-c (which is after a fresh installation) the checkbox appears to be checked in the primary monitor and we set the scaling-factor, text-scaling-factor (Gnome) to match the ui-scale (Unity), so that the user can have a good visual experience in his primary monitor. We also store the primary monitor as "selected-display" in our gsetting to remember this choice.

Every other time:
Unless if the scaling factors have been changed from a non u-c-c application (see below for this case), the checkbox appears unchecked for every monitor except of the selected that is checked. When the user selects a new monitor, u-c-c "remembers" his choice and the new selection appears checked whereas all the others are unchecked. The selected monitor is stored in the selected-display gsetting in gsettings-ubuntu-schemas.

What if the scaling factors change from outside u-c-c?
-----------------------------------------------------------------------------------------
Every time we update the checkbox status (checked or unchecked) we not only check the selected-monitor's value but the consistency of the 3 scaling factors.

In other words, if:

scaling-factor * text-scaling-factor != ui-scale +- small_ERROR for the ui-scale of the selected monitor,

and

the selected-display setting matches the selected monitor,

it means that either the text-scaling-factor or the scaling-factor have been changed by some external program or the user himself.

We should respect the user's choice, so instead of overriding it we just set the button status to unchecked and we set the selected-display gsetting to "none". If the user wasnt aware of the change he will just check the unchecked button to fix his setting, if he was he will keep his settings having some sort of visual feedback that they don't match the unity settings in the current monitor from the button status: unchecked button means mismatch between the unity (ui-scale) and the applications settings (scaling-factor, text-scaling-factor) for this monitor.

Related branches

Changed in unity-control-center:
assignee: nobody → Eleni Maria Stea (hikiko)
affects: unity-control-center → unity-control-center (Ubuntu)
summary: - "Match the display settings" checkbox
+ [ffe/uife] "Match the display settings" checkbox
Revision history for this message
Iain Lane (laney) wrote :

I think the algorithm is okay, but the rest of the solution seems overly complicated to me.

The design has a slider and a 'Match Display' button. I can't launch the MP because it crashes for me so I'm not able to tell what it looks like currently, but it seems to me like we could as an interim solution have this button only instead of a checkbox. When you click it it applies the algorithm for the selected display. Thus the automagic detection goes away and you don't even need to watch the settings.

Would that work?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the detailed description Eleni!

I see a few issues with the approch there though/I'm not sure to fully understand, so I've some comments/questions

* do you suggest having changes to the factors done for you the first time the user open the panel ? That seems like a wrong/confusing behaviour for several reasons:
- the session would look wrong until the user goes to that panel
- if things change it's not obvious why
- it's not obvious how to undo what happen

* do we really need the "by monitor" logic? that seems over complicated.

Let's say I've a docked laptop with an external monitor. The checkbox is checked for the laptop screen. I select the external one, it's display as uncheck ... but the GTK UI are scaled still, right?

What's the goal, having the scaling parameters calculated based on the geometry of one of the screens? If so wouldn't it make sense to have a checkbox "scaling on/off" and a combo "monitor to base the scaling value on"?

* how does that play with the accessibility setting for "big text" that sets the text scaling to 1.25? it seems like those settings are going to conflict

I think I would rather prefer to see a much simpler approch. Having 1 checkbox "scale UI on all monitors" and have it set the GTK scale to 2 and the text scale to an appropriate value. Even that is going to have weird interaction on the text factor between accessibility and hidpi though...

description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

@Laney: I sort of like your suggestion, the issue is that you have no way to undo the scaling then if you don't like it...

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Laney: thinking about it, I like your suggestion, but we probably would need to add a "reset/no scaling" button next to it then

Revision history for this message
Iain Lane (laney) wrote :

Yes, thanks Seb - I thought of that but forgot to write it down. 'Match selected display' and 'Do not scale' or something.

Revision history for this message
Eleni Maria Stea (hikiko) wrote :

@Sebastien, thank you,

> I see a few issues with the approch there though/I'm not sure to fully understand, so I've some comments/questions
> * do you suggest having changes to the factors done for you the first time the user open the panel ? That seems like a
> wrong/confusing behaviour for several reasons:
> - the session would look wrong until the user goes to that panel
> - if things change it's not obvious why
> - it's not obvious how to undo what happen

I agree.
Maybe I should totally remove this and set the factors by unity which is the right program to decide what the scaling values will be.

> * do we really need the "by monitor" logic? that seems over complicated.

Well that was the initial requirement...

> Let's say I've a docked laptop with an external monitor. The checkbox is checked for the laptop screen. I select the external one,
> it's display as uncheck ... but the GTK UI are scaled still, right?

right, the last values will remain stored, it's not the perfect solution, but a partial one we promised at UDS...

> What's the goal, having the scaling parameters calculated based on the geometry of one of the screens? If so wouldn't it make
> sense to have a checkbox "scaling on/off" and a combo "monitor to base the scaling value on"?

Probably yes, that's why we discussed that with the designers team, the problem is that we promised to add a checkbox in like 2 days that remain before the release :) so, we decided to add it, and improve the design later...

> * how does that play with the accessibility setting for "big text" that sets the text scaling to 1.25? it seems like those settings
> are going to conflict

That's also true. The only thing we can do for the moment is to show the button unchecked when there's a mismatch until we have a better widget/design solution... (unfortunately not by this friday...)

> I think I would rather prefer to see a much simpler approch. Having 1 checkbox "scale UI on all monitors" and have it set the GTK
> scale to 2 and the text scale to an appropriate value.

Sorry, I got confused by that... What will be different in the new checkbox except of the label? it will always set the scaling-factor to 2? (scales allways up? or it's an example?)

Revision history for this message
Eleni Maria Stea (hikiko) wrote :

For the revert: I agree it's not very good that the user can't revert his choice but I think that for the moment the fact that the user can check a monitor and reset the Gnome scaling factors according to Unity is fine. I mean, we could improve it later, for the next release and do a better planning and design..

Changed in unity-control-center (Ubuntu):
importance: Undecided → High
Changed in unity-control-center (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.