Re: GtkCalendar bug + patch




Damon Chaplin <damon@helixcode.com> writes:

> GtkCalendar has a bug (GTK+ 1.2.6).
> If you click between rows or columns it may jump to other months or days.

OK, this looks good to me, so I'm going ahead and applying it. 

Shawn - you should look this over just to make sure we aren't
misunderstanding your code...

Thanks for the patch,
                                        Owen


> --- gtkcalendar.c.orig  Wed Feb 24 10:14:57 1999
> +++ gtkcalendar.c       Fri Jan 21 21:58:55 2000
> @@ -507,7 +507,7 @@
>        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;
> @@ -544,7 +544,7 @@
>        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;
> @@ -793,6 +793,10 @@
>    
>    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];
>    
> 
> Damon



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