[MASTER] Firefox 3 "set as Desktop background" does not work properly

Bug #206191 reported by Christer Edwards
94
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Medium
firefox-3.0 (Ubuntu)
Fix Released
High
Alexander Sack
Hardy
Fix Released
High
Unassigned
Intrepid
Fix Released
High
Alexander Sack

Bug Description

Binary package hint: firefox-3.0

I navigated to a .jpg online and used right-click, set as desktop background to try and update my desktop wallpaper. Nothing actually happens. I can see the preview in the window for all the options (scale, stretch, center) but selecting the option to save the changes seems to ignore my input. Although, if you select a different color the background seems to apply properly, regardless of new or previous color selection.

ii firefox-3.0 3.0~b4+nobinon lightweight web browser based on Mozilla
2.6.24-12-generic

Revision history for this message
In , Caillon (caillon) wrote :

Might as well take the bug... :-)

Revision history for this message
In , Caillon (caillon) wrote :

Sylvain, does this appear to be needed even after your crash fix? The patch is correct AFAICT, and does "the right thing" but I'm still wondering why it works in Fx2 on the same system without this patch. Either way, if it is needed, I think we should attempt to take it.

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

Yes it should be needed because it fixes another issue. It is not about crashing but rather how the Set Desktop Background is able to read the background color from Gconf. Here's some steps how I can reproduce the issue:
1) Open gnome-appearance-properties and set the Desktop background to a red Solid color for instance
2) Launch Fx2 or Fx3, right click on an image and choose "Set As Desktop Background"
3) Select "Center" so that you can see the color around the image in the small screen image.
4) Expected: should be red / Actual: grey color.

Now try to manually set the gconf key /desktop/gnome/background/primary_color to "#f00" and do the above steps again.

I just typed this, and now that I'm trying the second step on Fx3, I'm always getting a black background color on the monitor icon (even if I have #f00 in gconf) without an error in the console :-/. Might be yet another bug hiding there.

Revision history for this message
In , Reed Loden (reed) wrote :

Comment on attachment 308501
Patch to support GConf's actual format

gavin, do the above comments address your issues?

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

Created attachment 308760
New GConf format, fix color computation

I found two other issues in nsGNOMEShellService: HexToNum was wrong for alphanumerical values and the bit shifting in HexToRGB is apparently not done in the correct direction. I also added support for the 9 sized color format and added a test. Now I'm not getting the black background issue I mentioned previously any more.

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

The attached patch will conflict with bug 420786 (for the test part). I'll update afterward.

Revision history for this message
In , Caillon (caillon) wrote :

Created attachment 309596
Nothing to see here...

Actually, I think we should do it this way. GDK has parse and to_string methods which we can use here. Not only does this cut out a lot of code, but it writes out to the format that GNOME and GConf expects. The math is slightly more tricky, though, since GDK has 16 bits per channel, so we need to do an additional shift. Macros to the rescue, though.

Revision history for this message
In , Caillon (caillon) wrote :

Created attachment 309597
Let GDK deal with it's own colors

Sigh, the correct patch this time...

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

That latest patch looks like a better approach. Does it still pass the tests?

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

Created attachment 309807
added tests to Christopher's patch

Yes, this looks like a better way. I had to adapt the tests because unspecified bits take other values when using gdk. I also added tests for the other direction shell -> gconf.

Hmm, I'm just seeing now in the API of gdk_color_to_string (): Since 2.12. But configure.in says: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/configure.in&rev=1.1959&mark=120#120 that seems bad :-/

Revision history for this message
In , Reed Loden (reed) wrote :

If support for this was only added in 2.12, we can't take this patch. If you want, you can support everything that's in 2.10 normally and then use gtk_check_version() to conditionally support the 2.12 stuff, but we cannot support any gtk changes after 2.10 as required.

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

ok, gdk_color_parse is in 2.10 so a large part of the patch is still fine. ColorToHex should be kept instead of using gdk_color_to_string().

Revision history for this message
In , Caillon (caillon) wrote :

Meh. Right. It was late and I somehow confused gdk as part of glib, which had a req of 2.12....

Revision history for this message
In , Caillon (caillon) wrote :

I'll post a new patch tonight to check the version at compile time. I'd rather use the GDK codepath where possible to support future versions that may or may not change the way things are displayed as strings, especially since we know that GdkColor's fields won't be changing since it needs to maintain compat; thus we can rely on it being our intermediary here though we can't rely on the strings.

Revision history for this message
Christer Edwards (christer.edwards) wrote : [hardy beta] Firefox 3.0b4 "set as Desktop background" does not respond

Binary package hint: firefox-3.0

I navigated to a .jpg online and used right-click, set as desktop background to try and update my desktop wallpaper. Nothing actually happens. I can see the preview in the window for all the options (scale, stretch, center) but selecting the option to save the changes seems to ignore my input.

ii firefox-3.0 3.0~b4+nobinon lightweight web browser based on Mozilla
2.6.24-12-generic

Revision history for this message
Christer Edwards (christer.edwards) wrote :
Revision history for this message
Andrea Colangelo (warp10) wrote :

I can confirm this bug on the same release (Hardy beta) and with the same firefox version.

Changed in firefox-3.0:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Doug-NSF (dbaggett) wrote :

It's actually a bit stranger for me. When I choose "Set as Background Image" the window to set the background image comes up but the window is empty (Screenshot attached). Then when I change the option in that window from "Tile" (the image shows up in the window) and then back to "center" the image shows up like it should in the window, but still clicking the the "set Desktop background" button does not work.

Note that setting the background image via Appearances preferences does work fine.

Revision history for this message
Christer Edwards (christer.edwards) wrote :

Yeah, mine acts in a similar way. I do have to select one of the options before the graphic shows up.

Saving the graphic locally and then setting it via one of the local applications (gthumb) it works just fine..

Revision history for this message
Gordon (masterlight) wrote :
Revision history for this message
Charles Brophy (charlesbrophy) wrote :

I can confirm this. You click the "Set as Background" button and its completely unresponsive.

Revision history for this message
JD (jacobdorne) wrote :

Exactly the same for me as Doug-NSF said above.

I'm using Ubuntu 8.04 beta with the latest updates until this post.

Revision history for this message
In , Caillon (caillon) wrote :

Created attachment 312156
Updated to check GTK+ version

Hm, I thought I attached this already...

Revision history for this message
Pedro Villavicencio (pedro) wrote : Re: [hardy beta] Firefox 3.0b4 "set as Desktop background" does not respond

thanks for your report.

Changed in firefox-3.0:
assignee: nobody → asac
Revision history for this message
Alexander Sack (asac) wrote :

works in 3.0b5

Changed in firefox-3.0:
status: Confirmed → Fix Released
Revision history for this message
Breno Leitão (breno-leitao) wrote :

I' ve just installed Ubuntu 8.04 and I got the same problem described.
Firefox 3.0b5 doesn' t change my wallpaper, and also doesn't save the file as Firefox_wallpaper.png.

Revision history for this message
Breno Leitão (breno-leitao) wrote :

I' ve found that as soon as you click on " Set as Default Background", the next windows doesn' t show the image inside that monitor. Take a look at the screen shot.
If you click on "Center" in the position field, then everything goes fine.

Changed in firefox-3.0:
status: Fix Released → Incomplete
Revision history for this message
John Vivirito (gnomefreak) wrote : Re: [Bug 206191] Re: [hardy beta] Firefox 3.0b4 "set as Desktop background" does not respond

Can you please provide a link to a picture you tried to set as
background i would like to try this with that picture first than i will
see what i can come up with on why he thinks its fixed, it could be the
pics your using but i would need one or more (as many as possible up to
4 or 5 links

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

Revision history for this message
Alexander Sack (asac) wrote : Re: [hardy beta] Firefox 3.0b4 "set as Desktop background" does not respond

could you please test upstream builds? Does it work with their 3.0b5 build?

Revision history for this message
th (daimoni) wrote :

The bug is still in Hardy final (with all updates).

Tried to set http://www.cgpolis.com/artworks/digital/sailing_ship.jpg as background, nothing happens when clicking Set Desktop background.

Revision history for this message
kindofabuzz (kindofabuzz) wrote :

There is a temp fix for this: edit gconf key /desktop/gnome/background/primary_color to a 6 digit instead of a 12 digit. There is also a patch that will perm fix this mentioned here: https://bugzilla.mozilla.org/show_bug.cgi?id=421977 the devs need to include this patch into firefox and all would be well

Revision history for this message
Alexander Sack (asac) wrote :
Changed in firefox-3.0:
status: Incomplete → Triaged
Revision history for this message
Alexander Sack (asac) wrote :

potential cherry-pick suitable for hardy. not (yet) milestoning for now.

Changed in firefox-3.0:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Alexander Sack (asac) wrote :

important feature broken.

Changed in firefox-3.0:
importance: Medium → High
Changed in firefox:
status: Unknown → In Progress
Revision history for this message
kindofabuzz (kindofabuzz) wrote : Re: [MASTER] Firefox 3 "set as Desktop background" does not work

seems fixed now. might have been one of the hardy proposed updates that fixed it for me.

Revision history for this message
kindofabuzz (kindofabuzz) wrote :

ignore my previous comment. i was in windows when i tried it. lol

Revision history for this message
In , Alexander Sack (asac) wrote :

Comment on attachment 312156
Updated to check GTK+ version

moving review from gavin to mconnor.

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Comment on attachment 312156
Updated to check GTK+ version

>diff -up mozilla/browser/components/shell/src/nsGNOMEShellService.cpp.gconf mozilla/browser/components/shell/src/nsGNOMEShellService.cpp

>+ColorToCString(PRUint32 aColor, nsCString& aResult)

>+ gchar *colorString = gdk_color_to_string(&color);
>+ aResult.Adopt(colorString);
>+ g_free(colorString);

Shouldn't you copy the string here?

Looks fine otherwise. Make sure to land the test too?

Revision history for this message
canishk (canishk) wrote : Re: [MASTER] Firefox 3 "set as Desktop background" does not work

the same problem occurred when trying firefox 3 in Ubuntu 7.10 - the Gutsy Gibbon version also..

Revision history for this message
Steven Rose (steveydoteu) wrote :

I get the same issue as Doug-NSF.

Revision history for this message
Sergio Zanchetta (primes2h) wrote :

It's not fixed for me with hardy proposed updates installed.
Firefox 3.0.1

Revision history for this message
John Vivirito (gnomefreak) wrote :

Not fixed in any 3.0.1 that we package until mozilla marks it fix released the fix wont be released so there is really no use saying it doesnt work or its not fixed looking at top of bug you can see its not fixed

Revision history for this message
wmensah (wmensah-wvu) wrote :

got the same problem.....doesn't work in the browser but when i save to desktop, for example, and then try to set as wallpaper after opening the image, it works.

Revision history for this message
In , Adam Guthrie (ispiked) wrote :

caillon, I guess this patch just fell through the cracks, or do you need help landing it?

BlueLander (socialnerd)
description: updated
Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

Created attachment 334243
Christopher's version with test and Assign

(In reply to comment #17)
> >+ gchar *colorString = gdk_color_to_string(&color);
> >+ aResult.Adopt(colorString);
> >+ g_free(colorString);
>
> Shouldn't you copy the string here?

yeah, adopting doesn't look right according to the comment in ./string/public/nsXPCOMStrings.h:
  /* Data passed into NS_StringContainerInit2 is not copied; instead, the
   * string takes ownership over the data pointer. The caller must have
   * allocated the data array using the XPCOM memory allocator (nsMemory).
   * This flag should not be combined with NS_STRING_CONTAINER_INIT_DEPEND. */
  NS_STRING_CONTAINER_INIT_ADOPT = (1 << 2),

And I'm getting glibc double free errors with it. I've replaced it with Assign and added the tests.

Revision history for this message
In , Benjamin Smedberg (Mozilla) [:bs] (benjamin-smedbergs) wrote :
Revision history for this message
In , Benjamin Smedberg (Mozilla) [:bs] (benjamin-smedbergs) wrote :

Backed out due to unit-test failure:
*** TEST-UNEXPECTED-FAIL | ../../../../_tests/xpcshell-simple/test_browser_shell/unit/test_421977.js | #000000 == #000000000000

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

The #if/#else in ColorToCString does different things on different GTK versions. In particular, gdk_color_to_string is documented as returning #rrrrggggbbbb while the sprintf is using %02 formats. Hence the test failure: on tinderbox we're taking the #else branch, I would guess.

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

Created attachment 334578
fix test failure by using #rrrrggggbbbb everywhere

thanks for the investigation. This new version uses the 48bit format in both cases, which should fix the test failure.

Changed in firefox:
status: In Progress → Confirmed
Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

checkin-needed, then?

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

(In reply to comment #24)
> checkin-needed, then?

Yes, it should be

Revision history for this message
Forest (fdenger-gmail) wrote :

Confirmed. 8.04 ubuntu, with all updates on 8/27/08. firefox version 3.0.1

I get no reaction from clicking the apply the wallpaper. And the preview doesn't work until I select tile or another mode.

My system works fine to update walpaper the normal way through right clicking on the desktop.

Revision history for this message
Colin Watson (cjwatson) wrote :

From yesterday's foundations team meeting:

<asac> actually i thought the background image thing was fix committed
<slangasek> asac: an easy bug report to resolve, then ;)
<asac> slangasek: yeah ;)
<asac> ah. i think the idea was to get that committed upstream and let that sink down to us.

Revision history for this message
In , Dao (dao) wrote :
Revision history for this message
In , Dao (dao) wrote :

*** Bug 437292 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Dao (dao) wrote :

*** Bug 454929 has been marked as a duplicate of this bug. ***

Changed in firefox:
status: Confirmed → Fix Released
Revision history for this message
homophoni (davidkirby) wrote :

i am also experiencing this bug in ubuntu intrepid ibex alpha 6.

Revision history for this message
Alexander Sack (asac) wrote :

fix committed to firefox-3.0.head branch (rev 343)

Changed in firefox-3.0:
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox-3.0 - 3.0.2+build6+nobinonly-0ubuntu2

---------------
firefox-3.0 (3.0.2+build6+nobinonly-0ubuntu2) intrepid; urgency=low

  * fix LP: #273907 - abrowser does not start: :$pkglibdir/abrowser link
    missing; we introduce the proper link in the firefox-3.0 package
    - update debian/rules
  * fix LP: #269795 - abrowser shouldn't display the EULA; we fix this by
    using brand.properties to determine whether we have official branding or
    not. In turn the about:rights notification only gets displayed when
    official build is running.
    - update debian/patches/lp269656_know_your_rights.patch
  * fix LP: #206191 - Firefox 3 "set as Desktop background" does not work
    properly; we cherry-pick latest upstream patch from bugzilla
    - add debian/patches/bz421977_att334578.patch
    - update debian/patches/series

 -- Alexander Sack <email address hidden> Wed, 24 Sep 2008 18:48:23 +0200

Changed in firefox-3.0:
status: Fix Committed → Fix Released
Revision history for this message
In , Fta+bugzilla (fta+bugzilla) wrote :

Comment on attachment 334578
fix test failure by using #rrrrggggbbbb everywhere

Requesting approval for 1.9.0.4. We are using this patch downstream in Ubuntu now.
See https://bugs.launchpad.net/ubuntu/+source/firefox-3.0/+bug/206191

Revision history for this message
In , Dveditz (dveditz) wrote :

Comment on attachment 334578
fix test failure by using #rrrrggggbbbb everywhere

Doesn't appear to match security update release criteria, not approving, 3.1 will be out soon enough.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

Comment on attachment 334578
fix test failure by using #rrrrggggbbbb everywhere

Shouldn't the expected results be
>+ checkShellToGConfColor("#000000", "#000000000000");
>+ checkShellToGConfColor("#0000FF", "#00000000ffff");
>+ checkShellToGConfColor("#FFFFFF", "#ffffffffffff");
>+ checkShellToGConfColor("#0A0B0C", "#0a0a0b0b0c0c");
>+ checkShellToGConfColor("#A0B0C0", "#a0a0b0b0c0c0");
>+ checkShellToGConfColor("#AABBCC", "#aaaabbbbcccc");

instead of
>+ checkShellToGConfColor("#000000", "#000000000000");
>+ checkShellToGConfColor("#0000FF", "#00000000ff00");
>+ checkShellToGConfColor("#FFFFFF", "#ff00ff00ff00");
>+ checkShellToGConfColor("#0A0B0C", "#0a000b000c00");
>+ checkShellToGConfColor("#A0B0C0", "#a000b000c000");
>+ checkShellToGConfColor("#AABBCC", "#aa00bb00cc00");

??

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

*** Bug 461657 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

(In reply to comment #31)
> (From update of attachment 334578 [details])
> Shouldn't the expected results be
(...)
> >+ checkShellToGConfColor("#AABBCC", "#aaaabbbbcccc");
>
> instead of
(...)
> >+ checkShellToGConfColor("#AABBCC", "#aa00bb00cc00");
>
> ??

In which case replacing
#define COLOR_8_TO_16_BIT(_c) ((_c) << 8)
with
#define COLOR_8_TO_16_BIT(_c) ((_c) << 8 | (_c))
would be enough.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

PR_snprintf(buf, 14, "#%02x00%02x00%02x00", red, green, blue);
would also need to be changed to
PR_snprintf(buf, 14, "#%02x%02x%02x%02x%02x%02x", red, red, green, green, blue, blue);

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Mike: could you file a new bug for that and CC the relevant people from this one?

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :
Revision history for this message
Michael Langerhorst (m-langerhorst) wrote :

I still have exactly this described problem in Firefox 3.0.3 with all current updates.
Seems not to be fixed for all occasions.

Revision history for this message
kindofabuzz (kindofabuzz) wrote :

Works for me now. I don't know when it started to work because I actually forgot all about the bug. Using Intrepid with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081111 Minefield/3.1b2pre ID:20081111020802

Revision history for this message
captaintrav (captaintrav) wrote :

Maybe this is a regression in 3.0.3? I just finished setting up a fresh install of Hardy (i386) , and finished applying all updates, and have this issue with Firefox 3.0.3..

Revision history for this message
KIAaze (zohn-joidberg) wrote : Re: [Bug 206191] Re: [MASTER] Firefox 3 "set as Desktop background" does not work properly

It's fixed for me with firefox v3.0.3.

$apt-cache policy firefox-3.0
firefox-3.0:
  Installed: 3.0.3+nobinonly-0ubuntu2
  Candidate: 3.0.3+nobinonly-0ubuntu2
  Version table:
 *** 3.0.3+nobinonly-0ubuntu2 0
        500 http://de.archive.ubuntu.com intrepid/main Packages
        100 /var/lib/dpkg/status

--
Unlock your computing: http://www.getgnulinux.org/

Revision history for this message
KIAaze (zohn-joidberg) wrote :

Just in case, I tested it with different image sizes and tiled,
centered, stretched:
http://img108.imageshack.us/img108/6733/tux9jd.jpg (1024x768)
http://www.imagecows.com/uploads/2995-tux_avatars.png (429x377)

Everything worked, so I guess it's not related to non-power of 2 textures. :)

Revision history for this message
KIAaze (zohn-joidberg) wrote :

Oh, and I don't use compiz. I don't know if this is important to
mention for this bug, but I remember it affecting other bugs.

Changed in firefox:
importance: Unknown → Medium
Changed in firefox-3.0 (Ubuntu Hardy):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.