Skip to content
Commits on Source (13)
gnome-control-center (1:3.36.1-1ubuntu5) UNRELEASED; urgency=medium
gnome-control-center (1:3.36.1-1ubuntu5) focal; urgency=medium
* debian/patches/git-info-crash-on-nvidia.patch:
- backport a fix for an info panel segfault on nvidia cards
(lp: #1870737)
* debian/patches/git-nongnome-segfault.patch:
- don't segfault when started outside of GNOME (lp: #1870735)
[ Marco Trevisan ]
* d/p/0028-user-panel-Add-reference-to-selected-user-and-clear-.patch,
* d/p/0029-user-panel-Don-t-wait-for-fprintd-on-initialization.patch,
d/p/0030-fingerprint-dialog-Don-t-use-sync-calls-for-deleting.patch,
d/p/0031-fingerprint-dialog-Don-t-limit-the-number-of-maximum.patch:
- Don't wait for fprintd on initialization and don't limit enroll stages
(lp: #1865845)
[ Robert Ancell ]
* debian/patches/0027-window-Stop-using-HdyLeaflet.patch:
- Disable adaptive layouts, theres some bugs and they're not required on
desktop (LP: #1871195)
......@@ -10,7 +25,12 @@ gnome-control-center (1:3.36.1-1ubuntu5) UNRELEASED; urgency=medium
- Use shared names for snap interfaces, fixing some interfaces that don't
have labels.
-- Robert Ancell <robert.ancell@canonical.com> Thu, 16 Apr 2020 15:40:54 +1200
[ Gunnar Hjalmarsson ]
* debian/patches/0030-temporarily-revert-alt-char-key.patch:
- Revert the "Alternate Characters Key" commit temporarily awaiting
a proper fix of LP: #1867548.
-- Sebastien Bacher <seb128@ubuntu.com> Thu, 16 Apr 2020 12:30:37 +0200
gnome-control-center (1:3.36.1-1ubuntu4) focal; urgency=medium
......
......@@ -16,10 +16,10 @@ Bug: https://bugzilla.gnome.org/show_bug.cgi?id=692532
panels/printers/printers.ui | 43 +++++++++++++++++++++++++++++
2 files changed, 71 insertions(+)
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 01bb678d2..01be98b9e 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
Index: gnome-control-center-3.36.1/panels/printers/cc-printers-panel.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/printers/cc-printers-panel.c
+++ gnome-control-center-3.36.1/panels/printers/cc-printers-panel.c
@@ -25,6 +25,7 @@
#include "pp-printer.h"
......@@ -28,11 +28,10 @@ index 01bb678d2..01be98b9e 100644
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#include <polkit/polkit.h>
@@ -965,6 +966,25 @@ printer_add_cb (GtkToolButton *toolbutton,
self);
@@ -970,6 +971,25 @@ printer_add_cb (GtkToolButton *toolbutto
}
+static void
static void
+show_system_config_printer (void)
+{
+ g_autoptr(GAppInfo) app_info = NULL;
......@@ -51,10 +50,11 @@ index 01bb678d2..01be98b9e 100644
+ g_warning ("Failed to launch system-config-printer: %s", error->message);
+}
+
static void
+static void
update_sensitivity (gpointer user_data)
{
@@ -1240,6 +1260,14 @@ cc_printers_panel_init (CcPrintersPanel *self)
CcPrintersPanel *self = (CcPrintersPanel*) user_data;
@@ -1244,6 +1264,14 @@ cc_printers_panel_init (CcPrintersPanel
gtk_builder_get_object (self->builder, "printer-add-button2");
g_signal_connect (widget, "clicked", G_CALLBACK (printer_add_cb), self);
......@@ -69,11 +69,11 @@ index 01bb678d2..01be98b9e 100644
widget = (GtkWidget*)
gtk_builder_get_object (self->builder, "content");
gtk_list_box_set_filter_func (GTK_LIST_BOX (widget),
diff --git a/panels/printers/printers.ui b/panels/printers/printers.ui
index d8f8af24a..f4c0d98ab 100644
--- a/panels/printers/printers.ui
+++ b/panels/printers/printers.ui
@@ -134,6 +134,7 @@
Index: gnome-control-center-3.36.1/panels/printers/printers.ui
===================================================================
--- gnome-control-center-3.36.1.orig/panels/printers/printers.ui
+++ gnome-control-center-3.36.1/panels/printers/printers.ui
@@ -127,6 +127,7 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
......@@ -81,7 +81,7 @@ index d8f8af24a..f4c0d98ab 100644
<child>
<object class="GtkListBox" id="content">
<property name="visible">True</property>
@@ -146,6 +147,32 @@
@@ -139,6 +140,32 @@
</style>
</object>
</child>
......@@ -114,7 +114,7 @@ index d8f8af24a..f4c0d98ab 100644
</object>
</child>
</object>
@@ -213,6 +240,22 @@
@@ -206,6 +233,22 @@
<property name="position">2</property>
</packing>
</child>
......@@ -137,6 +137,3 @@ index d8f8af24a..f4c0d98ab 100644
</object>
<packing>
<property name="name">empty-state</property>
--
2.25.1
......@@ -16,11 +16,11 @@ Forwarded: No, MPs will follow shortly
panels/display/cc-display-config.h | 2 ++
4 files changed, 86 insertions(+), 8 deletions(-)
diff --git a/panels/display/cc-display-arrangement.c b/panels/display/cc-display-arrangement.c
index adbbcbc28..7080bf634 100644
--- a/panels/display/cc-display-arrangement.c
+++ b/panels/display/cc-display-arrangement.c
@@ -95,10 +95,31 @@ apply_rotation_to_geometry (CcDisplayMonitor *output,
Index: gnome-control-center-3.36.1/panels/display/cc-display-arrangement.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/display/cc-display-arrangement.c
+++ gnome-control-center-3.36.1/panels/display/cc-display-arrangement.c
@@ -95,10 +95,31 @@ apply_rotation_to_geometry (CcDisplayMon
}
}
......@@ -52,7 +52,7 @@ index adbbcbc28..7080bf634 100644
int *x,
int *y,
int *w,
@@ -117,6 +138,10 @@ get_scaled_geometry (CcDisplayConfig *config,
@@ -117,6 +138,10 @@ get_scaled_geometry (CcDisplayConfig *c
if (cc_display_config_is_layout_logical (config))
{
double scale = cc_display_monitor_get_scale (output);
......@@ -63,7 +63,7 @@ index adbbcbc28..7080bf634 100644
*w = round (*w / scale);
*h = round (*h / scale);
}
@@ -134,6 +159,7 @@ get_bounding_box (CcDisplayConfig *config,
@@ -134,6 +159,7 @@ get_bounding_box (CcDisplayConfig *confi
gint *max_h)
{
GList *outputs, *l;
......@@ -71,7 +71,7 @@ index adbbcbc28..7080bf634 100644
g_assert (x1 && y1 && x2 && y2);
@@ -141,6 +167,7 @@ get_bounding_box (CcDisplayConfig *config,
@@ -141,6 +167,7 @@ get_bounding_box (CcDisplayConfig *confi
*x2 = *y2 = G_MININT;
*max_w = 0;
*max_h = 0;
......@@ -79,7 +79,7 @@ index adbbcbc28..7080bf634 100644
outputs = cc_display_config_get_monitors (config);
for (l = outputs; l; l = l->next)
@@ -151,7 +178,7 @@ get_bounding_box (CcDisplayConfig *config,
@@ -151,7 +178,7 @@ get_bounding_box (CcDisplayConfig *confi
if (!cc_display_monitor_is_useful (output))
continue;
......@@ -88,7 +88,7 @@ index adbbcbc28..7080bf634 100644
*x1 = MIN (*x1, x);
*y1 = MIN (*y1, y);
@@ -171,8 +198,10 @@ monitor_get_drawing_rect (CcDisplayArrangement *self,
@@ -171,8 +198,10 @@ monitor_get_drawing_rect (CcDisplayArran
gint *y2)
{
gdouble x, y;
......@@ -100,7 +100,7 @@ index adbbcbc28..7080bf634 100644
/* get_scaled_geometry returns the width and height */
*x2 = *x1 + *x2;
@@ -325,10 +354,12 @@ find_best_snapping (CcDisplayConfig *config,
@@ -325,10 +354,12 @@ find_best_snapping (CcDisplayConfig *c
GList *outputs, *l;
gint x1, y1, x2, y2;
gint w, h;
......@@ -114,7 +114,7 @@ index adbbcbc28..7080bf634 100644
x2 = x1 + w;
y2 = y1 + h;
@@ -344,6 +375,7 @@ find_best_snapping (CcDisplayConfig *config,
@@ -344,6 +375,7 @@ find_best_snapping (CcDisplayConfig *c
gint left_snap_pos;
gint right_snap_pos;
gdouble dist_x, dist_y;
......@@ -122,7 +122,7 @@ index adbbcbc28..7080bf634 100644
gdouble tmp;
if (output == snap_output)
@@ -352,7 +384,8 @@ find_best_snapping (CcDisplayConfig *config,
@@ -352,7 +384,8 @@ find_best_snapping (CcDisplayConfig *c
if (!cc_display_monitor_is_useful (output))
continue;
......@@ -132,7 +132,7 @@ index adbbcbc28..7080bf634 100644
_x2 = _x1 + _w;
_y2 = _y1 + _h;
@@ -965,6 +998,7 @@ cc_display_config_snap_output (CcDisplayConfig *config,
@@ -965,6 +998,7 @@ cc_display_config_snap_output (CcDisplay
{
SnapData snap_data;
gint x, y, w, h;
......@@ -140,7 +140,7 @@ index adbbcbc28..7080bf634 100644
if (!cc_display_monitor_is_useful (output))
return;
@@ -972,7 +1006,8 @@ cc_display_config_snap_output (CcDisplayConfig *config,
@@ -972,7 +1006,8 @@ cc_display_config_snap_output (CcDisplay
if (cc_display_config_count_useful_monitors (config) <= 1)
return;
......@@ -150,11 +150,11 @@ index adbbcbc28..7080bf634 100644
snap_data.snapped = SNAP_DIR_NONE;
snap_data.mon_x = x;
diff --git a/panels/display/cc-display-config-dbus.c b/panels/display/cc-display-config-dbus.c
index aa7c673be..fc050a32c 100644
--- a/panels/display/cc-display-config-dbus.c
+++ b/panels/display/cc-display-config-dbus.c
@@ -861,7 +861,8 @@ cc_display_monitor_dbus_new (GVariant *variant,
Index: gnome-control-center-3.36.1/panels/display/cc-display-config-dbus.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/display/cc-display-config-dbus.c
+++ gnome-control-center-3.36.1/panels/display/cc-display-config-dbus.c
@@ -861,7 +861,8 @@ cc_display_monitor_dbus_new (GVariant *v
typedef enum _CcDisplayLayoutMode
{
CC_DISPLAY_LAYOUT_MODE_LOGICAL = 1,
......@@ -164,7 +164,7 @@ index aa7c673be..fc050a32c 100644
} CcDisplayLayoutMode;
typedef enum _CcDisplayConfigMethod
@@ -1203,7 +1204,15 @@ cc_display_config_dbus_is_layout_logical (CcDisplayConfig *pself)
@@ -1203,7 +1204,15 @@ cc_display_config_dbus_is_layout_logical
{
CcDisplayConfigDBus *self = CC_DISPLAY_CONFIG_DBUS (pself);
......@@ -181,7 +181,7 @@ index aa7c673be..fc050a32c 100644
}
static gboolean
@@ -1465,7 +1474,7 @@ cc_display_config_dbus_constructed (GObject *object)
@@ -1465,7 +1474,7 @@ cc_display_config_dbus_constructed (GObj
guint32 u = 0;
g_variant_get (v, "u", &u);
if (u >= CC_DISPLAY_LAYOUT_MODE_LOGICAL &&
......@@ -190,7 +190,7 @@ index aa7c673be..fc050a32c 100644
self->layout_mode = u;
}
}
@@ -1555,6 +1564,7 @@ cc_display_config_dbus_class_init (CcDisplayConfigDBusClass *klass)
@@ -1555,6 +1564,7 @@ cc_display_config_dbus_class_init (CcDis
parent_class->is_layout_logical = cc_display_config_dbus_is_layout_logical;
parent_class->is_scaled_mode_valid = cc_display_config_dbus_is_scaled_mode_valid;
parent_class->set_minimum_size = cc_display_config_dbus_set_minimum_size;
......@@ -198,7 +198,7 @@ index aa7c673be..fc050a32c 100644
pspec = g_param_spec_variant ("state",
"GVariant",
@@ -1615,6 +1625,26 @@ logical_monitor_is_rotated (CcDisplayLogicalMonitor *lm)
@@ -1615,6 +1625,26 @@ logical_monitor_is_rotated (CcDisplayLog
}
}
......@@ -225,7 +225,7 @@ index aa7c673be..fc050a32c 100644
static int
logical_monitor_width (CcDisplayLogicalMonitor *lm)
{
@@ -1633,6 +1663,11 @@ logical_monitor_width (CcDisplayLogicalMonitor *lm)
@@ -1633,6 +1663,11 @@ logical_monitor_width (CcDisplayLogicalM
if (monitor->config->layout_mode == CC_DISPLAY_LAYOUT_MODE_LOGICAL)
return round (width / lm->scale);
......@@ -237,12 +237,12 @@ index aa7c673be..fc050a32c 100644
else
return width;
}
diff --git a/panels/display/cc-display-config.c b/panels/display/cc-display-config.c
index 30c97c450..0a49191bf 100644
--- a/panels/display/cc-display-config.c
+++ b/panels/display/cc-display-config.c
@@ -624,3 +624,9 @@ cc_display_config_is_scaled_mode_valid (CcDisplayConfig *self,
{
Index: gnome-control-center-3.36.1/panels/display/cc-display-config.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/display/cc-display-config.c
+++ gnome-control-center-3.36.1/panels/display/cc-display-config.c
@@ -627,3 +627,9 @@ cc_display_config_is_scaled_mode_valid (
g_return_val_if_fail (CC_IS_DISPLAY_MODE (mode), FALSE);
return CC_DISPLAY_CONFIG_GET_CLASS (self)->is_scaled_mode_valid (self, mode, scale);
}
+
......@@ -251,10 +251,10 @@ index 30c97c450..0a49191bf 100644
+{
+ return CC_DISPLAY_CONFIG_GET_CLASS (self)->layout_use_ui_scale (self);
+}
diff --git a/panels/display/cc-display-config.h b/panels/display/cc-display-config.h
index ef4332ff7..2f246ffdb 100644
--- a/panels/display/cc-display-config.h
+++ b/panels/display/cc-display-config.h
Index: gnome-control-center-3.36.1/panels/display/cc-display-config.h
===================================================================
--- gnome-control-center-3.36.1.orig/panels/display/cc-display-config.h
+++ gnome-control-center-3.36.1/panels/display/cc-display-config.h
@@ -160,6 +160,7 @@ struct _CcDisplayConfigClass
gboolean (*is_scaled_mode_valid) (CcDisplayConfig *self,
CcDisplayMode *mode,
......@@ -263,7 +263,7 @@ index ef4332ff7..2f246ffdb 100644
};
@@ -186,6 +187,7 @@ void cc_display_config_set_minimum_size (CcDisplayConfig
@@ -186,6 +187,7 @@ void cc_display_config_set_
gboolean cc_display_config_is_scaled_mode_valid (CcDisplayConfig *self,
CcDisplayMode *mode,
double scale);
......@@ -271,6 +271,3 @@ index ef4332ff7..2f246ffdb 100644
const char* cc_display_monitor_get_display_name (CcDisplayMonitor *monitor);
gboolean cc_display_monitor_is_active (CcDisplayMonitor *monitor);
--
2.25.1
......@@ -8,24 +8,24 @@ Subject: [PATCH 22/26] info-overview: Show updates in software propeties
panels/info-overview/cc-info-overview-panel.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
index af04dc660..4b54542c9 100644
--- a/panels/info-overview/cc-info-overview-panel.c
+++ b/panels/info-overview/cc-info-overview-panel.c
@@ -710,6 +710,12 @@ info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
cc_list_row_set_secondary_markup (self->graphics_row, graphics_hardware_string);
Index: gnome-control-center-3.36.1/panels/info-overview/cc-info-overview-panel.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/info-overview/cc-info-overview-panel.c
+++ gnome-control-center-3.36.1/panels/info-overview/cc-info-overview-panel.c
@@ -720,6 +720,12 @@ info_overview_panel_setup_overview (CcIn
}
+static gboolean
static gboolean
+does_software_properties_exist (void)
+{
+ return g_file_test (BINDIR "/software-properties-gtk", G_FILE_TEST_EXISTS);
+}
+
static gboolean
+static gboolean
does_gnome_software_exist (void)
{
@@ -730,7 +736,11 @@ open_software_update (CcInfoOverviewPanel *self)
return g_file_test (BINDIR "/gnome-software", G_FILE_TEST_EXISTS);
@@ -739,7 +745,11 @@ open_software_update (CcInfoOverviewPane
g_auto(GStrv) argv = NULL;
argv = g_new0 (gchar *, 3);
......@@ -38,7 +38,7 @@ index af04dc660..4b54542c9 100644
{
argv[0] = g_build_filename (BINDIR, "gnome-software", NULL);
argv[1] = g_strdup_printf ("--mode=updates");
@@ -840,7 +850,7 @@ cc_info_overview_panel_init (CcInfoOverviewPanel *self)
@@ -849,7 +859,7 @@ cc_info_overview_panel_init (CcInfoOverv
g_resources_register (cc_info_overview_get_resource ());
......@@ -47,6 +47,3 @@ index af04dc660..4b54542c9 100644
gtk_widget_hide (GTK_WIDGET (self->software_updates_row));
info_overview_panel_setup_overview (self);
--
2.25.1
......@@ -4,6 +4,8 @@ Date: Wed, 20 Feb 2019 16:18:33 +0100
Subject: [PATCH 27/28] window: Stop using HdyLeaflet
This is too buggy for an LTS release and less useful in the desktop case.
https://launchpad.net/bugs/1871195
---
shell/cc-window.c | 105 ++-------------------------------------------
shell/cc-window.ui | 55 ++----------------------
......
......@@ -9,11 +9,11 @@ Not enough information was being queried from snapd.
panels/applications/cc-applications-panel.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 8f7da4bd6..96e8a2d9e 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -664,8 +664,8 @@ add_snap_permissions (CcApplicationsPanel *self,
Index: gnome-control-center-3.36.1/panels/applications/cc-applications-panel.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/applications/cc-applications-panel.c
+++ gnome-control-center-3.36.1/panels/applications/cc-applications-panel.c
@@ -663,8 +663,8 @@ add_snap_permissions (CcApplicationsPane
client = snapd_client_new ();
if (!snapd_client_get_connections2_sync (client,
......@@ -24,7 +24,7 @@ index 8f7da4bd6..96e8a2d9e 100644
NULL, NULL,
&plugs, &slots,
NULL, &error))
@@ -687,6 +687,10 @@ add_snap_permissions (CcApplicationsPanel *self,
@@ -686,6 +686,10 @@ add_snap_permissions (CcApplicationsPane
"x11",
NULL };
......@@ -35,6 +35,3 @@ index 8f7da4bd6..96e8a2d9e 100644
/* Ignore interfaces that are too low level to make sense to show or disable */
if (g_strv_contains (hidden_interfaces, snapd_plug_get_interface (plug)))
continue;
--
2.25.1
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 26 Mar 2020 06:41:33 +0100
Subject: user-panel: Add reference to selected user and clear on dispose
The object was wrongly unreffed (as ActUserManager has the ownership) on
user switch, so add a reference instead when assigning it to our private
ref and unref it on dispose.
Origin: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/727
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1865845
---
panels/user-accounts/cc-user-panel.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index 92d7988..7cd3413 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -174,10 +174,9 @@ set_selected_user (CcUserPanel *self, CcCarouselItem *item)
{
uid_t uid;
- g_clear_object (&self->selected_user);
-
uid = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "uid"));
- self->selected_user = act_user_manager_get_user_by_id (self->um, uid);
+ g_set_object (&self->selected_user,
+ act_user_manager_get_user_by_id (self->um, uid));
if (self->selected_user != NULL) {
show_user (self->selected_user, self);
@@ -1481,6 +1480,8 @@ cc_user_panel_dispose (GObject *object)
{
CcUserPanel *self = CC_USER_PANEL (object);
+ g_clear_object (&self->selected_user);
+
g_clear_object (&self->login_screen_settings);
g_clear_pointer ((GtkWidget **)&self->language_chooser, gtk_widget_destroy);
......@@ -14,10 +14,10 @@ shared between multiple applications that use Snaps.
po/POTFILES.in | 1 -
5 files changed, 35 insertions(+), 130 deletions(-)
diff --git a/meson.build b/meson.build
index 1e1d5a07a..aec07491f 100644
--- a/meson.build
+++ b/meson.build
Index: gnome-control-center-3.36.1/meson.build
===================================================================
--- gnome-control-center-3.36.1.orig/meson.build
+++ gnome-control-center-3.36.1/meson.build
@@ -201,7 +201,7 @@ config_h.set10('HAVE_FN_EXPLICIT_BZERO',
enable_snap = get_option('snap')
if enable_snap
......@@ -27,11 +27,11 @@ index 1e1d5a07a..aec07491f 100644
]
endif
config_h.set('HAVE_SNAP', enable_snap,
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 96e8a2d9e..c7525fbc0 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -649,10 +649,13 @@ add_snap_permissions (CcApplicationsPanel *self,
Index: gnome-control-center-3.36.1/panels/applications/cc-applications-panel.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/applications/cc-applications-panel.c
+++ gnome-control-center-3.36.1/panels/applications/cc-applications-panel.c
@@ -648,10 +648,13 @@ add_snap_permissions (CcApplicationsPane
g_autoptr(GList) rows = NULL;
gint index;
g_autoptr(SnapdClient) client = NULL;
......@@ -45,7 +45,7 @@ index 96e8a2d9e..c7525fbc0 100644
if (!g_str_has_prefix (app_id, PORTAL_SNAP_PREFIX))
return FALSE;
@@ -663,6 +666,14 @@ add_snap_permissions (CcApplicationsPanel *self,
@@ -662,6 +665,14 @@ add_snap_permissions (CcApplicationsPane
g_assert (index >= 0);
client = snapd_client_new ();
......@@ -60,7 +60,7 @@ index 96e8a2d9e..c7525fbc0 100644
if (!snapd_client_get_connections2_sync (client,
SNAPD_GET_CONNECTIONS_FLAGS_SELECT_ALL,
NULL, NULL,
@@ -670,7 +681,7 @@ add_snap_permissions (CcApplicationsPanel *self,
@@ -669,7 +680,7 @@ add_snap_permissions (CcApplicationsPane
&plugs, &slots,
NULL, &error))
{
......@@ -69,7 +69,7 @@ index 96e8a2d9e..c7525fbc0 100644
return FALSE;
}
@@ -705,7 +716,17 @@ add_snap_permissions (CcApplicationsPanel *self,
@@ -704,7 +715,17 @@ add_snap_permissions (CcApplicationsPane
g_ptr_array_add (available_slots, g_object_ref (slot));
}
......@@ -88,10 +88,10 @@ index 96e8a2d9e..c7525fbc0 100644
gtk_widget_show (GTK_WIDGET (row));
gtk_list_box_insert (GTK_LIST_BOX (self->permission_list), GTK_WIDGET (row), index);
index++;
diff --git a/panels/applications/cc-snap-row.c b/panels/applications/cc-snap-row.c
index d20faf6e4..40a7fc407 100644
--- a/panels/applications/cc-snap-row.c
+++ b/panels/applications/cc-snap-row.c
Index: gnome-control-center-3.36.1/panels/applications/cc-snap-row.c
===================================================================
--- gnome-control-center-3.36.1.orig/panels/applications/cc-snap-row.c
+++ gnome-control-center-3.36.1/panels/applications/cc-snap-row.c
@@ -48,127 +48,6 @@ typedef struct
SnapdSlot *slot;
} ConnectData;
......@@ -233,7 +233,7 @@ index d20faf6e4..40a7fc407 100644
GtkTreeIter iter;
g_return_val_if_fail (SNAPD_IS_PLUG (plug), NULL);
@@ -411,7 +291,11 @@ cc_snap_row_new (GCancellable *cancellable, SnapdPlug *plug, GPtrArray *slots)
@@ -411,7 +291,11 @@ cc_snap_row_new (GCancellable *cancellab
}
}
......@@ -246,10 +246,10 @@ index d20faf6e4..40a7fc407 100644
/* Add option into combo box */
gtk_list_store_append (self->slots_combo_model, &iter);
diff --git a/panels/applications/cc-snap-row.h b/panels/applications/cc-snap-row.h
index 26563bd8d..d37bb804f 100644
--- a/panels/applications/cc-snap-row.h
+++ b/panels/applications/cc-snap-row.h
Index: gnome-control-center-3.36.1/panels/applications/cc-snap-row.h
===================================================================
--- gnome-control-center-3.36.1.orig/panels/applications/cc-snap-row.h
+++ gnome-control-center-3.36.1/panels/applications/cc-snap-row.h
@@ -28,8 +28,9 @@ G_BEGIN_DECLS
#define CC_TYPE_SNAP_ROW (cc_snap_row_get_type())
G_DECLARE_FINAL_TYPE (CcSnapRow, cc_snap_row, CC, SNAP_ROW, GtkListBoxRow)
......@@ -263,10 +263,10 @@ index 26563bd8d..d37bb804f 100644
+ GPtrArray *slots);
G_END_DECLS
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 375c06b5a..f3c979c41 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
Index: gnome-control-center-3.36.1/po/POTFILES.in
===================================================================
--- gnome-control-center-3.36.1.orig/po/POTFILES.in
+++ gnome-control-center-3.36.1/po/POTFILES.in
@@ -2,7 +2,6 @@
# Please keep this file sorted alphabetically.
panels/applications/cc-applications-panel.c
......@@ -275,6 +275,3 @@ index 375c06b5a..f3c979c41 100644
panels/applications/gnome-applications-panel.desktop.in.in
panels/background/bg-colors-source.c
panels/background/cc-background-chooser.c
--
2.25.1
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 26 Mar 2020 06:41:06 +0100
Subject: user-panel: Don't wait for fprintd on initialization
When opening the user panel we g-c-c performs lots of sync operations that
may cause a noticeable slowdown, especially when a fingerprint device is
available, in fact set_fingerprint_label() call leads to:
- DBus sync request of the system bus
- fprintd dbus-activation
+ This leads to sync opening of all the devices, that might also cause
a slowdown, depending on the devices drivers
- Dbus sync calls to the device to get the list of enrolled fingerprints
Only after we've a reply, we update the g-c-c UI and continue the execution.
Origin: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/727
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1865845
---
panels/user-accounts/cc-user-panel.c | 41 ++++++-
panels/user-accounts/um-fingerprint-dialog.c | 173 ++++++++++++++++++++-------
panels/user-accounts/um-fingerprint-dialog.h | 12 +-
3 files changed, 173 insertions(+), 53 deletions(-)
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index 7cd3413..18b70e9 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -103,6 +103,9 @@ struct _CcUserPanel {
CcAvatarChooser *avatar_chooser;
+ gboolean needs_fingerprint_update;
+ GCancellable *fingerprint_cancellable;
+
gint other_accounts;
};
@@ -851,9 +854,26 @@ show_user (ActUser *user, CcUserPanel *self)
show = (act_user_get_uid (user) == getuid() &&
act_user_is_local_account (user) &&
(self->login_screen_settings &&
- g_settings_get_boolean (self->login_screen_settings, "enable-fingerprint-authentication")) &&
- set_fingerprint_label (self->fingerprint_state_label));
- gtk_widget_set_visible (GTK_WIDGET (self->fingerprint_row), show);
+ g_settings_get_boolean (self->login_screen_settings,
+ "enable-fingerprint-authentication")));
+
+ if (!self->needs_fingerprint_update) {
+ gtk_widget_set_visible (GTK_WIDGET (self->fingerprint_row), show);
+ } else {
+ gtk_widget_set_visible (GTK_WIDGET (self->fingerprint_row), FALSE);
+
+ if (show) {
+ g_cancellable_cancel (self->fingerprint_cancellable);
+ g_clear_object (&self->fingerprint_cancellable);
+
+ self->fingerprint_cancellable = g_cancellable_new ();
+ self->needs_fingerprint_update = FALSE;
+
+ set_fingerprint_row (GTK_WIDGET (self->fingerprint_row),
+ self->fingerprint_state_label,
+ self->fingerprint_cancellable);
+ }
+ }
/* Autologin: show when local account */
show = act_user_is_local_account (user);
@@ -1088,7 +1108,16 @@ change_fingerprint (CcUserPanel *self)
g_assert (g_strcmp0 (g_get_user_name (), act_user_get_user_name (user)) == 0);
- fingerprint_button_clicked (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))), self->fingerprint_state_label, user);
+ g_cancellable_cancel (self->fingerprint_cancellable);
+ g_clear_object (&self->fingerprint_cancellable);
+
+ self->fingerprint_cancellable = g_cancellable_new ();
+
+ fingerprint_button_clicked (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))),
+ GTK_WIDGET (self->fingerprint_row),
+ self->fingerprint_state_label,
+ user,
+ self->fingerprint_cancellable);
}
static void
@@ -1461,6 +1490,7 @@ cc_user_panel_init (CcUserPanel *self)
gtk_widget_init_template (GTK_WIDGET (self));
self->um = act_user_manager_get_default ();
+ self->needs_fingerprint_update = TRUE;
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider, "/org/gnome/control-center/user-accounts/user-accounts-dialog.css");
@@ -1484,6 +1514,9 @@ cc_user_panel_dispose (GObject *object)
g_clear_object (&self->login_screen_settings);
+ g_cancellable_cancel (self->fingerprint_cancellable);
+ g_clear_object (&self->fingerprint_cancellable);
+
g_clear_pointer ((GtkWidget **)&self->language_chooser, gtk_widget_destroy);
g_clear_object (&self->permission);
G_OBJECT_CLASS (cc_user_panel_parent_class)->dispose (object);
diff --git a/panels/user-accounts/um-fingerprint-dialog.c b/panels/user-accounts/um-fingerprint-dialog.c
index ccbec54..d27aa3b 100644
--- a/panels/user-accounts/um-fingerprint-dialog.c
+++ b/panels/user-accounts/um-fingerprint-dialog.c
@@ -45,12 +45,14 @@ enum {
};
typedef struct {
+ GtkWidget *fingerprint_row;
GtkLabel *state_label;
GtkWidget *ass;
GtkBuilder *dialog;
GDBusProxy *device;
+ GCancellable *cancellable;
gboolean is_swipe;
int num_enroll_stages;
int num_stages_done;
@@ -60,16 +62,19 @@ typedef struct {
} EnrollData;
static void
-ensure_manager (void)
+ensure_manager (GCancellable *cancellable)
{
GError *error = NULL;
if (manager != NULL)
return;
- connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, cancellable, &error);
if (connection == NULL) {
- g_warning ("Failed to connect to session bus: %s", error->message);
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warning ("Failed to connect to session bus: %s",
+ error->message);
+ }
g_error_free (error);
return;
}
@@ -80,16 +85,19 @@ ensure_manager (void)
"net.reactivated.Fprint",
"/net/reactivated/Fprint/Manager",
"net.reactivated.Fprint.Manager",
- NULL,
+ cancellable,
&error);
if (manager == NULL) {
- g_warning ("Failed to create fingerprint manager proxy: %s", error->message);
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warning ("Failed to create fingerprint manager proxy: %s",
+ error->message);
+ }
g_error_free (error);
}
}
static GDBusProxy *
-get_first_device (void)
+get_first_device (GCancellable *cancellable)
{
GDBusProxy *device;
GVariant *result;
@@ -101,7 +109,7 @@ get_first_device (void)
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,
-1,
- NULL,
+ cancellable,
NULL);
if (result == NULL)
return NULL;
@@ -120,10 +128,13 @@ get_first_device (void)
"net.reactivated.Fprint",
device_str,
"net.reactivated.Fprint.Device",
- NULL,
+ cancellable,
&error);
if (device == NULL) {
- g_warning ("Failed to create fingerprint device proxy: %s", error->message);
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warning ("Failed to create fingerprint device proxy: %s",
+ error->message);
+ }
g_error_free (error);
}
@@ -176,28 +187,76 @@ get_error_dialog (const char *title,
return error_dialog;
}
-gboolean
-set_fingerprint_label (GtkLabel *state_label)
+static void
+set_fingerprint_row_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GTask *task;
+ GtkWidget *fingerprint_row;
+ g_autoptr(GtkLabel) state_label = NULL;
+ g_autoptr(GError) error = NULL;
+ gboolean enabled;
+ gboolean visible;
+
+ task = G_TASK (res);
+ fingerprint_row = GTK_WIDGET (source_object);
+ state_label = user_data;
+ enabled = g_task_propagate_boolean (task, &error);
+ visible = TRUE;
+
+ if (error) {
+ visible = FALSE;
+
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warning ("Fingerprint row not available: %s",
+ error->message);
+ }
+ }
+
+ if (enabled) {
+ is_disable = TRUE;
+ gtk_label_set_text (state_label, _("Enabled"));
+ } else {
+ is_disable = FALSE;
+ gtk_label_set_text (state_label, _("Disabled"));
+ }
+
+ gtk_widget_set_visible (fingerprint_row, visible);
+}
+
+static void
+set_fingerprint_task_func (GTask *task,
+ gpointer source_object,
+ gpointer task_data,
+ GCancellable *cancellable)
{
GDBusProxy *device;
GVariant *result;
GVariantIter *fingers;
GError *error = NULL;
- ensure_manager ();
- if (manager == NULL)
- return FALSE;
+ ensure_manager (cancellable);
+ if (manager == NULL) {
+ g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Impossible to get fprintd manager");
+ return;
+ }
- device = get_first_device ();
- if (device == NULL)
- return FALSE;
+ device = get_first_device (cancellable);
+ if (device == NULL) {
+ g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Impossible to get fprintd device");
+ return;
+ }
- result = g_dbus_proxy_call_sync (device, "ListEnrolledFingers", g_variant_new ("(s)", ""), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
+ result = g_dbus_proxy_call_sync (device, "ListEnrolledFingers", g_variant_new ("(s)", ""), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, &error);
if (!result) {
if (!g_dbus_error_is_remote_error (error) ||
strcmp (g_dbus_error_get_remote_error(error), "net.reactivated.Fprint.Error.NoEnrolledPrints") != 0) {
g_object_unref (device);
- return FALSE;
+ g_task_return_error (task, error);
+ return;
}
}
@@ -206,12 +265,13 @@ set_fingerprint_label (GtkLabel *state_label)
else
fingers = NULL;
+ if (g_task_return_error_if_cancelled (task))
+ return;
+
if (fingers == NULL || g_variant_iter_n_children (fingers) == 0) {
- is_disable = FALSE;
- gtk_label_set_text (state_label, _("Disabled"));
+ g_task_return_boolean (task, FALSE);
} else {
- is_disable = TRUE;
- gtk_label_set_text (state_label, _("Enabled"));
+ g_task_return_boolean (task, TRUE);
}
if (result != NULL)
@@ -219,25 +279,35 @@ set_fingerprint_label (GtkLabel *state_label)
if (fingers != NULL)
g_variant_iter_free (fingers);
g_object_unref (device);
+}
- return TRUE;
+void
+set_fingerprint_row (GtkWidget *row,
+ GtkLabel *state_label,
+ GCancellable *cancellable)
+{
+ g_autoptr(GTask) task = NULL;
+
+ task = g_task_new (row, cancellable, set_fingerprint_row_cb,
+ g_object_ref (state_label));
+ g_task_run_in_thread (task, set_fingerprint_task_func);
}
static void
-delete_fingerprints (void)
+delete_fingerprints (GCancellable *cancellable)
{
GDBusProxy *device;
GVariant *result;
- ensure_manager ();
+ ensure_manager (cancellable);
if (manager == NULL)
return;
- device = get_first_device ();
+ device = get_first_device (cancellable);
if (device == NULL)
return;
- result = g_dbus_proxy_call_sync (device, "DeleteEnrolledFingers", g_variant_new ("(s)", ""), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
+ result = g_dbus_proxy_call_sync (device, "DeleteEnrolledFingers", g_variant_new ("(s)", ""), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, NULL);
if (result)
g_variant_unref (result);
@@ -245,9 +315,11 @@ delete_fingerprints (void)
}
static void
-delete_fingerprints_question (GtkWindow *parent,
- GtkLabel *state_label,
- ActUser *user)
+delete_fingerprints_question (GtkWindow *parent,
+ GtkWidget *fingerprint_row,
+ GtkLabel *state_label,
+ ActUser *user,
+ GCancellable *cancellable)
{
GtkWidget *question;
GtkWidget *button;
@@ -270,8 +342,8 @@ delete_fingerprints_question (GtkWindow *parent,
gtk_dialog_set_default_response (GTK_DIALOG (question), GTK_RESPONSE_OK);
if (gtk_dialog_run (GTK_DIALOG (question)) == GTK_RESPONSE_OK) {
- delete_fingerprints ();
- set_fingerprint_label (state_label);
+ delete_fingerprints (cancellable);
+ set_fingerprint_row (fingerprint_row, state_label, cancellable);
}
gtk_widget_destroy (question);
@@ -339,6 +411,7 @@ enroll_data_destroy (EnrollData *data)
g_free (data->name);
g_object_unref (data->device);
g_object_unref (data->dialog);
+ g_object_unref (data->cancellable);
gtk_widget_destroy (data->ass);
g_free (data);
@@ -413,10 +486,12 @@ finger_combobox_changed (GtkComboBox *combobox, EnrollData *data)
static void
assistant_cancelled (GtkAssistant *ass, EnrollData *data)
{
+ GtkWidget *fingerprint_row = data->fingerprint_row;
GtkLabel *state_label = data->state_label;
+ GCancellable *cancellable = data->cancellable;
enroll_data_destroy (data);
- set_fingerprint_label (state_label);
+ set_fingerprint_row (fingerprint_row, state_label, cancellable);
}
static void
@@ -605,9 +680,11 @@ assistant_prepare (GtkAssistant *ass, GtkWidget *page, EnrollData *data)
}
static void
-enroll_fingerprints (GtkWindow *parent,
- GtkLabel *state_label,
- ActUser *user)
+enroll_fingerprints (GtkWindow *parent,
+ GtkWidget *fingerprint_row,
+ GtkLabel *state_label,
+ ActUser *user,
+ GCancellable *cancellable)
{
GDBusProxy *device = NULL;
GtkBuilder *dialog;
@@ -617,9 +694,9 @@ enroll_fingerprints (GtkWindow *parent,
GVariant *result;
GError *error = NULL;
- ensure_manager ();
+ ensure_manager (cancellable);
if (manager != NULL)
- device = get_first_device ();
+ device = get_first_device (cancellable);
if (manager == NULL || device == NULL) {
GtkWidget *d;
@@ -634,6 +711,8 @@ enroll_fingerprints (GtkWindow *parent,
data = g_new0 (EnrollData, 1);
data->device = device;
+ data->cancellable = g_object_ref (cancellable);
+ data->fingerprint_row = fingerprint_row;
data->state_label = state_label;
/* Get some details about the device */
@@ -646,7 +725,7 @@ enroll_fingerprints (GtkWindow *parent,
G_VARIANT_TYPE ("(a{sv})"),
G_DBUS_CALL_FLAGS_NONE,
-1,
- NULL,
+ cancellable,
NULL);
if (result) {
GVariant *props;
@@ -733,17 +812,21 @@ enroll_fingerprints (GtkWindow *parent,
}
void
-fingerprint_button_clicked (GtkWindow *parent,
- GtkLabel *state_label,
- ActUser *user)
+fingerprint_button_clicked (GtkWindow *parent,
+ GtkWidget *fingerprint_row,
+ GtkLabel *state_label,
+ ActUser *user,
+ GCancellable *cancellable)
{
bindtextdomain ("fprintd", GNOMELOCALEDIR);
bind_textdomain_codeset ("fprintd", "UTF-8");
if (is_disable != FALSE) {
- delete_fingerprints_question (parent, state_label, user);
+ delete_fingerprints_question (parent, fingerprint_row,
+ state_label, user, cancellable);
} else {
- enroll_fingerprints (parent, state_label, user);
+ enroll_fingerprints (parent, fingerprint_row, state_label, user,
+ cancellable);
}
}
diff --git a/panels/user-accounts/um-fingerprint-dialog.h b/panels/user-accounts/um-fingerprint-dialog.h
index a1f6afc..09dbf51 100644
--- a/panels/user-accounts/um-fingerprint-dialog.h
+++ b/panels/user-accounts/um-fingerprint-dialog.h
@@ -20,7 +20,11 @@
#include <gtk/gtk.h>
#include <act/act.h>
-gboolean set_fingerprint_label (GtkLabel *state_label);
-void fingerprint_button_clicked (GtkWindow *parent,
- GtkLabel *state_label,
- ActUser *user);
+void set_fingerprint_row (GtkWidget *fingerprint_row,
+ GtkLabel *state_label,
+ GCancellable *cancellable);
+void fingerprint_button_clicked (GtkWindow *parent,
+ GtkWidget *fingerprint_row,
+ GtkLabel *state_label,
+ ActUser *user,
+ GCancellable *cancellable);
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Fri, 3 Apr 2020 18:00:30 +0200
Subject: fingerprint-dialog: Don't use sync calls for deleting fingerprints
Don't make the UI to block while deleting the saved prints (that might take
some time, especially for devices with internal storage) but just use a task
with a thread that:
- Mark the fingerprint row as unsenstive
- Calls the method to delete prints
- In the same thread, calls the method to fetch the updated informations
- Returns in set_fingerprint_row_cb where we update the UI again
Again this would be nicer to be done just using async calls but this is
something to do in some bigger refactor.
Origin: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/727
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1865845
---
panels/user-accounts/um-fingerprint-dialog.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/panels/user-accounts/um-fingerprint-dialog.c b/panels/user-accounts/um-fingerprint-dialog.c
index d27aa3b..5ae8f27 100644
--- a/panels/user-accounts/um-fingerprint-dialog.c
+++ b/panels/user-accounts/um-fingerprint-dialog.c
@@ -222,6 +222,7 @@ set_fingerprint_row_cb (GObject *source_object,
gtk_label_set_text (state_label, _("Disabled"));
}
+ gtk_widget_set_sensitive (fingerprint_row, TRUE);
gtk_widget_set_visible (fingerprint_row, visible);
}
@@ -294,7 +295,10 @@ set_fingerprint_row (GtkWidget *row,
}
static void
-delete_fingerprints (GCancellable *cancellable)
+delete_fingerprint_task_func (GTask *task,
+ gpointer source_object,
+ gpointer task_data,
+ GCancellable *cancellable)
{
GDBusProxy *device;
GVariant *result;
@@ -312,6 +316,8 @@ delete_fingerprints (GCancellable *cancellable)
g_variant_unref (result);
g_object_unref (device);
+
+ set_fingerprint_task_func (task, source_object, task_data, cancellable);
}
static void
@@ -342,8 +348,14 @@ delete_fingerprints_question (GtkWindow *parent,
gtk_dialog_set_default_response (GTK_DIALOG (question), GTK_RESPONSE_OK);
if (gtk_dialog_run (GTK_DIALOG (question)) == GTK_RESPONSE_OK) {
- delete_fingerprints (cancellable);
- set_fingerprint_row (fingerprint_row, state_label, cancellable);
+ g_autoptr(GTask) task = NULL;
+
+ gtk_widget_set_sensitive (fingerprint_row, FALSE);
+
+ task = g_task_new (fingerprint_row, cancellable,
+ set_fingerprint_row_cb,
+ g_object_ref (state_label));
+ g_task_run_in_thread (task, delete_fingerprint_task_func);
}
gtk_widget_destroy (question);
This diff is collapsed.
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Wed, 15 Apr 2020 00:52:13 +0200
Subject: fingerprint-dialog: Don't limit the number of maximum enroll stages
There are devices with more than 10 enroll stages we should handle, so
instead of hardcoding a grid of images, let's just build this dynamically
using a flowbox
Origin: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/727
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1865845
---
panels/user-accounts/data/account-fingerprint.ui | 123 ++---------------------
panels/user-accounts/um-fingerprint-dialog.c | 45 +++++----
2 files changed, 35 insertions(+), 133 deletions(-)
diff --git a/panels/user-accounts/data/account-fingerprint.ui b/panels/user-accounts/data/account-fingerprint.ui
index 969f7ca..02ae182 100644
--- a/panels/user-accounts/data/account-fingerprint.ui
+++ b/panels/user-accounts/data/account-fingerprint.ui
@@ -182,60 +182,19 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="enroll_hbox">
+ <object class="GtkFlowBox" id="enroll-flowbox">
<property name="visible">True</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
- <child>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image3">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image4">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image5">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">5</property>
- </packing>
- </child>
+ <property name="row-spacing">40</property>
+ <property name="column-spacing">100</property>
+ <property name="homogeneous">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="min-children-per-line">1</property>
+ <property name="max-children-per-line">5</property>
+ <property name="selection-mode">none</property>
+ <property name="focus-on-click">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -243,68 +202,6 @@
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkHBox" id="enroll2_hbox">
- <property name="visible">True</property>
- <property name="margin-top">24</property>
- <property name="margin-bottom">24</property>
- <child>
- <object class="GtkImage" id="image6">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image7">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image8">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image9">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image10">
- <property name="visible">True</property>
- <property name="stock">gtk-no</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="position">5</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
<child>
<object class="GtkLabel" id="status-label">
<property name="visible">True</property>
diff --git a/panels/user-accounts/um-fingerprint-dialog.c b/panels/user-accounts/um-fingerprint-dialog.c
index 5ae8f27..05a809c 100644
--- a/panels/user-accounts/um-fingerprint-dialog.c
+++ b/panels/user-accounts/um-fingerprint-dialog.c
@@ -31,9 +31,6 @@
#define TR(s) dgettext("fprintd", s)
#include "fingerprint-strings.h"
-/* This must match the number of images on the 2nd page in the UI file */
-#define MAX_ENROLL_STAGES 10
-
static GDBusProxy *manager = NULL;
static GDBusConnection *connection = NULL;
static gboolean is_disable = FALSE;
@@ -513,14 +510,17 @@ enroll_result (EnrollData *data, const char *result, gboolean done)
char *msg;
if (g_str_equal (result, "enroll-completed") || g_str_equal (result, "enroll-stage-passed")) {
- char *name, *path;
+ GtkFlowBoxChild *child;
+ const char *path;
data->num_stages_done++;
- name = g_strdup_printf ("image%d", data->num_stages_done);
- path = g_strdup_printf ("/org/gnome/control-center/user-accounts/print_ok.png");
- gtk_image_set_from_resource (GTK_IMAGE (WID (name)), path);
- g_free (name);
- g_free (path);
+ path = "/org/gnome/control-center/user-accounts/print_ok.png";
+ child = gtk_flow_box_get_child_at_index (GTK_FLOW_BOX (WID ("enroll-flowbox")),
+ data->num_stages_done - 1);
+ if (child) {
+ GtkImage *image = GTK_IMAGE (gtk_bin_get_child (GTK_BIN (child)));
+ gtk_image_set_from_resource (image, path);
+ }
}
if (g_str_equal (result, "enroll-completed")) {
gtk_label_set_text (GTK_LABEL (WID ("status-label")), _("Done!"));
@@ -572,6 +572,7 @@ assistant_prepare (GtkAssistant *ass, GtkWidget *page, EnrollData *data)
if (g_str_equal (name, "enroll")) {
GError *error = NULL;
GtkBuilder *dialog = data->dialog;
+ GtkWidget *enroll_flowbox;
char *path;
guint i;
GVariant *result;
@@ -637,27 +638,30 @@ assistant_prepare (GtkAssistant *ass, GtkWidget *page, EnrollData *data)
}
data->num_enroll_stages = num_enroll_stages;
+ enroll_flowbox = WID ("enroll-flowbox");
/* Hide the extra "bulbs" if not needed */
- for (i = MAX_ENROLL_STAGES; i > data->num_enroll_stages; i--) {
- char *name;
-
- name = g_strdup_printf ("image%d", i);
- gtk_widget_hide (WID (name));
- g_free (name);
- }
/* And set the right image */
{
path = g_strdup_printf ("/org/gnome/control-center/user-accounts/%s.png", data->finger);
}
for (i = 1; i <= data->num_enroll_stages; i++) {
- char *name;
- name = g_strdup_printf ("image%d", i);
- gtk_image_set_from_resource (GTK_IMAGE (WID (name)), path);
- g_free (name);
+ GtkWidget *image;
+ GtkFlowBoxChild *child;
+
+ child = gtk_flow_box_get_child_at_index (GTK_FLOW_BOX (enroll_flowbox), i-1);
+ if (child) {
+ image = gtk_bin_get_child (GTK_BIN (child));
+ gtk_image_set_from_resource (GTK_IMAGE (image), path);
+ } else {
+ image = gtk_image_new_from_resource (path);
+ gtk_container_add (GTK_CONTAINER (enroll_flowbox), image);
+ gtk_widget_set_visible (image, TRUE);
+ }
}
g_free (path);
+ g_signal_handlers_disconnect_by_func (data->device, device_signal_cb, data);
g_signal_connect (data->device, "g-signal", G_CALLBACK (device_signal_cb), data);
if (!enroll_start (data, &error)) {
@@ -678,6 +682,7 @@ assistant_prepare (GtkAssistant *ass, GtkWidget *page, EnrollData *data)
return;
}
+ data->num_stages_done = 0;
data->state = STATE_ENROLLING;;
} else {
if (data->state == STATE_ENROLLING) {
From cb98517010f7363dc60b6505ab6a2dd0ed740129 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 8 Apr 2020 14:13:45 +0200
Subject: [PATCH] info-overview: Verify data coming from switcheroo-control
Don't crash if the data coming from switcheroo-control is somehow
garbage, and make sure that we actually got pairs of key-values.
Closes: #944
---
panels/info-overview/cc-info-overview-panel.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
index af04dc660..9e7c1b377 100644
--- a/panels/info-overview/cc-info-overview-panel.c
+++ b/panels/info-overview/cc-info-overview-panel.c
@@ -251,7 +251,7 @@ get_renderer_from_helper (const char **env)
guint i;
g_debug ("With environment:");
envp = g_get_environ ();
- for (i = 0; env[i] != NULL; i = i + 2)
+ for (i = 0; env != NULL && env[i] != NULL; i = i + 2)
{
g_debug (" %s = %s", env[i], env[i+1]);
envp = g_environ_setenv (envp, env[i], env[i+1], TRUE);
@@ -343,8 +343,9 @@ get_renderer_from_switcheroo (void)
g_autoptr(GVariant) name = NULL;
g_autoptr(GVariant) env = NULL;
g_autoptr(GVariant) default_variant = NULL;
- const char *name_s;
+ const char *name_s = 0;
g_autofree const char **env_s = NULL;
+ gsize env_len;
g_autofree char *renderer = NULL;
GpuData *gpu_data;
@@ -359,7 +360,15 @@ get_renderer_from_switcheroo (void)
continue;
name_s = g_variant_get_string (name, NULL);
g_debug ("Getting renderer from helper for GPU '%s'", name_s);
- env_s = g_variant_get_strv (env, NULL);
+ env_s = g_variant_get_strv (env, &env_len);
+ if (env_s != NULL && env_len % 2 != 0)
+ {
+ g_autofree char *debug = NULL;
+ debug = g_strjoinv ("\n", (char **) env_s);
+ g_warning ("Invalid environment returned from switcheroo:\n%s", debug);
+ g_clear_pointer (&env_s, g_free);
+ }
+
renderer = get_renderer_from_helper (env_s);
default_variant = g_variant_lookup_value (gpu, "Default", NULL);
--
2.24.1
From d82f241a9f1f639326ee8b2c0fd58312ddf61abe Mon Sep 17 00:00:00 2001
From: Robert Ancell <robert.ancell@canonical.com>
Date: Tue, 14 Apr 2020 11:04:05 +1200
Subject: [PATCH] display: Add missing parameter checks on CcDisplayConfig
methods
Closes #945
---
panels/display/cc-display-config.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/panels/display/cc-display-config.c b/panels/display/cc-display-config.c
index 30c97c450..80aabc4f1 100644
--- a/panels/display/cc-display-config.c
+++ b/panels/display/cc-display-config.c
@@ -614,6 +614,7 @@ cc_display_config_set_minimum_size (CcDisplayConfig *self,
int width,
int height)
{
+ g_return_if_fail (CC_IS_DISPLAY_CONFIG (self));
CC_DISPLAY_CONFIG_GET_CLASS (self)->set_minimum_size (self, width, height);
}
@@ -622,5 +623,7 @@ cc_display_config_is_scaled_mode_valid (CcDisplayConfig *self,
CcDisplayMode *mode,
double scale)
{
+ g_return_val_if_fail (CC_IS_DISPLAY_CONFIG (self), FALSE);
+ g_return_val_if_fail (CC_IS_DISPLAY_MODE (mode), FALSE);
return CC_DISPLAY_CONFIG_GET_CLASS (self)->is_scaled_mode_valid (self, mode, scale);
}
--
2.24.1
# Upstream
0001-sound-Fix-translation-of-System-Sounds.patch
git-info-crash-on-nvidia.patch
# on master only
git-nongnome-segfault.patch
# Ubuntu changes
0001-Expose-touchpad-settings-if-synaptics-is-in-use.patch
......@@ -30,4 +33,9 @@
0026-applications-Launch-snap-store-if-it-is-installed.patch
0027-window-Stop-using-HdyLeaflet.patch
0028-applications-Fix-only-connected-snap-interfaces-show.patch
0028-user-panel-Add-reference-to-selected-user-and-clear-.patch
0029-applications-Use-new-snapd-glib-API-for-labelling-Sn.patch
0029-user-panel-Don-t-wait-for-fprintd-on-initialization.patch
0030-temporarily-revert-alt-char-key.patch
0030-fingerprint-dialog-Don-t-use-sync-calls-for-deleting.patch
0031-fingerprint-dialog-Don-t-limit-the-number-of-maximum.patch