gui/search-button: Disable popover arrow and guard markup escaping
The search suggestions popover is styled as a menu ("menu" style)
below the search entry. In recent GTK 4, when has-arrow is TRUE (the
default) and the popover has no arrow geometry or valid parent coordinates,
gtk_popover_create_arrow_path() returns NULL, leaving arrow_render_node NULL.
gtk_popover_snapshot() then appends NULL to the snapshot, causing a fatal
critical crash (GSK_IS_RENDER_NODE assertion failed) upon showing search results.
Setting "has-arrow: false" matches the menu popover design and avoids
the crash. Also guard escape_markup_cb() against NULL strings.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
This commit is contained in:
@@ -76,6 +76,7 @@ template $GcalSearchButton: Adw.Bin {
|
|||||||
Popover popover {
|
Popover popover {
|
||||||
position: bottom;
|
position: bottom;
|
||||||
autohide: false;
|
autohide: false;
|
||||||
|
has-arrow: false;
|
||||||
default-widget: results_listview;
|
default-widget: results_listview;
|
||||||
|
|
||||||
styles [
|
styles [
|
||||||
|
|||||||
@@ -116,6 +116,9 @@ escape_markup_cb (GcalSearchHit *hit,
|
|||||||
{
|
{
|
||||||
g_autofree gchar *escaped_string = NULL;
|
g_autofree gchar *escaped_string = NULL;
|
||||||
|
|
||||||
|
if (!string)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
escaped_string = g_markup_escape_text (string, -1);
|
escaped_string = g_markup_escape_text (string, -1);
|
||||||
escaped_string = g_strstrip (escaped_string);
|
escaped_string = g_strstrip (escaped_string);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user