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 738725 - Regression in dateMenu.js
Regression in dateMenu.js
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: calendar
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 741516 741656 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-10-17 21:23 UTC by Darcy
Modified: 2015-02-26 23:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixed _isToday(date) call (827 bytes, patch)
2014-10-23 20:14 UTC, Darcy
committed Details | Review
Set label to visible when updated visibility (883 bytes, patch)
2014-10-24 01:54 UTC, Darcy
rejected Details | Review
Construct a button and give it a label. (2.21 KB, patch)
2014-11-05 21:22 UTC, Darcy
none Details | Review

Description Darcy 2014-10-17 21:23:11 UTC
BUG:
Opening the date menu for the first time results in a blank Day, Month, Date and Year but opening the second time makes it appear.

STEPS TO REPRODUCE:
Open date menu for the first time, then open for a second time.  Can reproduce by restarting GNOME and testing again.

VERSION:
3.14-1
Comment 1 Jasper St. Pierre (not reading bugmail) 2014-10-18 04:17:47 UTC
It seems the label is painted black the first time you open the menu for some reason. If you look really closely you can see the text as completely black.
Comment 2 Darcy 2014-10-18 05:01:24 UTC
Yeah, I can see it if I look down at the monitor (not at normal viewing angles). Weird.  

If you place the code inside that 'if(open)' section before the this.menu.connect('open-state-changed'... then it draws the date the first time correctly.
Comment 3 Darcy 2014-10-23 20:14:56 UTC
Created attachment 289233 [details] [review]
Fixed _isToday(date) call

Open the calendar and click on any day in the week that is above/below.  This causes the button up the top to become non-reactive.
Comment 4 Florian Müllner 2014-10-23 20:18:34 UTC
Review of attachment 289233 [details] [review]:

Good catch. Please separate subject (max ~70 characters) from the body in the commit message, otherwise good.
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-10-23 20:45:07 UTC
This is unrelated to the original bug report, though.
Comment 6 Darcy 2014-10-23 21:05:16 UTC
@Jasper, sorry about that, I noticed this while trying to find the first one.  Should I open a new bug and put it there?
Comment 7 Florian Müllner 2014-10-23 21:07:05 UTC
No, this is fine - the bug should just be left open until the original problem is fixed.
Comment 8 Darcy 2014-10-24 01:54:08 UTC
Created attachment 289242 [details] [review]
Set label to visible when updated visibility

It seems like the call works in 'open-changed...' but the visibility of the button is overwritten by something else later in the constructor.  Putting the _date.visible to true makes it appear first time.

This is probably the wrong place to set the visibility but couldn't think of anything more clever.
Comment 9 Florian Müllner 2014-10-24 02:01:30 UTC
Review of attachment 289242 [details] [review]:

This sets items' visibility depending on whether the user configured any calendars. It doesn't make any sense to hide the date label when there are no calendars.
Comment 10 Florian Müllner 2014-11-03 14:05:26 UTC
Comment on attachment 289233 [details] [review]
Fixed _isToday(date) call

Pushed acn patch with fixed up commit message.
Comment 11 Darcy 2014-11-05 21:22:58 UTC
Created attachment 290059 [details] [review]
Construct a button and give it a label.

Thanks Florian.  That previous patch was a stupid one and only worked because I accidentally left some code in there from before.

What would be wrong with constructing the button with the date label then updating it on each open, something like what I attached?  I'm not sure how the scope works when passing a function as an argument.
Comment 12 Jasper St. Pierre (not reading bugmail) 2014-11-05 22:09:57 UTC
What happens when the user comes back in a few days and clicks the button?
Comment 13 Darcy 2014-11-05 22:12:43 UTC
(In reply to comment #12)
> What happens when the user comes back in a few days and clicks the button?

Isn't that still handled in the 'on-opened' code?
Comment 14 Florian Müllner 2014-11-05 22:13:27 UTC
(In reply to comment #12)
> What happens when the user comes back in a few days and clicks the button?

The label is still updated each time the menu is opened. I had stumbled upon this as well, because the code in the patch now hides this fairly well ...
Comment 15 Jasper St. Pierre (not reading bugmail) 2014-11-05 22:15:15 UTC
I'm curious why your patch fixes the issue then, because the only difference is that we also set the label on startup, but also when the user clicks the button.
Comment 16 Florian Müllner 2014-11-05 22:17:46 UTC
(In reply to comment #11)
> What would be wrong with constructing the button with the date label then
> updating it on each open, something like what I attached?

You could just use a pseudo label like 'Hack: make sure the label is shown' (no point in setting the actual date when it will always be overridden on open).
It would still be interesting to figure out why this is happening.
Comment 17 Darcy 2014-11-05 22:25:00 UTC
I was hoping you guys might know why it works.  I can sink some more time into it in a few more weeks and *maybe* come up with a solution (but horribly unlikely).
Comment 18 Florian Müllner 2014-12-14 17:37:10 UTC
*** Bug 741516 has been marked as a duplicate of this bug. ***
Comment 19 Florian Müllner 2014-12-17 15:05:36 UTC
*** Bug 741656 has been marked as a duplicate of this bug. ***
Comment 20 Florian Müllner 2015-02-26 23:05:56 UTC
Accidentally fixed when implementing the new calendar/notification design.