diff --git a/SOURCES/evolution-3.28.5-contacts-prefer-orig-value.patch b/SOURCES/evolution-3.28.5-contacts-prefer-orig-value.patch
new file mode 100644
index 0000000..4272d25
--- /dev/null
+++ b/SOURCES/evolution-3.28.5-contacts-prefer-orig-value.patch
@@ -0,0 +1,17 @@
+diff -up evolution-3.28.5/src/addressbook/gui/widgets/eab-contact-merging.c.contacts-prefer-orig-value evolution-3.28.5/src/addressbook/gui/widgets/eab-contact-merging.c
+--- evolution-3.28.5/src/addressbook/gui/widgets/eab-contact-merging.c.contacts-prefer-orig-value 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/addressbook/gui/widgets/eab-contact-merging.c 2022-09-15 08:19:23.228037822 +0200
+@@ -512,7 +512,12 @@ mergeit (EContactMergingLookup *lookup)
+ G_CALLBACK (dropdown_changed), data);
+ g_object_set_data_full (G_OBJECT (dropdown), "eab-contact-merging::dropdown-data", data, g_free);
+
+- if (field == E_CONTACT_NICKNAME || field == E_CONTACT_GIVEN_NAME || field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_FULL_NAME)
++ /* Only prefer the original value when it's filled */
++ if (string1 && *string1 && (
++ field == E_CONTACT_NICKNAME ||
++ field == E_CONTACT_GIVEN_NAME ||
++ field == E_CONTACT_FAMILY_NAME ||
++ field == E_CONTACT_FULL_NAME))
+ gtk_combo_box_set_active (GTK_COMBO_BOX (dropdown), 1);
+ else
+ gtk_combo_box_set_active (GTK_COMBO_BOX (dropdown), 0);
diff --git a/SOURCES/evolution-3.28.5-frame-flattenning.patch b/SOURCES/evolution-3.28.5-frame-flattenning.patch
new file mode 100644
index 0000000..b6f940c
--- /dev/null
+++ b/SOURCES/evolution-3.28.5-frame-flattenning.patch
@@ -0,0 +1,583 @@
+diff -up evolution-3.28.5/data/webview.css.frame-flattenning evolution-3.28.5/data/webview.css
+--- evolution-3.28.5/data/webview.css.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/data/webview.css 2023-01-04 09:25:06.252929132 +0100
+@@ -8,8 +8,8 @@ img {
+ }
+
+ body {
+- /* Use margin so that children can safely use width=100% */
+- margin: 5px 10px 5px 10px;
++ /* Use padding so that children can safely use width=100% */
++ padding: 8px;
+ }
+
+ th {
+@@ -30,21 +30,21 @@ img#__evo-contact-photo {
+
+ img.navigable {
+ cursor: pointer;
+- margin-right: 4px;
++ padding-right: 4px;
+ }
+
+ .attachments {
+ background: #FFF;
+ border: 1px solid silver;
+- margin: 10px 10px 10px 10px;
++ padding: 10px 10px 10px 10px;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 0;
+ }
+
+ .attachment {
+- margin-left: 8px;
+- margin-right: 0px;
++ padding-left: 8px;
++ padding-right: 0px;
+ }
+
+ .attachment td {
+@@ -58,21 +58,21 @@ iframe:not([id$=".itip"]) {
+
+ .part-container {
+ height: 100%;
+- margin-top: 2px;
+- margin-bottom: 2px;
++ padding: 0px;
+ }
+
+ .part-container-nostyle iframe {
+- margin-right: 10px;
++ margin: 0px;
++ padding: 0px;
+ }
+
+ .part-container-inner-margin {
+- margin: 8px;
++ padding: 0px;
+ }
+
+ object { /* GtkWidgets */
+- margin-top: 2px;
+- margin-bottom: 2px;
++ padding-top: 2px;
++ padding-bottom: 2px;
+ }
+
+ .__evo-highlight {
+@@ -139,7 +139,7 @@ th.rtl {
+ /***** PRINTING *******/
+
+ .printing-header {
+- margin-bottom: 20px;
++ padding-bottom: 20px;
+ }
+
+ .printing-header h1,
+@@ -159,7 +159,7 @@ th.rtl {
+ /******* ITIP *********/
+ .itip.icon {
+ float: left;
+- margin-right: 5px;
++ padding-right: 5px;
+ }
+
+ .itip.content {
+@@ -168,7 +168,7 @@ th.rtl {
+ }
+
+ .itip.description {
+- margin: 5px;
++ padding: 5px;
+ }
+
+ .itip tr {
+@@ -192,7 +192,7 @@ th.rtl {
+ }
+
+ #table_row_buttons img {
+- margin-right: 5px;
++ padding-right: 5px;
+ vertical-align: middle;
+ }
+
+diff -up evolution-3.28.5/src/em-format/e-mail-formatter-text-plain.c.frame-flattenning evolution-3.28.5/src/em-format/e-mail-formatter-text-plain.c
+--- evolution-3.28.5/src/em-format/e-mail-formatter-text-plain.c.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/em-format/e-mail-formatter-text-plain.c 2023-01-04 09:25:06.252929132 +0100
+@@ -111,7 +111,7 @@ emfe_text_plain_format (EMailFormatterEx
+ string =
+ "
";
++ "style=\"border: none; padding: 0px; margin: 0;\">";
+
+ g_output_stream_write_all (
+ stream, string, strlen (string),
+diff -up evolution-3.28.5/src/mail/e-mail-display.c.frame-flattenning evolution-3.28.5/src/mail/e-mail-display.c
+--- evolution-3.28.5/src/mail/e-mail-display.c.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/mail/e-mail-display.c 2023-01-04 09:25:06.252929132 +0100
+@@ -1529,6 +1529,19 @@ mail_display_set_fonts (EWebView *web_vi
+ mail_display_get_font_settings (display->priv->settings, monospace, variable);
+ }
+
++static gboolean
++mail_display_can_use_frame_flattening (void)
++{
++ guint wk_major, wk_minor;
++
++ wk_major = webkit_get_major_version ();
++ wk_minor = webkit_get_minor_version ();
++
++ /* The 2.38 is the last version, which supports frame-flattening;
++ prefer it over the manual and expensive calculations. */
++ return (wk_major < 2) || (wk_major == 2 && wk_minor <= 38);
++}
++
+ static void
+ mail_display_web_view_initialize (WebKitWebView *web_view)
+ {
+@@ -1536,9 +1549,11 @@ mail_display_web_view_initialize (WebKit
+
+ webkit_settings = webkit_web_view_get_settings (web_view);
+
+- g_object_set (webkit_settings,
+- "enable-frame-flattening", TRUE,
+- NULL);
++ if (mail_display_can_use_frame_flattening ()) {
++ g_object_set (webkit_settings,
++ "enable-frame-flattening", TRUE,
++ NULL);
++ }
+ }
+
+ static void
+diff -up evolution-3.28.5/src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c.frame-flattenning evolution-3.28.5/src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
+--- evolution-3.28.5/src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c 2023-01-04 09:25:06.253929132 +0100
+@@ -259,7 +259,7 @@ handle_method_call (GDBusConnection *con
+ gpointer user_data)
+ {
+ WebKitWebExtension *web_extension = WEBKIT_WEB_EXTENSION (user_data);
+- WebKitDOMDocument *document;
++ WebKitDOMDocument *document = NULL, *top_document = NULL;
+ const gchar *part_id = NULL;
+ guint64 page_id;
+
+@@ -281,11 +281,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s)", &page_id, &part_id, &button_id);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ module_itip_formatter_dom_utils_show_button (document, button_id);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "EnableButton") == 0) {
+@@ -306,11 +307,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s&s)", &page_id, &part_id, &element_id, &inner_html);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ e_dom_utils_element_set_inner_html (document, element_id, inner_html);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "RemoveElement") == 0) {
+@@ -318,11 +320,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s)", &page_id, &part_id, &element_id);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ e_dom_utils_remove_element (document, element_id);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "ElementRemoveChildNodes") == 0) {
+@@ -330,11 +333,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s)", &page_id, &part_id, &element_id);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ e_dom_utils_element_remove_child_nodes (document, element_id);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "HideElement") == 0) {
+@@ -343,11 +347,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&sb)", &page_id, &part_id, &element_id, &hide);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ e_dom_utils_hide_element (document, element_id, hide);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "ElementIsHidden") == 0) {
+@@ -395,11 +400,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&sbb)", &page_id, &part_id, &id, &show, &update_second);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ module_itip_formatter_dom_utils_show_checkbox (document, id, show, update_second);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "SetButtonsSensitive") == 0) {
+@@ -419,11 +425,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s&s)", &page_id, &part_id, &id, &text);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ module_itip_formatter_dom_utils_set_area_text (document, id, text);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "ElementSetAccessKey") == 0) {
+@@ -443,11 +450,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s)", &page_id, &part_id, &element_id);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ module_itip_formatter_dom_utils_element_hide_child_nodes (document, element_id);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "EnableSelect") == 0) {
+@@ -509,11 +517,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s&s&s)", &page_id, &part_id, &element_id, &header, &label);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ module_itip_formatter_dom_utils_update_times (document, element_id, header, label);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "AppendInfoItemRow") == 0) {
+@@ -521,11 +530,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s&s&s&s)", &page_id, &part_id, &table_id, &row_id, &icon_name, &message);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ module_itip_formatter_dom_utils_append_info_item_row (document, table_id, row_id, icon_name, message);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "EnableTextArea") == 0) {
+@@ -546,11 +556,12 @@ handle_method_call (GDBusConnection *con
+
+ g_variant_get (parameters, "(t&s&s&s)", &page_id, &part_id, &area_id, &value);
+
+- document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
+- if (document)
+- document = find_webkit_document_for_partid_or_return_dbus_error (invocation, document, part_id);
++ top_document = get_webkit_document_or_return_dbus_error (invocation, web_extension, page_id);
++ if (top_document)
++ document = find_webkit_document_for_partid_or_return_dbus_error (invocation, top_document, part_id);
+ if (document) {
+ module_itip_formatter_dom_utils_text_area_set_value (document, area_id, value);
++ e_dom_update_iframe_height (top_document);
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+ } else if (g_strcmp0 (method_name, "TextAreaGetValue") == 0) {
+diff -up evolution-3.28.5/src/modules/text-highlight/e-mail-formatter-text-highlight.c.frame-flattenning evolution-3.28.5/src/modules/text-highlight/e-mail-formatter-text-highlight.c
+--- evolution-3.28.5/src/modules/text-highlight/e-mail-formatter-text-highlight.c.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/modules/text-highlight/e-mail-formatter-text-highlight.c 2023-01-04 09:25:06.252929132 +0100
+@@ -122,16 +122,26 @@ text_hightlight_read_data_thread (gpoint
+ {
+ TextHighlightClosure *closure = user_data;
+ gint nbuffer = 10240;
++ gssize read;
++ gsize wrote = 0;
+ gchar *buffer;
+
+ g_return_val_if_fail (closure != NULL, NULL);
+
+ buffer = g_new (gchar, nbuffer);
+
++ strcpy (buffer, "");
++ read = strlen (buffer);
++
++ if (!g_output_stream_write_all (closure->output_stream, buffer, read, &wrote, closure->cancellable, &closure->error) ||
++ (gssize) wrote != read || closure->error) {
++ g_free (buffer);
++ return NULL;
++ }
++
+ while (!camel_stream_eos (closure->read_stream) &&
+ !g_cancellable_set_error_if_cancelled (closure->cancellable, &closure->error)) {
+- gssize read;
+- gsize wrote = 0;
++ wrote = 0;
+
+ read = camel_stream_read (closure->read_stream, buffer, nbuffer, closure->cancellable, &closure->error);
+ if (read < 0 || closure->error)
+diff -up evolution-3.28.5/src/web-extensions/e-dom-utils.c.frame-flattenning evolution-3.28.5/src/web-extensions/e-dom-utils.c
+--- evolution-3.28.5/src/web-extensions/e-dom-utils.c.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/web-extensions/e-dom-utils.c 2023-01-04 09:25:06.253929132 +0100
+@@ -837,9 +837,8 @@ set_iframe_and_body_width (WebKitDOMDocu
+ gchar *style;
+
+ /* Message main body */
+- local_width -= 8; /* 8 + 8 margins of body without iframes */
+- if (level > 1)
+- local_width -= 8;
++ local_width -= level * 20; /* 10 + 10 margins of body without iframes */
++ local_width -= 4;
+
+ style = g_strdup_printf ("width: %" G_GINT64_FORMAT "px;", local_width);
+ e_dom_utils_add_css_rule_into_style_sheet_in_document (
+@@ -867,7 +866,7 @@ set_iframe_and_body_width (WebKitDOMDocu
+ style);
+ g_free (style);
+
+- local_width -= 2; /* 1 + 1 frame borders */
++ local_width -= 4; /* 2 + 2 frame borders */
+
+ style = g_strdup_printf ("width: %" G_GINT64_FORMAT "px;", local_width);
+ e_dom_utils_add_css_rule_into_style_sheet_in_document (
+@@ -891,15 +890,11 @@ set_iframe_and_body_width (WebKitDOMDocu
+ } else {
+ gchar *style;
+
+- local_width -= 20; /* 10 + 10 margins of body with iframes */
+- local_width -= 8; /* attachment margin */
+- local_width -= 2; /* 1 + 1 frame borders */
++ local_width -= (level - 1) * 20; /* 10 + 10 margins of body with iframes */
++ local_width -= 4; /* 2 + 2 frame borders */
++ local_width -= 10; /* attachment margin */
+
+- /* We need to subtract another 10 pixels from the iframe width to
+- * have the iframe's borders on the correct place. We can't subtract
+- * it from local_width as we don't want to propagate this change
+- * further. */
+- style = g_strdup_printf ("width: %" G_GINT64_FORMAT "px;", local_width - 10);
++ style = g_strdup_printf ("width: %" G_GINT64_FORMAT "px;", local_width);
+ e_dom_utils_add_css_rule_into_style_sheet_in_document (
+ document,
+ "-e-mail-formatter-style-sheet",
+@@ -933,7 +928,7 @@ set_iframe_and_body_width (WebKitDOMDocu
+ if (level == 0) {
+ gchar *style = NULL;
+
+- tmp_local_width -= 8; /* attachment's margin */
++ tmp_local_width -= 10; /* attachment's margin */
+
+ style = g_strdup_printf ("width: %" G_GINT64_FORMAT "px;", tmp_local_width);
+ e_dom_utils_add_css_rule_into_style_sheet_in_document (
+@@ -947,9 +942,7 @@ set_iframe_and_body_width (WebKitDOMDocu
+ "-e-mail-formatter-style-sheet",
+ ".attachment-wrapper iframe[src*=\"__formatas=txt\"]",
+ style);
+- g_free (style);
+
+- style = g_strdup_printf ("width: %" G_GINT64_FORMAT "px;", local_width);
+ e_dom_utils_add_css_rule_into_style_sheet_in_document (
+ document,
+ "-e-mail-formatter-style-sheet",
+@@ -992,8 +985,10 @@ dom_window_resize_cb (WebKitDOMDOMWindow
+
+ document = webkit_dom_dom_window_get_document (dom_window);
+
+- if (document)
++ if (document) {
+ e_dom_resize_document_content_to_preview_width (document);
++ e_dom_update_iframe_height (document);
++ }
+ }
+
+ static gboolean
+@@ -1106,6 +1101,7 @@ e_dom_utils_e_mail_display_bind_dom (Web
+ e_dom_wrap_long_anchors (document);
+
+ e_dom_resize_document_content_to_preview_width (document);
++ e_dom_update_iframe_height (document);
+ }
+
+ void
+@@ -1160,6 +1156,99 @@ e_dom_utils_e_mail_display_unstyle_block
+ g_clear_object (&collection);
+ }
+
++static void
++e_dom_update_iframe_height_recursive (WebKitDOMDocument *document)
++{
++ WebKitDOMHTMLCollection *frames = NULL;
++ WebKitDOMElement *scrolling_elem;
++ gulong ii, length;
++
++ frames = webkit_dom_document_get_elements_by_tag_name_as_html_collection (document, "iframe");
++ length = webkit_dom_html_collection_get_length (frames);
++ for (ii = 0; ii < length; ii++) {
++ WebKitDOMHTMLIFrameElement *iframe;
++ WebKitDOMDocument *content_document;
++
++ iframe = WEBKIT_DOM_HTML_IFRAME_ELEMENT (webkit_dom_html_collection_item (frames, ii));
++
++ content_document = webkit_dom_html_iframe_element_get_content_document (iframe);
++ if (!content_document)
++ continue;
++
++ e_dom_update_iframe_height_recursive (content_document);
++ }
++
++ scrolling_elem = webkit_dom_document_get_scrolling_element (document);
++ if (scrolling_elem) {
++ WebKitDOMDOMWindow *default_view;
++
++ default_view = webkit_dom_document_get_default_view (document);
++ if (default_view) {
++ WebKitDOMElement *frame_elem;
++
++ frame_elem = webkit_dom_dom_window_get_frame_element (default_view);
++ if (frame_elem) {
++ WebKitDOMHTMLIFrameElement *iframe = WEBKIT_DOM_HTML_IFRAME_ELEMENT (frame_elem);
++ glong scroll_height;
++ gchar *height;
++
++ scroll_height = webkit_dom_element_get_scroll_height (scrolling_elem);
++ height = webkit_dom_html_iframe_element_get_height (iframe);
++ if (!height || scroll_height == (glong) g_ascii_strtoll (height, NULL, 10))
++ webkit_dom_html_iframe_element_set_height (iframe, "10");
++ g_free (height);
++
++ scroll_height = webkit_dom_element_get_scroll_height (scrolling_elem);
++ height = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) (scroll_height + 2 +
++ (webkit_dom_element_get_scroll_width (scrolling_elem) > webkit_dom_element_get_client_width (scrolling_elem) ? 20 : 0)));
++ webkit_dom_html_iframe_element_set_height (iframe, height);
++ g_free (height);
++ }
++ }
++
++ g_clear_object (&default_view);
++ }
++
++ g_clear_object (&frames);
++}
++
++static gboolean
++mail_display_can_use_frame_flattening (void)
++{
++ guint wk_major, wk_minor;
++
++ wk_major = webkit_get_major_version ();
++ wk_minor = webkit_get_minor_version ();
++
++ /* The 2.38 is the last version, which supports frame-flattening;
++ prefer it over the manual and expensive calculations. */
++ return (wk_major < 2) || (wk_major == 2 && wk_minor <= 38);
++}
++
++void
++e_dom_update_iframe_height (WebKitDOMDocument *document)
++{
++ WebKitDOMDOMWindow *default_view;
++
++ if (mail_display_can_use_frame_flattening ())
++ return;
++
++ default_view = webkit_dom_document_get_default_view (document);
++ if (default_view) {
++ glong scroll_x, scroll_y;
++
++ scroll_x = webkit_dom_dom_window_get_scroll_x (default_view);
++ scroll_y = webkit_dom_dom_window_get_scroll_y (default_view);
++
++ e_dom_update_iframe_height_recursive (document);
++
++ if (scroll_y != webkit_dom_dom_window_get_scroll_y (default_view))
++ webkit_dom_dom_window_scroll_to (default_view, scroll_x, scroll_y);
++ }
++
++ g_clear_object (&default_view);
++}
++
+ void
+ e_dom_utils_eab_contact_formatter_bind_dom (WebKitDOMDocument *document)
+ {
+diff -up evolution-3.28.5/src/web-extensions/e-dom-utils.h.frame-flattenning evolution-3.28.5/src/web-extensions/e-dom-utils.h
+--- evolution-3.28.5/src/web-extensions/e-dom-utils.h.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/web-extensions/e-dom-utils.h 2023-01-04 09:25:06.253929132 +0100
+@@ -69,6 +69,7 @@ void e_dom_utils_e_mail_display_bind_do
+ GDBusConnection *connection);
+ void e_dom_utils_e_mail_display_unstyle_blockquotes
+ (WebKitDOMDocument *document);
++void e_dom_update_iframe_height (WebKitDOMDocument *document);
+ WebKitDOMElement *
+ e_dom_utils_find_element_by_selector
+ (WebKitDOMDocument *document,
+diff -up evolution-3.28.5/src/web-extensions/e-web-extension.c.frame-flattenning evolution-3.28.5/src/web-extensions/e-web-extension.c
+--- evolution-3.28.5/src/web-extensions/e-web-extension.c.frame-flattenning 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/web-extensions/e-web-extension.c 2023-01-04 09:25:06.253929132 +0100
+@@ -613,8 +613,10 @@ handle_method_call (GDBusConnection *con
+
+ e_dom_utils_hide_element (document, element_id, hidden);
+
+- if (expand_inner_data)
++ if (expand_inner_data) {
+ e_dom_resize_document_content_to_preview_width (document);
++ e_dom_update_iframe_height (document);
++ }
+ }
+
+ g_dbus_method_invocation_return_value (invocation, NULL);
diff --git a/SOURCES/evolution-3.28.5-new-button.patch b/SOURCES/evolution-3.28.5-new-button.patch
new file mode 100644
index 0000000..9c0bec7
--- /dev/null
+++ b/SOURCES/evolution-3.28.5-new-button.patch
@@ -0,0 +1,102 @@
+diff -up evolution-3.28.5/src/shell/e-shell-window.c.new-button evolution-3.28.5/src/shell/e-shell-window.c
+--- evolution-3.28.5/src/shell/e-shell-window.c.new-button 2018-07-30 15:37:05.000000000 +0200
++++ evolution-3.28.5/src/shell/e-shell-window.c 2022-09-26 09:27:18.862555829 +0200
+@@ -47,6 +47,7 @@ enum {
+ enum {
+ CLOSE_ALERT,
+ SHELL_VIEW_CREATED,
++ UPDATE_NEW_MENU,
+ LAST_SIGNAL
+ };
+
+@@ -120,6 +121,17 @@ shell_window_toolbar_update_new_menu (Gt
+ gtk_menu_tool_button_set_menu (menu_tool_button, menu);
+ }
+
++static void
++shell_window_toolbar_update_new_menu_sig (EShellWindow *shell_window,
++ GtkMenuToolButton *menu_tool_button)
++{
++ GtkWidget *menu;
++
++ /* Update the "New" menu tool button submenu. */
++ menu = e_shell_window_create_new_menu (shell_window);
++ gtk_menu_tool_button_set_menu (menu_tool_button, menu);
++}
++
+ static gboolean
+ shell_window_active_view_to_prefer_item (GBinding *binding,
+ const GValue *source_value,
+@@ -160,6 +172,8 @@ shell_window_set_notebook_page (EShellWi
+ g_return_if_fail (page_num >= 0);
+
+ gtk_notebook_set_current_page (notebook, page_num);
++
++ g_signal_emit (shell_window, signals[UPDATE_NEW_MENU], 0, NULL);
+ }
+
+ static void
+@@ -512,8 +526,8 @@ shell_window_construct_menubar (EShellWi
+ main_menu, "visible",
+ G_BINDING_SYNC_CREATE);
+
+- e_signal_connect_notify (
+- shell_window, "notify::active-view",
++ g_signal_connect (
++ shell_window, "update-new-menu",
+ G_CALLBACK (shell_window_menubar_update_new_menu), NULL);
+
+ return main_menu;
+@@ -593,6 +607,11 @@ shell_window_construct_toolbar (EShellWi
+ G_CALLBACK (shell_window_toolbar_update_new_menu),
+ shell_window);
+
++ g_signal_connect_object (
++ shell_window, "update-new-menu",
++ G_CALLBACK (shell_window_toolbar_update_new_menu_sig),
++ item, 0);
++
+ gtk_box_pack_start (GTK_BOX (box), toolbar, TRUE, TRUE, 0);
+
+ toolbar = e_shell_window_get_managed_widget (
+@@ -1176,6 +1195,24 @@ e_shell_window_class_init (EShellWindowC
+ G_TYPE_NONE, 1,
+ E_TYPE_SHELL_VIEW);
+
++ /*
++ * EShellWindow::update-new-menu
++ * @shell_window: the #EShellWindow
++ *
++ * Emitted when the 'New' menu should be updated.
++ *
++ * Since: 3.44.5
++ */
++ signals[UPDATE_NEW_MENU] = g_signal_new (
++ "update-new-menu",
++ G_OBJECT_CLASS_TYPE (object_class),
++ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
++ 0,
++ NULL, NULL,
++ g_cclosure_marshal_VOID__VOID,
++ G_TYPE_NONE, 0,
++ G_TYPE_NONE);
++
+ binding_set = gtk_binding_set_by_class (class);
+ gtk_binding_entry_add_signal (
+ binding_set, GDK_KEY_Escape, 0, "close-alert", 0);
+@@ -2029,6 +2066,8 @@ e_shell_window_register_new_item_actions
+ G_OBJECT (action),
+ "primary", GINT_TO_POINTER (TRUE));
+ }
++
++ g_signal_emit (shell_window, signals[UPDATE_NEW_MENU], 0, NULL);
+ }
+
+ /**
+@@ -2106,4 +2145,6 @@ e_shell_window_register_new_source_actio
+ G_OBJECT (action),
+ "backend-name", (gpointer) backend_name);
+ }
++
++ g_signal_emit (shell_window, signals[UPDATE_NEW_MENU], 0, NULL);
+ }
diff --git a/SPECS/evolution.spec b/SPECS/evolution.spec
index 58c6ca7..9929364 100644
--- a/SPECS/evolution.spec
+++ b/SPECS/evolution.spec
@@ -31,7 +31,7 @@
Name: evolution
Version: 3.28.5
-Release: 18%{?dist}
+Release: 22%{?dist}
Group: Applications/Productivity
Summary: Mail and calendar client for GNOME
License: GPLv2+ and GFDL
@@ -96,6 +96,15 @@ Patch13: evolution-3.28.5-webkitgtk-2.30.patch
# RH bug #1972749
Patch14: evolution-3.28.5-cmake-variable-name-comparison.patch
+# RH bug #2126523
+Patch15: evolution-3.28.5-frame-flattenning.patch
+
+# RH bug #2127019
+Patch16: evolution-3.28.5-contacts-prefer-orig-value.patch
+
+# RH bug #2129702
+Patch17: evolution-3.28.5-new-button.patch
+
## Dependencies ###
Requires: %{_bindir}/killall
@@ -280,6 +289,9 @@ the functionality of the installed %{name} package.
%patch12 -p1 -b .ecalendaritem-settings
%patch13 -p1 -b .webkitgtk-2.30
%patch14 -p1 -b .cmake-variable-name-comparison
+%patch15 -p1 -b .frame-flattenning
+%patch16 -p1 -b .contacts-prefer-orig-value
+%patch17 -p1 -b .new-button
# Remove the welcome email from Novell
for inbox in src/mail/default/*/Inbox; do
@@ -578,6 +590,18 @@ grep -v "/usr/share/locale" evolution.lang > help.lang
%endif
%changelog
+* Wed Jan 04 2023 Milan Crha - 3.28.5-22
+- Resolves: #2126523 (Update patch to handle frame flattening change in WebKitGTK)
+
+* Mon Sep 26 2022 Milan Crha - 3.28.5-21
+- Resolves: #2129702 (EShellWindow: The 'New' menu is not filled after start)
+
+* Thu Sep 15 2022 Milan Crha - 3.28.5-20
+- Resolves: #2127019 (Contacts: Prefer original value only when filled on contact merge)
+
+* Wed Sep 14 2022 Milan Crha - 3.28.5-19
+- Resolves: #2126523 (Add patch to handle frame flattening change in WebKitGTK)
+
* Wed Jun 16 2021 Milan Crha - 3.28.5-18
- Resolves: #1972749 (PrintableOptions.cmake: Correct variable name comparison)