From 9a32586cafe48f57a879b2bc1323ad397752115b Mon Sep 17 00:00:00 2001 From: Gerben Jan Dijkman Date: Mon, 22 Aug 2022 22:37:35 +0200 Subject: [PATCH] Added patches --- ...-system-prompt-allow-blank-passwords.patch | 49 +++ .../phosh/files/0002-fix-locale-issue.patch | 14 + ...003-fix-locale-issue-in-service-file.patch | 22 + gui-wm/phosh/files/1008.patch | 375 ++++++++++++++++++ gui-wm/phosh/files/977.patch | 51 +++ gui-wm/phosh/phosh-0.20.0.ebuild | 6 + 6 files changed, 517 insertions(+) create mode 100644 gui-wm/phosh/files/0001-system-prompt-allow-blank-passwords.patch create mode 100644 gui-wm/phosh/files/0002-fix-locale-issue.patch create mode 100644 gui-wm/phosh/files/0003-fix-locale-issue-in-service-file.patch create mode 100644 gui-wm/phosh/files/1008.patch create mode 100644 gui-wm/phosh/files/977.patch diff --git a/gui-wm/phosh/files/0001-system-prompt-allow-blank-passwords.patch b/gui-wm/phosh/files/0001-system-prompt-allow-blank-passwords.patch new file mode 100644 index 0000000..e10824d --- /dev/null +++ b/gui-wm/phosh/files/0001-system-prompt-allow-blank-passwords.patch @@ -0,0 +1,49 @@ +From e88f5dee0cbb7fa0851b43a5ded5d94256c756d2 Mon Sep 17 00:00:00 2001 +From: Arnaud Ferraris +Date: Sat, 21 Mar 2020 03:00:34 +0100 +Subject: [PATCH] system-prompt: allow blank passwords + +--- + src/system-prompt.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/src/system-prompt.c b/src/system-prompt.c +index 30aa3f1..bd06ee0 100644 +--- a/src/system-prompt.c ++++ b/src/system-prompt.c +@@ -256,8 +256,6 @@ phosh_system_prompt_password_async (GcrPrompt *prompt, + priv->task = g_task_new (self, NULL, callback, user_data); + g_task_set_source_tag (priv->task, phosh_system_prompt_password_async); + +- if (!gtk_entry_get_text_length (GTK_ENTRY (priv->entry_password))) +- gtk_widget_set_sensitive (priv->btn_continue, FALSE); + gtk_widget_set_sensitive (priv->grid, TRUE); + + obj = G_OBJECT (self); +@@ -315,7 +313,6 @@ phosh_system_prompt_confirm_async (GcrPrompt *prompt, + priv->task = g_task_new (self, NULL, callback, user_data); + g_task_set_source_tag (priv->task, phosh_system_prompt_confirm_async); + +- gtk_widget_set_sensitive (priv->btn_continue, TRUE); + gtk_widget_set_sensitive (priv->grid, TRUE); + + obj = G_OBJECT (self); +@@ -392,7 +389,6 @@ prompt_complete (PhoshSystemPrompt *self) + g_task_return_pointer (res, (gpointer)password, NULL); + g_object_unref (res); + +- gtk_widget_set_sensitive (priv->btn_continue, FALSE); + gtk_widget_set_sensitive (priv->grid, FALSE); + + return TRUE; +@@ -451,7 +447,6 @@ on_password_changed (PhoshSystemPrompt *self, + if (!gtk_entry_get_text_length (GTK_ENTRY (editable))) + return; + +- gtk_widget_set_sensitive (priv->btn_continue, TRUE); + password = gtk_entry_get_text (GTK_ENTRY (editable)); + + /* +-- +2.24.1 + diff --git a/gui-wm/phosh/files/0002-fix-locale-issue.patch b/gui-wm/phosh/files/0002-fix-locale-issue.patch new file mode 100644 index 0000000..9d2d3a0 --- /dev/null +++ b/gui-wm/phosh/files/0002-fix-locale-issue.patch @@ -0,0 +1,14 @@ +diff -Npur a/data/phosh.in b/data/phosh.in +--- a/data/phosh.in 2021-03-20 13:53:32.367786000 +0100 ++++ b/data/phosh.in 2021-03-20 13:55:19.327789721 +0100 +@@ -56,6 +56,10 @@ elif [ -f /etc/phosh/rootston.ini ]; th + PHOC_INI=/etc/phosh/rootston.ini + fi + ++# Set proper locale according to /etc/locale.conf ++source /etc/locale.conf ++export LANG=$LANG ++ + # Run gnome-session through a login shell so it picks + # variables from /etc/profile.d (XDG_*) + [ -n "$WLR_BACKENDS" ] || WLR_BACKENDS=drm,libinput diff --git a/gui-wm/phosh/files/0003-fix-locale-issue-in-service-file.patch b/gui-wm/phosh/files/0003-fix-locale-issue-in-service-file.patch new file mode 100644 index 0000000..a8da1d2 --- /dev/null +++ b/gui-wm/phosh/files/0003-fix-locale-issue-in-service-file.patch @@ -0,0 +1,22 @@ +From: Daniel Dehennin +Date: Wed, 17 Mar 2021 17:38:58 +0100 +Subject: Fix locale issue in Service file + +* data/phosh.service (Environment): do not override user language + setting. +--- + data/phosh.service | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/data/phosh.service b/data/phosh.service +index fa18137..a585696 100644 +--- a/data/phosh.service ++++ b/data/phosh.service +@@ -25,7 +25,6 @@ Before=graphical.target + ConditionPathExists=/dev/tty0 + + [Service] +-Environment=LANG=C.UTF-8 + Environment=XDG_CURRENT_DESKTOP=Phosh:GNOME + Environment=XDG_SESSION_DESKTOP=phosh + Environment=XDG_SESSION_TYPE=wayland diff --git a/gui-wm/phosh/files/1008.patch b/gui-wm/phosh/files/1008.patch new file mode 100644 index 0000000..fb9f960 --- /dev/null +++ b/gui-wm/phosh/files/1008.patch @@ -0,0 +1,375 @@ +From 91637428127909ebabf3ea3ce7f6e251fd9e0382 Mon Sep 17 00:00:00 2001 +From: Adrien Plazas +Date: Tue, 18 Jan 2022 11:24:10 +0100 +Subject: [PATCH 1/2] app-grid-button: Add the adaptive property + +If false, the button will show an icon denoting desktop support only. +--- + data/icons/desktop-thin-small-symbolic.svg | 4 ++ + src/app-grid-button.c | 63 +++++++++++++++++++++- + src/app-grid-button.h | 3 ++ + src/phosh.gresources.xml | 1 + + src/ui/app-grid-button.ui | 25 +++++++-- + 5 files changed, 89 insertions(+), 7 deletions(-) + create mode 100644 data/icons/desktop-thin-small-symbolic.svg + +diff --git a/data/icons/desktop-thin-small-symbolic.svg b/data/icons/desktop-thin-small-symbolic.svg +new file mode 100644 +index 000000000..46111bd10 +--- /dev/null ++++ b/data/icons/desktop-thin-small-symbolic.svg +@@ -0,0 +1,4 @@ ++ ++ ++ ++ +diff --git a/src/app-grid-button.c b/src/app-grid-button.c +index f65c00b87..e66401772 100644 +--- a/src/app-grid-button.c ++++ b/src/app-grid-button.c +@@ -22,12 +22,15 @@ struct _PhoshAppGridButtonPrivate { + GAppInfo *info; + gboolean is_favorite; + PhoshAppGridButtonMode mode; ++ gboolean adaptive; + + gulong favorite_changed_watcher; + ++ GtkWidget *form_factor_desktop; + GtkWidget *icon; + GtkWidget *label; + GtkWidget *popover; ++ GtkWidget *title_box; + GtkGesture *gesture; + + GMenu *menu; +@@ -43,6 +46,7 @@ enum { + PROP_APP_INFO, + PROP_IS_FAVORITE, + PROP_MODE, ++ PROP_ADAPTIVE, + LAST_PROP + }; + static GParamSpec *props[LAST_PROP]; +@@ -68,6 +72,9 @@ phosh_app_grid_button_set_property (GObject *object, + case PROP_MODE: + phosh_app_grid_button_set_mode (self, g_value_get_enum (value)); + break; ++ case PROP_ADAPTIVE: ++ phosh_app_grid_button_set_adaptive (self, g_value_get_boolean (value)); ++ break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; +@@ -93,6 +100,9 @@ phosh_app_grid_button_get_property (GObject *object, + case PROP_MODE: + g_value_set_enum (value, phosh_app_grid_button_get_mode (self)); + break; ++ case PROP_ADAPTIVE: ++ g_value_set_boolean (value, phosh_app_grid_button_get_adaptive (self)); ++ break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; +@@ -229,14 +239,31 @@ phosh_app_grid_button_class_init (PhoshAppGridButtonClass *klass) + G_PARAM_READWRITE | + G_PARAM_EXPLICIT_NOTIFY); + ++ /** ++ * PhoshAppGridButton:adaptive: ++ * ++ * Whether to set the button in adaptive mode. ++ * ++ * An icon will be shown when the app is expected to not adjust to a phone's ++ * screen size. ++ */ ++ props[PROP_ADAPTIVE] = ++ g_param_spec_boolean ("adaptive", "", "", ++ FALSE, ++ G_PARAM_STATIC_STRINGS | ++ G_PARAM_READWRITE | ++ G_PARAM_EXPLICIT_NOTIFY); ++ + + g_object_class_install_properties (object_class, LAST_PROP, props); + + gtk_widget_class_set_template_from_resource (widget_class, "/sm/puri/phosh/ui/app-grid-button.ui"); + ++ gtk_widget_class_bind_template_child_private (widget_class, PhoshAppGridButton, form_factor_desktop); + gtk_widget_class_bind_template_child_private (widget_class, PhoshAppGridButton, icon); + gtk_widget_class_bind_template_child_private (widget_class, PhoshAppGridButton, label); + gtk_widget_class_bind_template_child_private (widget_class, PhoshAppGridButton, popover); ++ gtk_widget_class_bind_template_child_private (widget_class, PhoshAppGridButton, title_box); + + gtk_widget_class_bind_template_child_private (widget_class, PhoshAppGridButton, menu); + gtk_widget_class_bind_template_child_private (widget_class, PhoshAppGridButton, actions); +@@ -555,10 +582,10 @@ phosh_app_grid_button_set_mode (PhoshAppGridButton *self, + + switch (mode) { + case PHOSH_APP_GRID_BUTTON_LAUNCHER: +- gtk_widget_set_visible (priv->label, TRUE); ++ gtk_widget_set_visible (priv->title_box, TRUE); + break; + case PHOSH_APP_GRID_BUTTON_FAVORITES: +- gtk_widget_set_visible (priv->label, FALSE); ++ gtk_widget_set_visible (priv->title_box, FALSE); + break; + default: + g_critical ("Invalid mode %i", mode); +@@ -581,3 +608,35 @@ phosh_app_grid_button_get_mode (PhoshAppGridButton *self) + + return priv->mode; + } ++ ++ ++void ++phosh_app_grid_button_set_adaptive (PhoshAppGridButton *self, ++ gboolean adaptive) ++{ ++ PhoshAppGridButtonPrivate *priv; ++ ++ g_return_if_fail (PHOSH_IS_APP_GRID_BUTTON (self)); ++ priv = phosh_app_grid_button_get_instance_private (self); ++ ++ adaptive = !!adaptive; ++ ++ if (priv->adaptive == adaptive) ++ return; ++ ++ priv->adaptive = adaptive; ++ ++ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ADAPTIVE]); ++} ++ ++ ++gboolean ++phosh_app_grid_button_get_adaptive (PhoshAppGridButton *self) ++{ ++ PhoshAppGridButtonPrivate *priv; ++ ++ g_return_val_if_fail (PHOSH_IS_APP_GRID_BUTTON (self), FALSE); ++ priv = phosh_app_grid_button_get_instance_private (self); ++ ++ return priv->adaptive; ++} +diff --git a/src/app-grid-button.h b/src/app-grid-button.h +index 3e409f75c..7db4c3f51 100644 +--- a/src/app-grid-button.h ++++ b/src/app-grid-button.h +@@ -51,5 +51,8 @@ gboolean phosh_app_grid_button_is_favorite (PhoshAppGridButton + void phosh_app_grid_button_set_mode (PhoshAppGridButton *self, + PhoshAppGridButtonMode mode); + PhoshAppGridButtonMode phosh_app_grid_button_get_mode (PhoshAppGridButton *self); ++void phosh_app_grid_button_set_adaptive (PhoshAppGridButton *self, ++ gboolean adaptive); ++gboolean phosh_app_grid_button_get_adaptive (PhoshAppGridButton *self); + + G_END_DECLS +diff --git a/src/phosh.gresources.xml b/src/phosh.gresources.xml +index 692f5e09d..7e53285f4 100644 +--- a/src/phosh.gresources.xml ++++ b/src/phosh.gresources.xml +@@ -37,6 +37,7 @@ + ../data/icons/auth-sim-locked-symbolic.svg + ../data/icons/auth-sim-missing-symbolic.svg + ../data/icons/camera-hardware-disabled-symbolic.svg ++ ../data/icons/desktop-thin-small-symbolic.svg + ../data/icons/eye-not-looking-symbolic.svg + ../data/icons/eye-open-negative-filled-symbolic.svg + ../data/icons/feedback-quiet-symbolic.svg +diff --git a/src/ui/app-grid-button.ui b/src/ui/app-grid-button.ui +index 98a017086..08fc0bdbc 100644 +--- a/src/ui/app-grid-button.ui ++++ b/src/ui/app-grid-button.ui +@@ -48,12 +48,27 @@ + + + +- +- True +- False +- True +- App ++ + center ++ True ++ 4 ++ True ++ ++ ++ desktop-thin-small-symbolic ++ 8 ++ ++ ++ ++ ++ ++ True ++ False ++ True ++ App ++ center ++ ++ + + + False +-- +GitLab + + +From b10f431e139e8c258aa93eff010be6847d90c333 Mon Sep 17 00:00:00 2001 +From: Adrien Plazas +Date: Wed, 26 Jan 2022 13:46:41 +0100 +Subject: [PATCH 2/2] app-grid: Show a desktop icon on non-adaptive apps + +This helps knowing which apps work everywhere and which ones only work +on desktops. +--- + src/app-grid.c | 68 +++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 48 insertions(+), 20 deletions(-) + +diff --git a/src/app-grid.c b/src/app-grid.c +index 276f08485..a6dd1a9a5 100644 +--- a/src/app-grid.c ++++ b/src/app-grid.c +@@ -146,6 +146,45 @@ update_filter_adaptive_button (PhoshAppGrid *self) + } + + ++static gboolean ++app_is_adaptive (PhoshAppGrid *self, GDesktopAppInfo *info) ++{ ++ PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self); ++ g_autofree char *mobile = NULL; ++ const char *id; ++ ++ mobile = g_desktop_app_info_get_string (G_DESKTOP_APP_INFO (info), ++ "X-Purism-FormFactor"); ++ if (mobile && strcasestr (mobile, "mobile;")) ++ return TRUE; ++ ++ g_free (mobile); ++ mobile = g_desktop_app_info_get_string (G_DESKTOP_APP_INFO (info), ++ "X-KDE-FormFactor"); ++ if (mobile && strcasestr (mobile, "handset;")) ++ return TRUE; ++ ++ id = g_app_info_get_id (G_APP_INFO (info)); ++ if (id && priv->force_adaptive && g_strv_contains ((const char * const*)priv->force_adaptive, id)) ++ return TRUE; ++ ++ return FALSE; ++} ++ ++ ++static void ++update_app_button_adaptive (GtkWidget *widget, ++ gpointer data) ++{ ++ PhoshAppGridButton *button = PHOSH_APP_GRID_BUTTON (widget); ++ PhoshAppGrid *self = PHOSH_APP_GRID (data); ++ GAppInfo *info = phosh_app_grid_button_get_app_info (button); ++ gboolean adaptive = app_is_adaptive (self, G_DESKTOP_APP_INFO (info)); ++ ++ phosh_app_grid_button_set_adaptive (button, adaptive); ++} ++ ++ + static void + on_filter_setting_changed (PhoshAppGrid *self, + GParamSpec *pspec, +@@ -158,7 +197,7 @@ on_filter_setting_changed (PhoshAppGrid *self, + + priv = phosh_app_grid_get_instance_private (self); + +- g_strfreev (priv->force_adaptive); ++ g_clear_pointer (&priv->force_adaptive, g_strfreev); + priv->force_adaptive = g_settings_get_strv (priv->settings, + "force-adaptive"); + priv->filter_mode = g_settings_get_flags (priv->settings, +@@ -168,6 +207,8 @@ on_filter_setting_changed (PhoshAppGrid *self, + gtk_widget_set_visible (priv->btn_adaptive, show); + + gtk_filter_list_model_refilter (priv->model); ++ ++ gtk_container_foreach (GTK_CONTAINER (priv->apps), update_app_button_adaptive, self); + } + + +@@ -175,8 +216,6 @@ static gboolean + filter_adaptive (PhoshAppGrid *self, GDesktopAppInfo *info) + { + PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self); +- g_autofree char *mobile = NULL; +- const char *id; + + if (!(priv->filter_mode & PHOSH_APP_FILTER_MODE_FLAGS_ADAPTIVE)) + return TRUE; +@@ -184,22 +223,7 @@ filter_adaptive (PhoshAppGrid *self, GDesktopAppInfo *info) + if (!priv->filter_adaptive) + return TRUE; + +- mobile = g_desktop_app_info_get_string (G_DESKTOP_APP_INFO (info), +- "X-Purism-FormFactor"); +- if (mobile && strcasestr (mobile, "mobile;")) +- return TRUE; +- +- g_free (mobile); +- mobile = g_desktop_app_info_get_string (G_DESKTOP_APP_INFO (info), +- "X-KDE-FormFactor"); +- if (mobile && strcasestr (mobile, "handset;")) +- return TRUE; +- +- id = g_app_info_get_id (G_APP_INFO (info)); +- if (id && g_strv_contains ((const char * const*)priv->force_adaptive, id)) +- return TRUE; +- +- return FALSE; ++ return app_is_adaptive (self, info); + } + + +@@ -319,6 +343,7 @@ favorites_changed (GListModel *list, + + /* We don't show favorites in the main list, filter them out */ + gtk_filter_list_model_refilter (priv->model); ++ gtk_container_foreach (GTK_CONTAINER (priv->apps), update_app_button_adaptive, self); + } + + +@@ -332,6 +357,7 @@ create_launcher (gpointer item, + G_CALLBACK (app_launched_cb), self); + + gtk_widget_show (btn); ++ update_app_button_adaptive (btn, self); + + return btn; + } +@@ -410,7 +436,7 @@ phosh_app_grid_finalize (GObject *object) + PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self); + + g_clear_pointer (&priv->search_string, g_free); +- g_strfreev (priv->force_adaptive); ++ g_clear_pointer (&priv->force_adaptive, g_strfreev); + + G_OBJECT_CLASS (phosh_app_grid_parent_class)->finalize (object); + } +@@ -447,6 +473,7 @@ do_search (PhoshAppGrid *self) + } + + gtk_filter_list_model_refilter (priv->model); ++ gtk_container_foreach (GTK_CONTAINER (priv->apps), update_app_button_adaptive, self); + + priv->debounce = 0; + return G_SOURCE_REMOVE; +@@ -682,5 +709,6 @@ phosh_app_grid_set_filter_adaptive (PhoshAppGrid *self, gboolean enable) + update_filter_adaptive_button (self); + + gtk_filter_list_model_refilter (priv->model); ++ gtk_container_foreach (GTK_CONTAINER (priv->apps), update_app_button_adaptive, self); + g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FILTER_ADAPTIVE]); + } +-- +GitLab + diff --git a/gui-wm/phosh/files/977.patch b/gui-wm/phosh/files/977.patch new file mode 100644 index 0000000..025b049 --- /dev/null +++ b/gui-wm/phosh/files/977.patch @@ -0,0 +1,51 @@ +From 8aee7788de2cfead530a175a162ea37ab55f2b16 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Guido=20G=C3=BCnther?= +Date: Fri, 7 Jan 2022 20:10:26 +0100 +Subject: [PATCH] network-auth-prompt: Allow for WPA{,2} enterprise +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Guido Günther +--- + src/network-auth-prompt.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/network-auth-prompt.c b/src/network-auth-prompt.c +index 9005bc0d3..bf6925b2a 100644 +--- a/src/network-auth-prompt.c ++++ b/src/network-auth-prompt.c +@@ -154,6 +154,10 @@ network_connection_get_key_type (NMConnection *connection) + + if (g_str_equal (key_mgmt, "none")) + return "wep-key0"; ++ else if (g_str_equal (key_mgmt, "wpa-eap")) { ++ /* TODO: This is too simplistic as we have a cert password too */ ++ return "password"; ++ } + + /* Assume WPA/WPA2 Personal */ + return "psk"; +@@ -179,7 +183,9 @@ network_prompt_setup_dialog (PhoshNetworkAuthPrompt *self) + g_bytes_get_size (bytes)); + + if (self->security_type != NMU_SEC_WPA_PSK && ++ self->security_type != NMU_SEC_WPA_ENTERPRISE && + self->security_type != NMU_SEC_WPA2_PSK && ++ self->security_type != NMU_SEC_WPA2_ENTERPRISE && + self->security_type != NMU_SEC_STATIC_WEP) { + g_debug ("Network security method %d of %s not supported", + self->security_type, ssid); +@@ -294,6 +300,9 @@ network_prompt_wpa_password_changed_cb (PhoshNetworkAuthPrompt *self) + } else if (self->security_type == NMU_SEC_STATIC_WEP) { + valid = nm_utils_wep_key_valid (password, NM_WEP_KEY_TYPE_PASSPHRASE); + valid |= nm_utils_wep_key_valid (password, NM_WEP_KEY_TYPE_KEY); ++ } else if (self->security_type == NMU_SEC_WPA_ENTERPRISE || ++ self->security_type == NMU_SEC_WPA2_ENTERPRISE) { ++ valid = TRUE; + } + + gtk_widget_set_sensitive (self->connect_button, valid); +-- +GitLab + diff --git a/gui-wm/phosh/phosh-0.20.0.ebuild b/gui-wm/phosh/phosh-0.20.0.ebuild index 6ce4d43..78cf5d4 100755 --- a/gui-wm/phosh/phosh-0.20.0.ebuild +++ b/gui-wm/phosh/phosh-0.20.0.ebuild @@ -58,6 +58,12 @@ src_prepare() { mv "${WORKDIR}"/libcall-ui-"${LCU_COMMIT}" "${S}"/subprojects/libcall-ui || die eapply "${FILESDIR}"/0001-Gentoo-patch-for-polkit-120.patch + eapply "${FILESDIR}"/0001-system-prompt-allow-blank-passwords.patch + eapply "${FILESDIR}"/0002-fix-locale-issue.patch + eapply "${FILESDIR}"/0003-fix-locale-issue-in-service-file.patch + eapply "${FILESDIR}"/1008.patch + eapply "${FILESDIR}"/977.patch + } src_install() {