Commit graph

119 commits

Author SHA1 Message Date
Rui Matos
46c2d43e62 display: Replace modal dialogs with popovers
The existing modal dialogs are cumbersome to use so let's replace them
with popovers that dismiss themselves automatically when an item is
activated.

https://bugzilla.gnome.org/show_bug.cgi?id=786726
2017-11-10 17:34:57 +01:00
Rui Matos
23d5ea29aa display: Round the displayed scale values logically
Mutter currently generates 4 scales per integer scale. Knowing that,
we can nicely "round" the values we display to what the ideal scales
are even though the real values might be skewed since mutter creates
scale values close to the ideal ones that yield integer logical sizes.

https://bugzilla.gnome.org/show_bug.cgi?id=786922
2017-08-28 18:58:05 +02:00
Rui Matos
bbccf27488 display: Simplify scale filtering
This is prone to miss intermediate values that users might actually
want to use so, for now, just show the 5 first scales.
2017-08-28 18:58:05 +02:00
Rui Matos
7ed4efef50 display: Show refresh rates with two digits after the radix
One digit isn't enough to distinguish between some modes. We probably
should do better mode filtering and/or grouping but that needs to
happen in mutter.
2017-08-25 16:49:02 +02:00
Rui Matos
6a9274a165 display: Don't show inactive monitors in the arrangement widget
Inactive monitors are not part of the configuration global geometry,
i.e. they don't have a position set, so it doesn't make sense to show
them.
2017-08-25 16:49:02 +02:00
Rui Matos
dae238cc5f display: Avoid crashing when a monitor doesn't have a mode set
In this case just avoid showing information we don't have.
2017-08-25 16:49:02 +02:00
Rui Matos
337802315c display: Ensure we generate the UI initially on two output mode
We rely on visible-child-name notifications to generate the
appropriate UI, unfortunately it doesn't happen for the first added
stack page if the widget is already visible. Work around this by
adding a dummy page first.
2017-08-25 16:49:02 +02:00
Rui Matos
6c4eb9fc86 display: Fix the two output UI to start with the current configuration
gtk_stack_set_visible_child_name() doesn't actually make a child
visible if the child widget isn't visible already which means we'd
always start in the first ("join") stack page even if the currently
applied configuration is one of the others.

https://bugzilla.gnome.org/show_bug.cgi?id=786767
2017-08-25 15:17:12 +02:00
Rui Matos
57a82a89cd display: Cancel pending changes on Escape key press 2017-08-23 18:32:28 +02:00
Rui Matos
566d2cf6ac display: Add mnemonics to Cancel and Apply buttons 2017-08-23 18:32:28 +02:00
Rui Matos
a8071322a7 display: Move scale row above refresh rate
It's a bit closer to the mockups, in spirit at least.
2017-08-23 18:32:28 +02:00
Rui Matos
566b0c137c display: Make rows created for a new current output be the same size
We need the rows size group to exist when creating output UIs.
2017-08-23 18:32:27 +02:00
Rui Matos
0a0ac31b51 display: Handle lid being closed a bit better
If the lid is closed we shouldn't allow the builtin display to be
configured.
2017-08-23 18:32:27 +02:00
Rui Matos
088f35617c display: Make scale row be the same height as others 2017-08-23 18:32:27 +02:00
Rui Matos
e5a1afee9c display: Fix a crash when opening the panel with the lid closed
The configuration manager might not be ready yet when we're called
from the lid state monitor handler. Don't do anything in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=786080
2017-08-22 19:26:39 +02:00
Rui Matos
ef0cbf45f3 display: Make arrangement and scale rows non-activatable 2017-08-22 19:21:41 +02:00
Rui Matos
47919bcfb1 display: Fix underscanning switch [de]activating the output instead 2017-08-22 19:21:41 +02:00
Rui Matos
7c7c0b75d5 display: Switch to a toggle buttons design for scale
The slider design wasn't fit for this since we allow only a finite set
of scales.
2017-08-22 19:21:41 +02:00
Rui Matos
c50062a48b display: Update the two display mode switcher design
This makes us follow the updated design mockups more closely.
2017-08-22 19:21:41 +02:00
Rui Matos
90cf23a70a display: Redraw the arrangement area widget when outputs change
This ensures the arrangement area always reflects the current
changes.
2017-08-22 19:21:41 +02:00
Rui Matos
52d61d52b2 display: Force content to always have a fixed minimum width
This makes switching between configurations and/or active monitor look
a bit more polished.
2017-08-21 14:47:17 +02:00
Rui Matos
93a3bbe0fc display: Remove a few no longer needed variables
These are not needed since last commit.
2017-08-21 14:47:17 +02:00
Jonas Ådahl
ff30244c5c panels/display: Remove support for old config system
As mutter now has removed the legacy monitor config system and the
associated property on org.gnome.Mutter.DisplayConfig, also remove the
support from gnome-control-center.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-08-21 12:33:38 +08:00
Rui Matos
c0f686bb0f display: Re-design the panel
This implements most of the new Display panel re-design by Allan
Day.

Left out for now is brightness setting which still is in the
Power panel because the plumbing layers don't yet associate backlights
with outputs.

Also left out is the presentation mode and trimming of options due to
hardware constraints since we don't have a mutter implementation for
those yet.

https://bugzilla.gnome.org/show_bug.cgi?id=785949
2017-08-09 19:27:08 +02:00
Rui Matos
9b0cf3391c display: Refactor night light widget instantiation
We'll need multiple instances of this widget in the new panel
design. This makes it possible.

https://bugzilla.gnome.org/show_bug.cgi?id=785949
2017-08-09 19:27:08 +02:00
Marco Trevisan (Treviño)
cca9663d87 display: Adapt to new Mutter interface with scaling per mode
New Mutter GetCurrentState now provides a list of available scales, we
need to use these values in order to define an UI that shows them all.
2017-07-14 18:32:54 +02:00
Rui Matos
8bf07fc414 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.

https://bugzilla.gnome.org/show_bug.cgi?id=782785
2017-05-18 18:57:26 +02:00
Rui Matos
4b30ecb758 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.

https://bugzilla.gnome.org/show_bug.cgi?id=782785
2017-05-18 18:57:26 +02:00
Rui Matos
39c6db2772 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.

https://bugzilla.gnome.org/show_bug.cgi?id=782785
2017-05-18 18:57:26 +02:00
Rui Matos
e1d5885ad4 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.

https://bugzilla.gnome.org/show_bug.cgi?id=782785
2017-05-18 18:57:26 +02:00
Rui Matos
d83d613103 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.

https://bugzilla.gnome.org/show_bug.cgi?id=782785
2017-05-18 18:57:26 +02:00
Rui Matos
71aef22ae0 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.

https://bugzilla.gnome.org/show_bug.cgi?id=782785
2017-05-18 18:57:26 +02:00
Richard Hughes
9725efd3e4 display: Tweak night light dialog UI to match latest mockups 2017-02-16 19:56:51 +00:00
Richard Hughes
fdbd788b96 display: Rename 'Natural Light Filter' to 'Night Light' 2017-02-10 16:32:24 +00:00
Richard Hughes
ef4dfe8896 display: Add natural light UI to the display panel
https://bugzilla.gnome.org/show_bug.cgi?id=778326
2017-02-10 09:07:24 +00:00
Rui Matos
ae113c1522 display: Ensure the preselected resolution matches the current mode
We need to check the interlaced flag too when preselecting the current
resolution in the combo box since we now have separate entries for
interlaced and regular resolutions of the same size.

https://bugzilla.gnome.org/show_bug.cgi?id=772708
2016-10-10 18:16:22 +02:00
Piotr Drąg
a3ec58345e display: use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772199
2016-10-03 15:20:42 +02:00
Bastien Nocera
8da6fa28e1 display: Fix possible crash on startup
If no items are added to the GVariantBuilder, g_variant_builder_close()
would throw a critical, g_variant_builder_end() would throw a
segmentation fault.

As this can only happen when there are no items added to the output_ids
hashtable, this should only happen if there are no displays known to
libgnome-desktop (and therefore mutter).

See https://bugzilla.redhat.com/show_bug.cgi?id=1280075

https://bugzilla.gnome.org/show_bug.cgi?id=771875
2016-09-24 02:46:38 +02:00
Cosimo Cecchi
1af73218fc display: fix accidentally commented out code
Not sure why I commented this out before pushing 47dcfee8 -- whoops!
2016-06-09 17:03:48 -07:00
Rui Matos
e9b70c2efa display: Separate interlaced from normal modes
https://bugzilla.gnome.org/show_bug.cgi?id=763833
2016-05-13 18:39:23 +02:00
Rui Matos
6d825b9660 display: Ensure only one output is set as primary
When switching an output to secondary we'd set all other outputs as
primary. Instead, set only the first we find.

https://bugzilla.gnome.org/show_bug.cgi?id=764155
2016-05-02 18:24:12 +02:00
Cosimo Cecchi
cc5c94f151 display: remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=764296
2016-04-14 12:31:49 -07:00
Cosimo Cecchi
47dcfee83b display: add option to enable and disable overscan compensation
Adds a switch that allows to control overscan compensation, when the
driver supports it.

Based on a patch by Tomeu Vizoso <tomeu.vizoso@collabora.com>

https://bugzilla.gnome.org/show_bug.cgi?id=725135
2016-04-05 10:14:53 -07:00
Bastien Nocera
529b29cae9 display: Remove duplicate non-ATSC/NTSC rates from the list
When a mode has 2 very close refresh rates such as 59.94Hz and 60Hz,
most of the time, we'll want the 59.94Hz version.

Hide the "PC" 60Hz version and only show the 59.94Hz version in those
cases, and mark the frequency as "60Hz (ATSC)" so that those
knowledgeable know that it's really 59.94Hz, and doesn't confuse those
who expect rates to be multiple of 30Hz or 25Hz.

See also https://en.wikipedia.org/wiki/NTSC#Lines_and_refresh_rate

Note that we also do this for half and double that rate, eg. close to
~30Hz and ~120Hz.

https://bugzilla.gnome.org/show_bug.cgi?id=655041
2016-03-17 14:47:18 +01:00
Rui Matos
3814c9b397 display: Add a way to specify the monitor refresh rate
This adds an extra frequency combo box that allows users to choose a
frequency for a given resolution.

https://bugzilla.gnome.org/show_bug.cgi?id=655041
2016-03-17 14:47:17 +01:00
Bastien Nocera
7229af6bdf display: Bump the minimum resolution shown
There's really no point showing a resolution that's smaller than the
fixed width of the shell, and isn't the preferred resolution for the
screen either. This stops the problematic 720x576 resolution showing on
an HD screen.
2016-03-01 16:05:04 +01:00
Dave Airlie
0005c32ded display: Fix making a tiled monitor primary again
Don't break out of loop if we weren't primary, as this
is stopping the user swapping back and forward between
primary and secondary with a tiled monitor.

i.e. user sets monitor to secondary and attempts to
go back to primary and it fails to move it.

https://bugzilla.gnome.org/show_bug.cgi?id=751680
2015-07-01 10:49:12 +02:00
Dave Airlie
458cebb26d display: Add support for tiled monitors
The display panel needs to ask libgnome-desktop in a few places
whether the panel is tiled.

https://bugzilla.gnome.org/show_bug.cgi?id=751680
2015-07-01 10:49:06 +02:00
Dave Airlie
3d8cd197c9 display: Use correctly typed pointer
We already assign list->data to output.

https://bugzilla.gnome.org/show_bug.cgi?id=750312
2015-06-15 16:18:33 +02:00
Dave Airlie
4c7189d1b4 display: Refactor get_geometry helper
This moves the two functions to the top of the file, changes the
get_geometry to return x/y if requested, and refactors the callers to
use it.

It also refactors some code that open coded the same basic code.

https://bugzilla.gnome.org/show_bug.cgi?id=750312
2015-06-15 16:16:16 +02:00