From c0ebd3622cf15659fa062b69658177ce72756ea7 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Tue, 24 Aug 2021 15:46:11 +0100 Subject: [PATCH] Bug fix: GPS map direction markers If an image has no GPS direction data, when the GPS map marker was clicked to show the thumbnail, and then clicked to clear it, the image marker was not redisplayed. --- src/bar_gps.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/bar_gps.c b/src/bar_gps.c index fe2389de..bfcd7b36 100644 --- a/src/bar_gps.c +++ b/src/bar_gps.c @@ -396,8 +396,11 @@ static gboolean bar_pane_gps_marker_keypress_cb(GtkWidget *widget, ClutterButton g_string_free(text, TRUE); parent_marker = clutter_actor_get_parent(label_marker); - direction = clutter_actor_get_child_at_index(parent_marker, 0); - clutter_actor_set_opacity(direction, 255); + if (clutter_actor_get_n_children(parent_marker ) > 1 ) + { + direction = clutter_actor_get_child_at_index(parent_marker, 0); + clutter_actor_set_opacity(direction, 255); + } } /* otherwise, revert to the hidden text marker */ @@ -409,8 +412,11 @@ static gboolean bar_pane_gps_marker_keypress_cb(GtkWidget *widget, ClutterButton champlain_marker_set_selection_text_color(&marker_colour); parent_marker = clutter_actor_get_parent(label_marker); - direction = clutter_actor_get_child_at_index(parent_marker, 0); - clutter_actor_set_opacity(direction, 0); + if (clutter_actor_get_n_children(parent_marker ) > 1 ) + { + direction = clutter_actor_get_child_at_index(parent_marker, 0); + clutter_actor_set_opacity(direction, 0); + } } g_free(current_text); -- 2.20.1