[gnome-calendar/ui-rewrite] gcal-month-view: added security check



commit d55584acf4defc2d32af37b29b53bbe448a1f9f7
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Thu Jul 4 10:02:25 2013 -0400

    gcal-month-view: added security check
    
    Prevented button release handling when not needed

 src/gcal-month-view.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 80e346f..a199e9f 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -913,6 +913,9 @@ gcal_month_view_button_release (GtkWidget      *widget,
 
   priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (widget));
 
+  if (priv->clicked_cell == -1)
+    return FALSE;
+
   x = event->x;
   y = event->y;
 
@@ -935,7 +938,7 @@ gcal_month_view_button_release (GtkWidget      *widget,
   released = 7 * ( floor ( (y - (lines_gap_for_5 * v_block))  / (v_block) )) +
              floor (event->x / (width / 7));
 
-  /* whether the event is inside the days of the month */
+  /* whether the event is out of the days of the month */
   if (released < priv->days_delay + 7 * february_gap ||
       released >= days)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]