aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/e-day-view.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 2b935f3f3a..2b8f7a8b31 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -420,6 +420,7 @@ static void e_day_view_recalc_work_week_days_shown (EDayView *day_view);
static void e_day_view_queue_layout (EDayView *day_view);
static void e_day_view_cancel_layout (EDayView *day_view);
static gboolean e_day_view_layout_timeout_cb (gpointer data);
+static void tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item);
enum {
PROP_0,
@@ -3662,6 +3663,8 @@ e_day_view_show_popup_menu (EDayView *day_view,
gint day,
gint event_num)
{
+ tooltip_destroy (day_view, NULL);
+
day_view->popup_event_day = day;
day_view->popup_event_num = event_num;
@@ -6274,23 +6277,26 @@ static void
tooltip_destroy (EDayView *day_view,
GnomeCanvasItem *item)
{
- EDayViewEvent *pevent;
- gint event_num = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-num"));
- gint day = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-day"));
+ GtkWidget *tooltip = g_object_get_data (G_OBJECT (day_view), "tooltip-window");
- pevent = tooltip_get_view_event (day_view, day, event_num);
- if (pevent) {
- if (pevent->tooltip && g_object_get_data (G_OBJECT (day_view), "tooltip-window")) {
- gtk_widget_destroy (pevent->tooltip);
- pevent->tooltip = NULL;
- }
+ if (tooltip) {
+ gtk_widget_destroy (tooltip);
+ g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL);
+ }
- if (pevent->timeout != -1) {
- g_source_remove (pevent->timeout);
- pevent->timeout = -1;
- }
+ if (item) {
+ EDayViewEvent *pevent;
+ gint event_num = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-num"));
+ gint day = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-day"));
- g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL);
+ pevent = tooltip_get_view_event (day_view, day, event_num);
+ if (pevent) {
+ pevent->tooltip = NULL;
+ if (pevent->timeout != -1) {
+ g_source_remove (pevent->timeout);
+ pevent->timeout = -1;
+ }
+ }
}
}