gtkcalendar emitting incorrect day_selected signal

Bug #785479 reported by Mark W
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTK+
Expired
Wishlist
wxWidgets
Unknown
Unknown
gtk+2.0 (Ubuntu)
Triaged
Low
Unassigned

Bug Description

When clicking (or selecting via keyboard) on the days surrounding a month in the gtk calendar widget, the widget emits two day_selected events.

The first, with an incorrect date, is emitted by calendar_set_month_prev & next functions.. the second emitted correctly from calendar_select_and_focus_day.

When calendar_set_month_prev & next is called by the calendar_main_button_press and gtk_calendar_key_press, this first signal needs to be blocked. (calendar_set_month_prev & next are also called, but correctly from the month back and forward buttons)

When changing from a month with more days (with one of those days selected) to a following month with less days, the first signal emitted in this case contains an invalid date.

You can verify this behaviour in the gtk calendar sample. For example click may 31st, then click on June 1st in the surrounding days.

I submitted a patch upstream (for the svn version) on this issue. A fix along these lines could be used in gtk+2.0
https://bugzilla.gnome.org/show_bug.cgi?id=106161

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: libgtk2.0-0 2.24.4-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Fri May 20 10:33:52 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 LANGUAGE=en_AU:en
 PATH=(custom, no user)
 LANG=
 LC_MESSAGES=en_AU.UTF-8
 SHELL=/bin/bash
SourcePackage: gtk+2.0
UpgradeStatus: Upgraded to natty on 2011-04-19 (30 days ago)

Revision history for this message
Mark W (jedimark64) wrote :
Changed in gtk:
importance: Unknown → Wishlist
status: Unknown → Confirmed
Revision history for this message
Mark W (jedimark64) wrote :

This patch removes the gtk_calendar_select_day out of calendar_set_month_prev & next functions, and moves them to where they are needed, stopping the duplicate signals.

This is cleaner than the other patch I sent upstream.

Revision history for this message
Mark W (jedimark64) wrote :

Gah.. please Ignore that patch.. it needs work..

Revision history for this message
Mark W (jedimark64) wrote :

This one works correctly.

Also stops the assert errors when moving between months via surrounding days.

tags: added: patch
Changed in gtk+2.0 (Ubuntu):
status: New → Triaged
Changed in gtk+2.0 (Ubuntu):
importance: Undecided → Low
tags: added: patch-needswork
removed: patch
Revision history for this message
Mark W (jedimark64) wrote :

What's needed to improve this patch?

I would like to see this bug fixed. It's holding up part of my work.

Revision history for this message
Sebastien Bacher (seb128) wrote :

sorry I tagged based on comment #3 but I didn't notice you updated it after that, you should open a bug on bugzilla.gnome.org with your patch, we will not likely change the gtk behaviour in an ubuntu specific way so that should go upstream for review

Changed in gtk:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.