Static init functions are functions that initialize resources
or monitor daemons without needing any contextual information,
such as a CcPanel instance or access to a CcShell implementation.
These functions are meant to be used for monitoring a panel's
visibility, when it makes sense. Usually, panels that represent
hardware that potentially is not available or is not supported
should hide itself.
Following this commit, the Wi-Fi panel panel will be adapted as
the first user of this new API. Other panels that require this
functionality will be adapted later.
This field can be used to communicate the visibility of the
panel from a static context (i.e. without any instances of
a CcPanel nor any access to CcShell).
In order be able to modify panel information statically,
we need to have access to the CcShellModel from static
functions. CcApplication, thus, is a better place for the
model to live, since we can access it outside any scope
using g_application_get_default().
It also makes sense from the modeling point of view, since
the model is not tied to the shell anymore.
This commit improves the Night Light code in various
ways:
* Turn it into a template class, subclass of GtkDialog,
and adapts all the code to reflect that.
* Update the code style in various places, to make it
more conformant with the documented code style.
* Reorganize the code a bit, moving functions around,
to make it more conformant with the documented order.
Also wait for the connection-added signal instead of only waiting for the
property notification for the connections. While not neccessary, this is
more correct.
Doing so means we handle the same events as the panel. This probably
makes no difference, but this way it is guaranteed we are not getting
weird inconsistencies during testing.
Also fixes a NMClient memory leak in the process.
This has the side effect of showing UI elements that should not be
visible at startup. Just add the correct gtk_widget_show calls to show
all relevant widgets.
The disconnect was for the wrong object (connection rather than client).
Fix this by simply moving to use g_signal_connect_object which obsoletes
the explicit disconnect calls.
The test to check whether the Bluetooth (simple section) contains
elements was testing for NetObjectSimple. However, ethernet connections
are a subclass and check would count these. This causes issue when the
code is run after net object removal.
The fix is to check for the exact object type rather than also allowing
subclasses.
This never really worked on the new Setting layout
because it was historically implemented as "Back to
Overview", and we don't have an overview anymore.
This is fixed by morphing the implementation to be
"Back to previous panel", which forces us to actually
store the previous panel.
There is no overview anymore -- Settings is always
visualizing a panel at any given time.
I just noticed that the Alt+Left shortcut was always
broken too. This will be fixed in a following commit.
This improves the snapping behaviour in a number of ways. It allows
increasing the snapping distance while still helping the user to align
monitors by snapping a different distance for the minor axis. The patch
also allows setting this distance to infinity so that we get the correct
behaviour in the case of two monitors for the corners.
Two monitors are a special case where it is easy to ensure that the
monitors are always adjacent to each other by special casing the
snapping code. Do so by increasing the snapping distance to infinity and
adding extra snapping points so that corner cases are covered.
This adds the following API:
* cc_display_config_get_ui_sorted_monitors
Returns the monitors in UI order
* cc_display_config_count_useful_monitors
Counts the useful monitors (active and usable)
* cc_display_monitor_is_useful
Checks if a monitor is active and usable
* cc_display_monitor_is_useable
Check if a monitor is marked as useable
* cc_display_monitor_set_usable
Used to mark builtin monitors as unusable if the lid is closed
* cc_display_monitor_get_ui_*
Get the UI number and strings for display
https://bugzilla.gnome.org/show_bug.cgi?id=786971
Remove the code that has become unused with the new arrangement widget.
There are more possible cleanups as there is some code duplication
between cc-display-panel.c and cc-display-arrangment.c at this point.
https://bugzilla.gnome.org/show_bug.cgi?id=786971
This commits adds a new arrangement widget, refactoring the existing
code and addressing a number of issues:
* Forced snapping made laying out more than 2 monitors hard
* Random gaps would be shown between monitors
* The scaling was fixed and usually tiny
https://bugzilla.gnome.org/show_bug.cgi?id=786971