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 719803 - Various fixes for the background code
Various fixes for the background code
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-03 21:16 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-12-04 00:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
background: Fix the check for spanning backgrounds (967 bytes, patch)
2013-12-03 21:16 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
background: Remove more bogus checks (1.28 KB, patch)
2013-12-03 21:16 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
background: Don't wait for gdk-pixbuf to fail before loading animations (2.10 KB, patch)
2013-12-03 21:16 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
background: Fix the check for spanning backgrounds (967 bytes, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Remove more bogus checks (2.12 KB, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
background: Don't wait for gdk-pixbuf to fail before loading animations (2.08 KB, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
background: Remove the system noise content when not in use (985 bytes, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Remove unused variable (1.43 KB, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Simplify animation code (3.20 KB, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Clarify the intent of the code (2.20 KB, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Add copied content from pending image loads to the cache (1.21 KB, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Don't silently fizzle out when removing bad content from the cache (1.11 KB, patch)
2013-12-03 23:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Remove more bogus checks (1.51 KB, patch)
2013-12-03 23:28 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
background: Don't wait for gdk-pixbuf to fail before loading animations (2.22 KB, patch)
2013-12-04 00:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-12-03 21:16:31 UTC
Happened out of a memory leak investigation that ended up finding
stuff like this... still working on the background cache
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-12-03 21:16:34 UTC
Created attachment 263443 [details] [review]
background: Fix the check for spanning backgrounds

this._monitorIndex does not exist, and neither does
MetaBackground.monitor_index...
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-12-03 21:16:40 UTC
Created attachment 263444 [details] [review]
background: Remove more bogus checks

The effects on the image don't matter, as we'll re-set the effects
when we copy the candidate content, and the content can never be
null...
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-12-03 21:16:45 UTC
Created attachment 263445 [details] [review]
background: Don't wait for gdk-pixbuf to fail before loading animations

We don't have any better way of determining whether something is a slideshow
animation, so discriminate on the .xml filename instead of waiting for
gdk-pixbuf to determine whether it can load a file or not.
Comment 4 Ray Strode [halfline] 2013-12-03 22:28:33 UTC
Review of attachment 263443 [details] [review]:

looks right
Comment 5 Ray Strode [halfline] 2013-12-03 22:30:24 UTC
Review of attachment 263444 [details] [review]:

The point is to avoid having to reset the effects if we don't need to.  Note, that check happens after the candidate is assigned so it still gets used if there's nothing better.
Comment 6 Ray Strode [halfline] 2013-12-03 22:31:39 UTC
Review of attachment 263445 [details] [review]:

::: js/ui/background.js
@@ +543,2 @@
                                       cancellable: this._cancellable,
                                       onFinished: Lang.bind(this, function(content) {

don't you still need to return if content is null? (image fails to load for other reason?)
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:31 UTC
Created attachment 263458 [details] [review]
background: Fix the check for spanning backgrounds

this._monitorIndex does not exist, and neither does
MetaBackground.monitor_index...
Comment 8 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:34 UTC
Created attachment 263459 [details] [review]
background: Remove more bogus checks

The effects on the image don't matter, as we'll re-set the effects
when we copy the candidate content, and the content can never be
null...
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:38 UTC
Created attachment 263460 [details] [review]
background: Don't wait for gdk-pixbuf to fail before loading animations

We don't have any better way of determining whether something is a slideshow
animation, so discriminate on the .xml filename instead of waiting for
gdk-pixbuf to determine whether it can load a file or not.
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:41 UTC
Created attachment 263461 [details] [review]
background: Remove the system noise content when not in use
Comment 11 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:44 UTC
Created attachment 263462 [details] [review]
background: Remove unused variable
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:49 UTC
Created attachment 263463 [details] [review]
background: Simplify animation code
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:52 UTC
Created attachment 263464 [details] [review]
background: Clarify the intent of the code

Stomping on local variables and trying to keep loop state isn't
too fun. Just use a new variable here so we aren't too confused
with what we're doing.
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:55 UTC
Created attachment 263465 [details] [review]
background: Add copied content from pending image loads to the cache
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:15:59 UTC
Created attachment 263466 [details] [review]
background: Don't silently fizzle out when removing bad content from the cache

If the background is already removed, or we're trying to remove bad content,
this is probably a bug in content accounting, so let us crash so we can fix
the bugs.
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:28:24 UTC
Created attachment 263467 [details] [review]
background: Remove more bogus checks

The content in these arrays can never be null...


--

Sorry, bugmail was down because of the maintenance, so I didn't see these reviews.

The code here isn't too clear, and I even had to double-check that it
is doing what you said it would, so I got confused.
Comment 17 Jasper St. Pierre (not reading bugmail) 2013-12-03 23:38:42 UTC
Comment on attachment 263458 [details] [review]
background: Fix the check for spanning backgrounds

Attachment 263458 [details] pushed as 04ea950 - background: Fix the check for spanning backgrounds


Nothing changed here, so it's still ACN. I just didn't see the review.
Comment 18 Ray Strode [halfline] 2013-12-03 23:57:08 UTC
Review of attachment 263461 [details] [review]:

sure
Comment 19 Ray Strode [halfline] 2013-12-03 23:58:33 UTC
Review of attachment 263462 [details] [review]:

++
Comment 20 Ray Strode [halfline] 2013-12-04 00:02:50 UTC
Review of attachment 263463 [details] [review]:

this doesn't really seem to make the code simpler to me... but i'm pretty indifferent, if you feel strongly.
Comment 21 Ray Strode [halfline] 2013-12-04 00:04:07 UTC
Review of attachment 263464 [details] [review]:

ok
Comment 22 Ray Strode [halfline] 2013-12-04 00:07:45 UTC
Review of attachment 263465 [details] [review]:

Should have a justification like: "This way if the original is removed from the cache, any subsequent copies will be available in the cache for future loads"
Comment 23 Ray Strode [halfline] 2013-12-04 00:08:10 UTC
Review of attachment 263466 [details] [review]:

Okay. Do you have reason to believe this is happening?
Comment 24 Jasper St. Pierre (not reading bugmail) 2013-12-04 00:09:52 UTC
Review of attachment 263466 [details] [review]:

It was happening before, which is when we attempted to removeImageContent for the pendingFileLoad contents that were never added to the cache.
Comment 25 Ray Strode [halfline] 2013-12-04 00:11:38 UTC
Review of attachment 263467 [details] [review]:

i think that's right.
Comment 26 Ray Strode [halfline] 2013-12-04 00:13:53 UTC
Review of attachment 263460 [details] [review]:

::: js/ui/background.js
@@ +536,2 @@
                                       cancellable: this._cancellable,
                                       onFinished: Lang.bind(this, function(content) {

i think you still need if (!content) { return; } here. "Is a slide show" isn't the only reason content can be null, right?
Comment 27 Jasper St. Pierre (not reading bugmail) 2013-12-04 00:15:06 UTC
Created attachment 263471 [details] [review]
background: Don't wait for gdk-pixbuf to fail before loading animations

We don't have any better way of determining whether something is a slideshow
animation, so discriminate on the .xml filename instead of waiting for
gdk-pixbuf to determine whether it can load a file or not.
Comment 28 Ray Strode [halfline] 2013-12-04 00:19:55 UTC
Review of attachment 263471 [details] [review]:

i think this is fine.  Bonus points for falling back to gdk-pixbuf in case it's an svg file or something
Comment 29 Jasper St. Pierre (not reading bugmail) 2013-12-04 00:22:52 UTC
Attachment 263461 [details] pushed as 7f3aadc - background: Remove the system noise content when not in use
Attachment 263462 [details] pushed as adb49bd - background: Remove unused variable
Attachment 263463 [details] pushed as 8875907 - background: Simplify animation code
Attachment 263464 [details] pushed as 5262a41 - background: Clarify the intent of the code
Attachment 263465 [details] pushed as 4cfb000 - background: Add copied content from pending image loads to the cache
Attachment 263466 [details] pushed as 7249b11 - background: Don't silently fizzle out when removing bad content from the cache
Attachment 263467 [details] pushed as dbdc884 - background: Remove more bogus checks
Attachment 263471 [details] pushed as eb1c85f - background: Don't wait for gdk-pixbuf to fail before loading animations