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 703001 - Blue background drawn when switching output using hardware keys
Blue background drawn when switching output using hardware keys
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: background
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 703773 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-06-24 18:21 UTC by Lionel Landwerlin
Modified: 2013-11-15 15:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
background: fix asynchronous management of background loading operations (7.43 KB, patch)
2013-06-24 18:24 UTC, Lionel Landwerlin
reviewed Details | Review
background: fix asynchronous management of background loading operations (7.43 KB, patch)
2013-07-03 09:53 UTC, Lionel Landwerlin
committed Details | Review
0013-background-async.patch (7.33 KB, patch)
2013-07-14 14:00 UTC, Pacho Ramos
none Details | Review
0013-background-async.patch.out (7.46 KB, text/plain)
2013-07-14 14:00 UTC, Pacho Ramos
  Details
background.js.rej (5.50 KB, text/plain)
2013-07-14 14:02 UTC, Pacho Ramos
  Details

Description Lionel Landwerlin 2013-06-24 18:21:36 UTC
My laptop features a hardware key to switch between clone/multimonitor/external/internal outputs. What happens when pressing that key is that the X server sends a shit load of Xrandr events (and possibly some root window Configure events). So the shell ends up seeing 11/12 events triggering recreation of the background actor/content.

The Shell also features a component to load the background picture asynchronously and tries to limit the number of loads for a same picture (typical use case for the multimonitor setup).

The problem is that the shell gather all the requests under the same  meta_background_load_file_async call using one GCancellable (the first one to come). So when the shell receives 12 events, it creates 12 new background managers which end up trying to load the 12 times the same background picture. All of these requests are batched into the same meta_background_load_file_async using the first GCancellable received on the first request. Unfortunately, when the first request is cancelled by the following event indicating a new monitor setup, all of the background picture requests are dropped on the floor, and nothing is loaded (hence the blue screen background).

Attached a patch to fix that problem.
Comment 1 Lionel Landwerlin 2013-06-24 18:24:26 UTC
Created attachment 247666 [details] [review]
background: fix asynchronous management of background loading operations
Comment 2 drago01 2013-06-27 15:42:30 UTC
Review of attachment 247666 [details] [review]:

Patch looks ok, but I cannot reproduce it here so didn't test.

::: js/ui/background.js
@@ +186,3 @@
                                               }
 
+                                              let needCopy = false;

needsCopy
Comment 3 Lionel Landwerlin 2013-07-03 09:53:01 UTC
Created attachment 248294 [details] [review]
background: fix asynchronous management of background loading operations
Comment 4 drago01 2013-07-03 15:57:22 UTC
Review of attachment 248294 [details] [review]:

OK to push assuming it works (can't reproduce the bug here).
Comment 5 Lionel Landwerlin 2013-07-03 16:04:48 UTC
Thanks, pushed to 3.8 and master.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-07-08 17:14:35 UTC
*** Bug 703773 has been marked as a duplicate of this bug. ***
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-07-08 17:14:59 UTC
I assume this doesn't need to be open anymore.
Comment 8 Pacho Ramos 2013-07-14 13:58:59 UTC
For some reason it doesn't apply for me
Comment 9 Pacho Ramos 2013-07-14 14:00:26 UTC
Created attachment 249120 [details] [review]
0013-background-async.patch
Comment 10 Pacho Ramos 2013-07-14 14:00:48 UTC
Created attachment 249121 [details]
0013-background-async.patch.out
Comment 11 Pacho Ramos 2013-07-14 14:01:54 UTC
And the same on a fresh 3.8.3 untarred package:
$ patch -p1 <../gnome-shell-3.8.3-patches/0013-background-async.patch
patching file js/ui/background.js
Hunk #1 FAILED at 142.
Hunk #2 FAILED at 178.
2 out of 3 hunks FAILED -- saving rejects to file js/ui/background.js.rej
Comment 12 Pacho Ramos 2013-07-14 14:02:24 UTC
Created attachment 249122 [details]
background.js.rej
Comment 13 Pacho Ramos 2013-07-28 19:12:56 UTC
they were wrongly downloaded :S, sorry for the noise

As a side note, looks like this causes some "hangs" in my setup:
https://bugzilla.gnome.org/show_bug.cgi?id=704646
Comment 14 Ray Strode [halfline] 2013-08-16 19:33:13 UTC
reopening because of the problems this patch has uncovered.
Comment 15 Kamil Páral 2013-08-20 08:55:21 UTC
I still see this with gnome-shell-3.8.4-1.fc19.x86_64. Sometimes I have a blue background on one of my displays. It happens erratically. Tell me if you need me to debug it more.
Comment 16 drago01 2013-08-20 09:22:54 UTC
(In reply to comment #15)
> I still see this with gnome-shell-3.8.4-1.fc19.x86_64. Sometimes I have a blue
> background on one of my displays. It happens erratically. Tell me if you need
> me to debug it more.

"yum update gnome-shell" is all you need (gnome-shell-3.8.4-2.fc19.x86_64 has the fix). This bug is a different issue (something with xrandr event spam when pressing the hw keys).
Comment 17 Jasper St. Pierre (not reading bugmail) 2013-11-15 15:44:35 UTC
I don't think this is an issue anymore...