[evolution] Bug 537048 - [Month view] Clicking outside of appointment doesn't stop editing
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 537048 - [Month view] Clicking outside of appointment doesn't stop editing
- Date: Tue, 30 May 2017 12:03:02 +0000 (UTC)
commit 7657705f951820e45b40b4b0563b715415541cb5
Author: Milan Crha <mcrha redhat com>
Date: Tue May 30 14:01:16 2017 +0200
Bug 537048 - [Month view] Clicking outside of appointment doesn't stop editing
src/calendar/gui/e-week-view.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/gui/e-week-view.c b/src/calendar/gui/e-week-view.c
index 7ae3139..2fcede5 100644
--- a/src/calendar/gui/e-week-view.c
+++ b/src/calendar/gui/e-week-view.c
@@ -2836,8 +2836,16 @@ ewv_pass_gdkevent_to_etext (EWeekView *week_view,
span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index +
week_view->editing_span_num);
if (span->text_item && E_IS_TEXT (span->text_item)) {
- GNOME_CANVAS_ITEM_GET_CLASS (span->text_item)->event (span->text_item, gevent);
- return TRUE;
+ gdouble x1 = 0.0, y1 = 0.0, x2 = 0.0, y2 = 0.0, ex = 0.0, ey = 0.0;
+
+ gdk_event_get_coords (gevent, &ex, &ey);
+
+ gnome_canvas_item_get_bounds (span->text_item, &x1, &y1, &x2, &y2);
+
+ if (ex >= x1 && ex <= x2 && ey >= y1 && ey <= y2) {
+ GNOME_CANVAS_ITEM_GET_CLASS (span->text_item)->event (span->text_item,
gevent);
+ return TRUE;
+ }
}
}
@@ -2871,6 +2879,8 @@ e_week_view_on_button_press (GtkWidget *widget,
if (week_view->pressed_event_num != -1)
return FALSE;
+ e_week_view_stop_editing_event (week_view);
+
if (event_button == 1 && button_event->type == GDK_2BUTTON_PRESS) {
time_t dtstart, dtend;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]