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 342356 - gnome-settings-daemon draw zoom type background distorted
gnome-settings-daemon draw zoom type background distorted
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-19 15:39 UTC by kz
Modified: 2007-04-16 18:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
zoom type background is weird (731.59 KB, image/png)
2006-05-19 15:42 UTC, kz
  Details
fix zoom scaling (802 bytes, patch)
2007-04-13 21:53 UTC, Jens Granseuer
none Details | Review
Patch fixing the zoom (1.32 KB, patch)
2007-04-16 16:26 UTC, Erich Schubert
committed Details | Review

Description kz 2006-05-19 15:39:41 UTC
Please describe the problem:
I use ubuntu dapper. I removed nautilus. When turn
gconf:///desktop/gnome/background/draw_background true, background_callback() of
gnome-settings-daemon, I suppose, draw background. (Or just run
gnome-background-properties)

When background type is zoom, it's weird.

Steps to reproduce:
1. remove nautilus from session
2. restart X window
3. run gnome-background-properties, to recall background


Actual results:
Zoomed background widen only. Vertical calculation breaks.

Expected results:
Just the same as nautilus do.

Does this happen every time?
Yes.

Other information:
I believe I have no other programs running that draw background.
Comment 1 kz 2006-05-19 15:42:03 UTC
Created attachment 65846 [details]
zoom type background is weird
Comment 2 André Klapper 2006-10-02 10:14:56 UTC
kz, do you still face this issue in gnome 2.16?
do you think this is a duplicate of bug 337674?

bug 339404 could also be related here.
Comment 3 Rodney Dawes 2006-10-02 11:57:41 UTC
No. This is clearly a math problem from the screenshot. The image can still be set. It is just drawn incorrectly in the case where nautilus isn't running.
Comment 4 Elijah Newren 2006-10-22 00:17:26 UTC
Not remotely close to a showstopper; removing the gnome-target setting.
Comment 5 Erich Schubert 2007-04-13 12:29:47 UTC
I think I'm seeing the same here early during login.
Debian experimental, so e.g. gnome-control-center 2.16.3

My screen is 1440x900, my wallpapers are usually 4:3. When I login, the wallpaper is scaled as on the screenshot by kz; it looks like being scaled *1/x instead of *x.
Then after a second - supposedly when nautilus is started - the image is updated again, this time correctly zoomed. And if I disable nautilus, I can also reproduce this effect. I was twisting my head around the calculations in
http://svn.gnome.org/viewcvs/gnome-control-center/trunk/libbackground/applier.cbeing but they seem to be correct. They also don't differ between my gnome-control-center and nautilus (both 2.16.3)
Comment 6 Jens Granseuer 2007-04-13 21:53:36 UTC
Created attachment 86319 [details] [review]
fix zoom scaling

This patch seems to fix the issue for me. Can you confirm?

Nautilus probably doesn't show the same behaviour because it uses libeel for drawing the background, and libeel doesn't use libbackground.
Comment 7 Erich Schubert 2007-04-16 16:24:53 UTC
The patch didn't work for me.

There are some odd things in the code, too. For example the way xfactor is calculated... isn't the if construct superfluous?

I also wonder if we don't need to use xfactor/yfactor in the 'zoom' case as well. What is field vs. virtual anyway?

Hmm... assuming (p = pix, v = screen)
pwidth, pheight = 4, 3
virtw, virth = 16, 9

in this situation (16/4 > 9/3), we want the results
zoom factor = 4.0 = virtw / pwidth
swidth = 4 = pwidth
sheight = 2.25 = virth / zoom = pwidth * (virth / virtw)

the other situation, e.g.
pwidth, pheight = 16, 9
virtw, virth = 32, 24

we want the results (since 32/16 < 24/9)
zoom factor = 2.66 = virth / pheight
swidth = 12 = virtw / zoom = pheight * (virtw / virth)
sheight = 9
Comment 8 Erich Schubert 2007-04-16 16:26:39 UTC
Created attachment 86438 [details] [review]
Patch fixing the zoom

The first hunk fixes a minor thing, the second hunk is the actual bug fix.
Note that nautilus 2.16.3 did the right thing already, I don't know which code it uses.
Comment 9 Jens Granseuer 2007-04-16 18:50:54 UTC
That looks better, indeed. Thanks.

2007-04-16  Jens Granseuer  <jensgr@gmx.net>

        Patch by: Erich Schubert <erich@debian.org>

        * applier.c: (get_geometry): fix scaling for WPTYPE_ZOOM. Fixes
        bug #342356.