summaryrefslogtreecommitdiff
path: root/gtk/gtkcalendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r--gtk/gtkcalendar.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 435b43437..96cad9e03 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -23,7 +23,7 @@
*/
/*
- * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
+ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
@@ -512,7 +512,7 @@ column_from_x (GtkCalendar *calendar,
x_left = left_x_for_column (calendar, c);
x_right = x_left + GTK_CALENDAR_PRIVATE_DATA (calendar)->day_width;
- if (event_x > x_left && event_x < x_right)
+ if (event_x >= x_left && event_x < x_right)
{
column = c;
break;
@@ -549,7 +549,7 @@ row_from_y (GtkCalendar *calendar,
y_top = top_y_for_row (calendar, r);
y_bottom = y_top + height;
- if (event_y > y_top && event_y < y_bottom)
+ if (event_y >= y_top && event_y < y_bottom)
{
row = r;
break;
@@ -796,6 +796,10 @@ gtk_calendar_main_button (GtkWidget *widget,
row = row_from_y (calendar, y);
col = column_from_x (calendar, x);
+
+ /* If row or column isn't found, just return. */
+ if (row == -1 || col == -1)
+ return;
day_month = calendar->day_month[row][col];