aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-08-10 17:56:18 +0800
committerMilan Crha <mcrha@redhat.com>2012-08-10 17:56:18 +0800
commitd5363016179a3727c3d974ddbab3d39118d82c95 (patch)
tree8f368566a4390d5cfe153c7345df40919bc7f8bf
parent92a2ca0066a646bdf22d2eb55a03e45415f60ac9 (diff)
downloadgsoc2013-evolution-d5363016179a3727c3d974ddbab3d39118d82c95.tar
gsoc2013-evolution-d5363016179a3727c3d974ddbab3d39118d82c95.tar.gz
gsoc2013-evolution-d5363016179a3727c3d974ddbab3d39118d82c95.tar.bz2
gsoc2013-evolution-d5363016179a3727c3d974ddbab3d39118d82c95.tar.lz
gsoc2013-evolution-d5363016179a3727c3d974ddbab3d39118d82c95.tar.xz
gsoc2013-evolution-d5363016179a3727c3d974ddbab3d39118d82c95.tar.zst
gsoc2013-evolution-d5363016179a3727c3d974ddbab3d39118d82c95.zip
EDayView: Hide tooltip on context menu popup
-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;
+ }
+ }
}
}