|
|
7c6d83 |
diff -up evolution-3.8.5/calendar/gui/e-calendar-view.c.calendar-tooltip-hide evolution-3.8.5/calendar/gui/e-calendar-view.c
|
|
|
7c6d83 |
--- evolution-3.8.5/calendar/gui/e-calendar-view.c.calendar-tooltip-hide 2013-08-10 23:38:42.000000000 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/calendar/gui/e-calendar-view.c 2014-08-25 17:37:19.166154934 +0200
|
|
|
7c6d83 |
@@ -1863,26 +1863,31 @@ e_calendar_view_send (ECalendarView *cal
|
|
|
7c6d83 |
g_object_unref (send_comp);
|
|
|
7c6d83 |
}
|
|
|
7c6d83 |
|
|
|
7c6d83 |
-static gboolean
|
|
|
7c6d83 |
-tooltip_grab (GtkWidget *tooltip,
|
|
|
7c6d83 |
- GdkEvent *key_event,
|
|
|
7c6d83 |
- ECalendarView *view)
|
|
|
7c6d83 |
+static void
|
|
|
7c6d83 |
+tooltip_ungrab (ECalendarView *view,
|
|
|
7c6d83 |
+ guint32 event_time)
|
|
|
7c6d83 |
{
|
|
|
7c6d83 |
- GtkWidget *widget;
|
|
|
7c6d83 |
GdkDevice *keyboard;
|
|
|
7c6d83 |
- guint32 event_time;
|
|
|
7c6d83 |
-
|
|
|
7c6d83 |
- widget = g_object_get_data (G_OBJECT (view), "tooltip-window");
|
|
|
7c6d83 |
- if (widget == NULL)
|
|
|
7c6d83 |
- return TRUE;
|
|
|
7c6d83 |
-
|
|
|
7c6d83 |
- event_time = gdk_event_get_time (key_event);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
while (!g_queue_is_empty (&view->priv->grabbed_keyboards)) {
|
|
|
7c6d83 |
keyboard = g_queue_pop_head (&view->priv->grabbed_keyboards);
|
|
|
7c6d83 |
gdk_device_ungrab (keyboard, event_time);
|
|
|
7c6d83 |
g_object_unref (keyboard);
|
|
|
7c6d83 |
}
|
|
|
7c6d83 |
+}
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+static gboolean
|
|
|
7c6d83 |
+tooltip_key_event (GtkWidget *tooltip,
|
|
|
7c6d83 |
+ GdkEvent *key_event,
|
|
|
7c6d83 |
+ ECalendarView *view)
|
|
|
7c6d83 |
+{
|
|
|
7c6d83 |
+ GtkWidget *widget;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ widget = g_object_get_data (G_OBJECT (view), "tooltip-window");
|
|
|
7c6d83 |
+ if (widget == NULL)
|
|
|
7c6d83 |
+ return TRUE;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ tooltip_ungrab (view, gdk_event_get_time (key_event));
|
|
|
7c6d83 |
|
|
|
7c6d83 |
gtk_widget_destroy (widget);
|
|
|
7c6d83 |
g_object_set_data (G_OBJECT (view), "tooltip-window", NULL);
|
|
|
7c6d83 |
@@ -1949,6 +1954,16 @@ e_calendar_view_move_tip (GtkWidget *wid
|
|
|
7c6d83 |
gtk_widget_show (widget);
|
|
|
7c6d83 |
}
|
|
|
7c6d83 |
|
|
|
7c6d83 |
+static void
|
|
|
7c6d83 |
+tooltip_window_destroyed_cb (gpointer user_data,
|
|
|
7c6d83 |
+ GObject *gone)
|
|
|
7c6d83 |
+{
|
|
|
7c6d83 |
+ ECalendarView *view = user_data;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ tooltip_ungrab (view, GDK_CURRENT_TIME);
|
|
|
7c6d83 |
+ g_object_unref (view);
|
|
|
7c6d83 |
+}
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
/*
|
|
|
7c6d83 |
* It is expected to show the tooltips in this below format
|
|
|
7c6d83 |
*
|
|
|
7c6d83 |
@@ -2189,9 +2204,10 @@ e_calendar_view_get_tooltips (const ECal
|
|
|
7c6d83 |
|
|
|
7c6d83 |
g_signal_connect (
|
|
|
7c6d83 |
pevent->tooltip, "key-press-event",
|
|
|
7c6d83 |
- G_CALLBACK (tooltip_grab), data->cal_view);
|
|
|
7c6d83 |
+ G_CALLBACK (tooltip_key_event), data->cal_view);
|
|
|
7c6d83 |
pevent->timeout = -1;
|
|
|
7c6d83 |
|
|
|
7c6d83 |
+ g_object_weak_ref (G_OBJECT (pevent->tooltip), tooltip_window_destroyed_cb, g_object_ref (data->cal_view));
|
|
|
7c6d83 |
g_object_set_data (G_OBJECT (data->cal_view), "tooltip-window", pevent->tooltip);
|
|
|
7c6d83 |
g_object_unref (newcomp);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
diff -up evolution-3.8.5/calendar/gui/e-day-view.c.calendar-tooltip-hide evolution-3.8.5/calendar/gui/e-day-view.c
|
|
|
7c6d83 |
--- evolution-3.8.5/calendar/gui/e-day-view.c.calendar-tooltip-hide 2014-08-25 17:37:19.145154935 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/calendar/gui/e-day-view.c 2014-08-25 17:38:55.403150856 +0200
|
|
|
7c6d83 |
@@ -405,6 +405,7 @@ static void e_day_view_queue_layout (EDa
|
|
|
7c6d83 |
static void e_day_view_cancel_layout (EDayView *day_view);
|
|
|
7c6d83 |
static gboolean e_day_view_layout_timeout_cb (gpointer data);
|
|
|
7c6d83 |
static void tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item);
|
|
|
7c6d83 |
+static EDayViewEvent *tooltip_get_view_event (EDayView *day_view, gint day, gint event_num);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
enum {
|
|
|
7c6d83 |
PROP_0,
|
|
|
7c6d83 |
@@ -4068,7 +4069,13 @@ e_day_view_show_popup_menu (EDayView *da
|
|
|
7c6d83 |
gint day,
|
|
|
7c6d83 |
gint event_num)
|
|
|
7c6d83 |
{
|
|
|
7c6d83 |
- tooltip_destroy (day_view, NULL);
|
|
|
7c6d83 |
+ EDayViewEvent *pevent = NULL;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ if (event_num >= 0)
|
|
|
7c6d83 |
+ pevent = tooltip_get_view_event (day_view, day, event_num);
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ if (pevent && pevent->canvas_item)
|
|
|
7c6d83 |
+ tooltip_destroy (day_view, pevent->canvas_item);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
day_view->popup_event_day = day;
|
|
|
7c6d83 |
day_view->popup_event_num = event_num;
|
|
|
7c6d83 |
diff -up evolution-3.8.5/calendar/gui/e-week-view.c.calendar-tooltip-hide evolution-3.8.5/calendar/gui/e-week-view.c
|
|
|
7c6d83 |
--- evolution-3.8.5/calendar/gui/e-week-view.c.calendar-tooltip-hide 2014-08-25 17:37:19.147154935 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/calendar/gui/e-week-view.c 2014-08-25 17:42:49.982140916 +0200
|
|
|
7c6d83 |
@@ -3212,6 +3212,28 @@ tooltip_destroy (EWeekView *week_view,
|
|
|
7c6d83 |
}
|
|
|
7c6d83 |
|
|
|
7c6d83 |
static gboolean
|
|
|
7c6d83 |
+e_week_view_handle_tooltip_timeout (gpointer user_data)
|
|
|
7c6d83 |
+{
|
|
|
7c6d83 |
+ ECalendarViewEventData *data = user_data;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ g_return_val_if_fail (data != NULL, FALSE);
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ return e_calendar_view_get_tooltips (data);
|
|
|
7c6d83 |
+}
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+static void
|
|
|
7c6d83 |
+e_week_view_destroy_tooltip_timeout_data (gpointer ptr)
|
|
|
7c6d83 |
+{
|
|
|
7c6d83 |
+ ECalendarViewEventData *data = ptr;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ if (data) {
|
|
|
7c6d83 |
+ g_object_set_data ((GObject *) data->cal_view, "tooltip-timeout", NULL);
|
|
|
7c6d83 |
+ g_object_unref (data->cal_view);
|
|
|
7c6d83 |
+ g_free (data);
|
|
|
7c6d83 |
+ }
|
|
|
7c6d83 |
+}
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+static gboolean
|
|
|
7c6d83 |
tooltip_event_cb (GnomeCanvasItem *item,
|
|
|
7c6d83 |
GdkEvent *event,
|
|
|
7c6d83 |
EWeekView *view)
|
|
|
7c6d83 |
@@ -3232,14 +3254,14 @@ tooltip_event_cb (GnomeCanvasItem *item,
|
|
|
7c6d83 |
pevent->y = ((GdkEventCrossing *) event)->y_root;
|
|
|
7c6d83 |
pevent->tooltip = NULL;
|
|
|
7c6d83 |
|
|
|
7c6d83 |
- data->cal_view = (ECalendarView *) view;
|
|
|
7c6d83 |
+ data->cal_view = g_object_ref (view);
|
|
|
7c6d83 |
data->day = -1;
|
|
|
7c6d83 |
data->event_num = event_num;
|
|
|
7c6d83 |
data->get_view_event = (ECalendarViewEvent * (*)(ECalendarView *, int, gint)) tooltip_get_view_event;
|
|
|
7c6d83 |
pevent->timeout = g_timeout_add_full (
|
|
|
7c6d83 |
G_PRIORITY_DEFAULT, 500,
|
|
|
7c6d83 |
- (GSourceFunc) e_calendar_view_get_tooltips,
|
|
|
7c6d83 |
- data, (GDestroyNotify) g_free);
|
|
|
7c6d83 |
+ e_week_view_handle_tooltip_timeout,
|
|
|
7c6d83 |
+ data, e_week_view_destroy_tooltip_timeout_data);
|
|
|
7c6d83 |
g_object_set_data ((GObject *) view, "tooltip-timeout", GUINT_TO_POINTER (pevent->timeout));
|
|
|
7c6d83 |
|
|
|
7c6d83 |
return TRUE;
|
|
|
7c6d83 |
@@ -3910,14 +3932,14 @@ e_week_view_on_text_item_event (GnomeCan
|
|
|
7c6d83 |
pevent->y = (gint) event_y_root;
|
|
|
7c6d83 |
pevent->tooltip = NULL;
|
|
|
7c6d83 |
|
|
|
7c6d83 |
- data->cal_view = (ECalendarView *) week_view;
|
|
|
7c6d83 |
+ data->cal_view = g_object_ref (week_view);
|
|
|
7c6d83 |
data->day = -1;
|
|
|
7c6d83 |
data->event_num = nevent;
|
|
|
7c6d83 |
data->get_view_event = (ECalendarViewEvent * (*)(ECalendarView *, int, gint)) tooltip_get_view_event;
|
|
|
7c6d83 |
pevent->timeout = g_timeout_add_full (
|
|
|
7c6d83 |
G_PRIORITY_DEFAULT, 500,
|
|
|
7c6d83 |
- (GSourceFunc) e_calendar_view_get_tooltips,
|
|
|
7c6d83 |
- data, (GDestroyNotify) g_free);
|
|
|
7c6d83 |
+ e_week_view_handle_tooltip_timeout,
|
|
|
7c6d83 |
+ data, e_week_view_destroy_tooltip_timeout_data);
|
|
|
7c6d83 |
g_object_set_data ((GObject *) week_view, "tooltip-timeout", GUINT_TO_POINTER (pevent->timeout));
|
|
|
7c6d83 |
|
|
|
7c6d83 |
return TRUE;
|
|
|
7c6d83 |
@@ -4709,6 +4731,14 @@ e_week_view_show_popup_menu (EWeekView *
|
|
|
7c6d83 |
GdkEvent *button_event,
|
|
|
7c6d83 |
gint event_num)
|
|
|
7c6d83 |
{
|
|
|
7c6d83 |
+ guint timeout;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (week_view), "tooltip-timeout"));
|
|
|
7c6d83 |
+ if (timeout) {
|
|
|
7c6d83 |
+ g_source_remove (timeout);
|
|
|
7c6d83 |
+ g_object_set_data (G_OBJECT (week_view), "tooltip-timeout", NULL);
|
|
|
7c6d83 |
+ }
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
week_view->popup_event_num = event_num;
|
|
|
7c6d83 |
|
|
|
7c6d83 |
e_calendar_view_popup_event (E_CALENDAR_VIEW (week_view), button_event);
|