Merge lp:~teemperor/pantheon-greeter/fix-first-wallpaper-fails-to-show into lp:~elementary-pantheon/pantheon-greeter/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cody Garver | ||||
Approved revision: | 318 | ||||
Merged at revision: | 328 | ||||
Proposed branch: | lp:~teemperor/pantheon-greeter/fix-first-wallpaper-fails-to-show | ||||
Merge into: | lp:~elementary-pantheon/pantheon-greeter/trunk | ||||
Diff against target: |
27 lines (+5/-2) 1 file modified
src/Wallpaper.vala (+5/-2) |
||||
To merge this branch: | bzr merge lp:~teemperor/pantheon-greeter/fix-first-wallpaper-fails-to-show | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
elementary Pantheon team | Pending | ||
Review via email: mp+239134@code.launchpad.net |
Commit message
Correctly ignore Exceptions due to cancelled loading. This prevents multiple load-calls that close behind each other from aborting each other, thus causing the default wallpaper to load.
Description of the change
There is a race-condition in the loading-code. When the same background is loaded twice in a short period, the second loading-attempt cancels the first. This causes the the first-loading attempt to reach the catch-block and will start to load the backup-wallpaper. The attempt to load the backup-wallpaper will then cancel the second attempt and we only see the default-wallpaper.
The reason for the catch-block was that we use the fallback in case we can't load the actual wallpaper. However, cancelling a operation also causes a exception and the current code assumes that there was an actual error with the wallpaper, but instead he should just stop loading.
This patch will catch the CANCELLED-Errors and will not start to load the default-wallpaper in this case (which is the correct behaviour and prevents the race-condition).
Important: The switchboard- plug-pantheon is a bit broken and is not informing accountsservices about your wallpaper. So you have to use the set-wallpaper- contract of files to set your background before testing this!.