After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726119 - [UI calendar] days aren't highlighted anymore
[UI calendar] days aren't highlighted anymore
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: system-status
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 726804 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-11 17:10 UTC by Igor Gnatenko
Modified: 2014-03-21 00:20 UTC
See Also:
GNOME target: ---
GNOME version: 3.11/3.12


Attachments
Calendar: force-rebuild the calendar when the events change (2.38 KB, patch)
2014-03-12 17:52 UTC, Giovanni Campagna
reviewed Details | Review
Calendar: force-rebuild the calendar when the events change (970 bytes, patch)
2014-03-13 12:36 UTC, Giovanni Campagna
committed Details | Review

Description Igor Gnatenko 2014-03-11 17:10:04 UTC
Version of component:
gnome-shell-3.11.91-1.fc21.x86_64

Steps to reproduce:
1. Open mini-calendar from GS

Actual results:
Seems events, but days not highlighted (on 3.10.x it was highlighted)

Expected results:
Seems events and days highlighted
Comment 1 Giovanni Campagna 2014-03-12 17:15:12 UTC
The code to highlight events is there, maybe it's a theming issue?
For example, does it work in classic?
Comment 2 Giovanni Campagna 2014-03-12 17:52:24 UTC
Created attachment 271636 [details] [review]
Calendar: force-rebuild the calendar when the events change

Don't overoptimize and skip the rebuild when the month is the same,
as the calendar depends on the events too.

Turns out it was not a theming bug...
Comment 3 Stéphane Démurget 2014-03-12 17:58:24 UTC
Just tried the patch: works like a charm, thanks!
Comment 4 Igor Gnatenko 2014-03-12 18:50:26 UTC
Review of attachment 271636 [details] [review]:

Reported-and-Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

Yeah. This patch fixes this bug. Also.. Would this patch fix another bug with no events in cal ?

Thank you for this patch
Comment 5 Giovanni Campagna 2014-03-12 18:51:55 UTC
(In reply to comment #4)
> Review of attachment 271636 [details] [review]:
> 
> Reported-and-Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
> 
> Yeah. This patch fixes this bug. Also.. Would this patch fix another bug with
> no events in cal ?

I don't know, It would require testing with the conditions of the other bugs...
Comment 6 Florian Müllner 2014-03-12 19:56:08 UTC
Review of attachment 271636 [details] [review]:

::: js/ui/calendar.js
@@ +424,2 @@
         }));
+        this._update(true);

Not a big fan of non-obvious bool parameters - do we actually need anything but _rebuildCalendar() from _update() here? Can't we just call _rebuildCalendar() directly wherever you would pass true?
Comment 7 Giovanni Campagna 2014-03-12 21:01:21 UTC
(In reply to comment #6)
> Review of attachment 271636 [details] [review]:
> 
> ::: js/ui/calendar.js
> @@ +424,2 @@
>          }));
> +        this._update(true);
> 
> Not a big fan of non-obvious bool parameters - do we actually need anything but
> _rebuildCalendar() from _update() here? Can't we just call _rebuildCalendar()
> directly wherever you would pass true?

Yeah, but then sometimes we would call _rebuildCalendar() twice, I wanted to avoid that by putting all the logic in one place.
Comment 8 Florian Müllner 2014-03-12 22:32:20 UTC
(In reply to comment #7)
> Yeah, but then sometimes we would call _rebuildCalendar() twice

How does forcing _rebuildCalendar() in _update() change that? There is no logic to guard against this, so if update(true) is called multiple times, the calendar is rebuild each time (just as with calling _rebuildCalendar() directly multiple times).
Comment 9 Giovanni Campagna 2014-03-12 22:44:10 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Yeah, but then sometimes we would call _rebuildCalendar() twice
> 
> How does forcing _rebuildCalendar() in _update() change that? There is no logic
> to guard against this, so if update(true) is called multiple times, the
> calendar is rebuild each time (just as with calling _rebuildCalendar() directly
> multiple times).

Yes, but it would be once.
The twice I'm referring to would be calling _update(), and that calling _rebuildCalendar() for unrelated reasons, and then calling _rebuildCalendar() right after that.
If the logic is inside _update(), this does not happen, the shouldRebuild variable is merely "more" true.
Comment 10 Florian Müllner 2014-03-12 22:49:26 UTC
(In reply to comment #9)
> Yes, but it would be once.
> The twice I'm referring to would be calling _update(), and that calling
> _rebuildCalendar() for unrelated reasons, and then calling _rebuildCalendar()
> right after that.

Ah. But what I'm saying is that I don't see how changes to events or the show-weekdate setting affects anything but the calendar, so my suggestion was to call _rebuildCalendar() directly instead (rather than in addition to _update()). Of course I may be overlooking something ...
Comment 11 Giovanni Campagna 2014-03-12 22:58:22 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > Yes, but it would be once.
> > The twice I'm referring to would be calling _update(), and that calling
> > _rebuildCalendar() for unrelated reasons, and then calling _rebuildCalendar()
> > right after that.
> 
> Ah. But what I'm saying is that I don't see how changes to events or the
> show-weekdate setting affects anything but the calendar, so my suggestion was
> to call _rebuildCalendar() directly instead (rather than in addition to
> _update()). Of course I may be overlooking something ...

_rebuildCalendar() will destroy the button list, but will not highlight the new one or re-grab focus, _update() does that.
Comment 12 Jasper St. Pierre (not reading bugmail) 2014-03-12 23:00:13 UTC
(In reply to comment #9)
> Yes, but it would be once.
> The twice I'm referring to would be calling _update(), and that calling
> _rebuildCalendar() for unrelated reasons, and then calling _rebuildCalendar()
> right after that.
> If the logic is inside _update(), this does not happen, the shouldRebuild
> variable is merely "more" true.

If you call _rebuildCalendar() and then _update(), the month will be the same so we'll fizzle the second call out.
Comment 13 Giovanni Campagna 2014-03-13 12:36:10 UTC
Created attachment 271705 [details] [review]
Calendar: force-rebuild the calendar when the events change

Don't overoptimize and skip the rebuild when the month is the same,
as the calendar depends on the events too.
Comment 14 Florian Müllner 2014-03-13 12:49:22 UTC
Review of attachment 271705 [details] [review]:

OK
Comment 15 Igor Gnatenko 2014-03-13 12:52:12 UTC
(In reply to comment #13)
> Created an attachment (id=271705) [details] [review]
> Calendar: force-rebuild the calendar when the events change
> 
> Don't overoptimize and skip the rebuild when the month is the same,
> as the calendar depends on the events too.
yeah. this patch also works for me.
Comment 16 Giovanni Campagna 2014-03-13 13:13:13 UTC
Attachment 271705 [details] pushed as e117aa5 - Calendar: force-rebuild the calendar when the events change
Comment 17 Florian Müllner 2014-03-21 00:20:35 UTC
*** Bug 726804 has been marked as a duplicate of this bug. ***