Commit graph

276 commits

Author SHA1 Message Date
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
8a175d1106 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.

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
Rui Matos
f82bd7d7db 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.

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

https://bugzilla.gnome.org/show_bug.cgi?id=782785
2017-05-18 18:57:26 +02:00
Emmanuele Bassi
e7d0716d14 display: Load appropriate assets for the night light panel
We hard-code a 16x16 asset for sunrise and sunset icons, which makes
them look blurry at higher scaling factors.

Let's look in the icon theme to see if there's an icon for sunrise and
sunset; if not, we can still use the assets we ship, but we also attempt
to load them from different resource paths, depending on the scale
factor.

We will need to update the assets to include a 32x32 rendering of the
sunrise and sunset icons.

https://bugzilla.gnome.org/show_bug.cgi?id=781029
2017-04-07 14:38:10 +01:00
Richard Hughes
9725efd3e4 display: Tweak night light dialog UI to match latest mockups 2017-02-16 19:56:51 +00:00
Jeremy Bicha
86f131a1cb display: Really fix typo in "Tomorrow"
Spelled correctly in the commit message, but not in the code itself.
Yay! :(

https://bugzilla.gnome.org/show_bug.cgi?id=778513
2017-02-15 11:58:54 +01:00
Richard Hughes
2f1af82a4e display: Only show the sunset/sunrise icons when not manually specified 2017-02-14 11:20:08 +00:00
Jeremy Bicha
a916552933 display: Add Night Light keywords to .desktop
https://bugzilla.gnome.org/show_bug.cgi?id=778461
2017-02-13 05:26:37 -05:00
Bastien Nocera
d2fc99a6d7 display: Fix typo in "Tomorrow"
Re-spotted by Anders Jonsson <anders.jonsson@norsjovallen.se>. First
spotted on IRC, but not fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=778513
2017-02-12 16:14:47 +01:00
Richard Hughes
2d176bee27 display: Fix up padding in new Night Light dialog 2017-02-10 17:05:37 +00:00
Richard Hughes
fdbd788b96 display: Rename 'Natural Light Filter' to 'Night Light' 2017-02-10 16:32:24 +00:00
Richard Hughes
8c93ec478f display: Update the disabled banner when the interface changes
GNOME Shell is setting this D-Bus property from the status menu when the
natural light filter is disabled.
2017-02-10 13:42:48 +00:00
Richard Hughes
090316deea display: Update the enabled switch when the setting changes
GNOME Shell is setting this settings key from the status menu when the natural
light filter is turned off.
2017-02-10 13:42:48 +00:00
Jeremy Bicha
c08bdf04a5 display: Fix typo in translator message
https://bugzilla.gnome.org/show_bug.cgi?id=778443
2017-02-10 07:37:49 -05: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
Bastien Nocera
3f0510cac8 build: Better libm checks
Use AC_CHECK_LIBM instead of AC_CHECK_LIB(m,...
and use $(LIBM) instead of hardcoding "-lm" in Makefiles.
2017-02-08 19:21:53 +01: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
Georges Basile Stavracas Neto
2777fd583d panels: use the new categories
Following the previous patch, this patch adds the new alternative
categories to the panels' Desktop files. These alternative categories
are only relevant for the alternative Shell, and do not break the
current Shell in any way.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03: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
Bastien Nocera
5c10ce45b8 panels: Fix translators comments being truncated
Commit b3be076 added soft hyphens along with a comment for translators
to use those soft hyphens. Except that gettext would only grab the one
line out of the four we wrote for translators to read. Put them all on
the same line so that gettext actually extracts those.

https://bugzilla.gnome.org/show_bug.cgi?id=765778
2016-04-28 23:38:00 +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
Bastien Nocera
b3be07609a panels: Fix truncated panel names for larger fonts
Note that this fix will not automatically fix translations, which will
need to add soft-hyphens (U+00AD) to their translations themselves, and
will not fix larger fonts for which the split up syllables end up
being bigger than the maximum text width.

It's the best we can do without redesigning the Settings shell, which is
already something planned.

https://bugzilla.gnome.org/show_bug.cgi?id=647087#c13
2016-04-07 16:06:35 +02: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
Bastien Nocera
b6d7bb856d display: Don't show rotation for builtin display on tablets
If there's an accelerometer builtin to the display, don't show the
rotation buttons, it will be handled by the user rotating the display,
eventually with the rotation lock in use.

https://bugzilla.gnome.org/show_bug.cgi?id=750410
2015-06-08 15:07:56 +02:00
Rui Matos
03d9a96c67 display: Close the dialog when the RR configuration changes
We assume that the RR configuration is valid in various callbacks from
both our modal dialogs which doesn't hold if there's an hotplug while
a dialog is open (e.g. monitor is plugged/unplugged).

Closing the dialog in that case seems the right thing to do since it
would be operating on an outdated view of the world otherwise and
likely end up crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=655041
2015-04-13 14:05:49 +02:00
Rui Matos
0d6369a762 display: Don't leak GnomeRRModes
GnomeRRMode is a boxed type which means that if stored as such in a
tree model, the model creates a copy to use internally. In addition,
it means that gtk_tree_model_get() will also get a copy which must be
freed by the caller which we were not doing.

In this case though, we don't need the copies since all the
GnomeRRModes that we use outlive the model so we can simplify things
by just storing a plain pointer in the model instead.

https://bugzilla.gnome.org/show_bug.cgi?id=655041
2015-04-13 14:05:49 +02:00
Rui Matos
5e0b26dac5 display: Fix GtkListStore leak in setup dialog
https://bugzilla.gnome.org/show_bug.cgi?id=655041
2015-04-13 14:05:49 +02:00
Rui Matos
511265e574 display: In clone mode, set geometry of all outputs when one changes
Otherwise we could fail to validate the new configuration depending on
which output we're initializing mirror mode from.

gnome_rr_config_applicable() creates a temporary array of outputs for
validation and, in clone mode, all of them are assigned the same
geometry but, since it lacks context about which output the user is
currently on, it just uses the first one's geometry for all of
them. If this first output isn't the one the user is changing in the
UI then we never called _set_geometry() on it with a clone mode
geometry and thus the validation would fail because the geometry used
is that output's current mode which might not match the clone mode's.

https://bugzilla.gnome.org/show_bug.cgi?id=743816
2015-02-23 19:38:56 +01:00
Rui Matos
c6970ec8eb display: Replace CcRRLabeler with gnome-shell's DBus monitor labeler
CcRRLabeler assumes an X11 session using override redirect toplevel
windows which are positioned in global desktop coordinates. Since this
isn't available on Wayland sessions, we're moving to a DBus API which
gnome-shell implements and works the same on both X11 an Wayland
sessions.

As side-effects, we get native looking gnome-shell OSD labels without
having to mimic the style ourselves and we're also now able to easily
show labels on mirrored setups.

https://bugzilla.gnome.org/show_bug.cgi?id=743743
2015-02-05 14:37:05 +01:00
Elias Toivanen
ef72c19ebf Tooltips for the rotation buttons in Displays
When rotating a screen, the user has to first select the kind of
rotation and then press Apply. However, the meaning of the symbolic
icons may not be clear before actually pressing one of them.

This patch adds appropriate tooltips to the buttons so that the user has
a textual clue about what is going to happen.

https://bugzilla.gnome.org/show_bug.cgi?id=743888
2015-02-03 08:40:25 -06:00
Michael Catanzaro
1522790461 displays: Apply buttons should use suggested-action style class
https://bugzilla.gnome.org/show_bug.cgi?id=743216
2015-01-20 07:43:31 -06:00
Rui Matos
dd05918a40 display: Fix deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
2014-12-05 16:13:29 +01:00