evolution/SOURCES/evolution-3.28.5-crash-empty-attendee.patch

58 lines
2.5 KiB
Diff
Raw Normal View History

2019-11-05 20:55:12 +00:00
diff -up evolution-3.28.5/src/calendar/gui/e-comp-editor.c.crash-empty-attendee evolution-3.28.5/src/calendar/gui/e-comp-editor.c
--- evolution-3.28.5/src/calendar/gui/e-comp-editor.c.crash-empty-attendee 2018-07-30 15:37:05.000000000 +0200
+++ evolution-3.28.5/src/calendar/gui/e-comp-editor.c 2019-06-28 11:36:27.645365528 +0200
@@ -2610,6 +2610,7 @@ e_comp_editor_fill_component (ECompEdito
icalcomponent *component)
{
ECompEditorClass *comp_editor_class;
+ GtkWidget *focused_widget;
gboolean is_valid;
g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
@@ -2619,8 +2620,30 @@ e_comp_editor_fill_component (ECompEdito
g_return_val_if_fail (comp_editor_class != NULL, FALSE);
g_return_val_if_fail (comp_editor_class->fill_component != NULL, FALSE);
+ focused_widget = gtk_window_get_focus (GTK_WINDOW (comp_editor));
+ if (focused_widget) {
+ GtkWidget *parent, *ce_widget = GTK_WIDGET (comp_editor);
+
+ /* When a cell-renderer is focused and editing the cell content,
+ then unfocus it may mean to free the currently focused widget,
+ thus get the GtkTreeView in such cases. */
+ parent = focused_widget;
+ while (parent = gtk_widget_get_parent (parent), parent && parent != ce_widget) {
+ if (GTK_IS_TREE_VIEW (parent)) {
+ focused_widget = parent;
+ break;
+ }
+ }
+
+ /* Save any pending changes */
+ gtk_window_set_focus (GTK_WINDOW (comp_editor), NULL);
+ }
+
is_valid = comp_editor_class->fill_component (comp_editor, component);
+ if (focused_widget)
+ gtk_window_set_focus (GTK_WINDOW (comp_editor), focused_widget);
+
if (is_valid && comp_editor->priv->validation_alert) {
e_alert_response (comp_editor->priv->validation_alert, GTK_RESPONSE_CLOSE);
g_clear_object (&comp_editor->priv->validation_alert);
diff -up evolution-3.28.5/src/modules/calendar/e-cal-shell-content.c.crash-empty-attendee evolution-3.28.5/src/modules/calendar/e-cal-shell-content.c
--- evolution-3.28.5/src/modules/calendar/e-cal-shell-content.c.crash-empty-attendee 2018-07-30 15:37:05.000000000 +0200
+++ evolution-3.28.5/src/modules/calendar/e-cal-shell-content.c 2019-06-28 11:36:27.645365528 +0200
@@ -847,9 +847,9 @@ cal_shell_content_get_attendee_prop (ica
while (prop != NULL) {
const gchar *attendee;
- attendee = icalproperty_get_attendee (prop);
+ attendee = itip_strip_mailto (icalproperty_get_attendee (prop));
- if (g_str_equal (itip_strip_mailto (attendee), address))
+ if (attendee && g_ascii_strcasecmp (attendee, address) == 0)
return prop;
prop = icalcomponent_get_next_property (