attr. opacity? after a few scales image disappear

Bug #260288 reported by Vladimir
4
Affects Status Importance Assigned to Milestone
gDesklets
Fix Released
High
gDesklets Core Team
Nominated for 0.3x by Rhett Trappman

Bug Description

here ex.:
<?xml version="1.0" encoding="UTF-8"?>

<display>
    <image uri="/usr/share/pixmaps/gdesklets.png"
 on-enter="myOpa(self, 2, 1.0)"
 on-leave="myOpa(self, 1, 0.6)"/>
    <label id="mylabel" value="Hello World!" font="Sans 3cm" color="red"/>
    <prefs>
 <color label="Text Color:" bind="Dsp.mylabel.color"/>
    </prefs>
<script>
status = 0
def myOpa(s,sc,opa):
    s.scale = sc
    s.opacity = opa
</script>
</display>

After enter the image a few times, the one disappear (opacity --> "0")!
if i change scale in line [on-leave="myOpa(self, 1, 0.6)"/>] from "1" to something else (1.1 or 0.9 for ex. [on-leave="myOpa(self, 1.1, 0.6) ] ) the applet works ok!

Revision history for this message
Bjoern Koch (h.humpel) wrote :

Confirmed here.
Strange, but true: changing it to
       on-enter="myOpa(2, 0.6)"
       on-leave="myOpa(1, 1.0)"/>
works perfectly... ?!

Changed in gdesklets:
importance: Undecided → Medium
milestone: none → release-of-0.36.2
status: New → Confirmed
Bjoern Koch (h.humpel)
Changed in gdesklets:
milestone: release-of-0.36.2 → release-of-0.36.3
Revision history for this message
Bjoern Koch (h.humpel) wrote :

Pushing it up for the next release (0.36.3) ;).

Changed in gdesklets:
importance: Medium → High
Changed in gdesklets:
assignee: nobody → gDesklets Desklet Team (gdesklets-desklet-team)
Joe Sapp (sappj)
Changed in gdesklets:
assignee: gDesklets Desklet Team (gdesklets-desklet-team) → gDesklets Core Team (gdesklets-core-team)
Revision history for this message
Bjoern Koch (h.humpel) wrote :

OK, this one is *really* strange:

on-leave="myOpa(self, 0.999, 0.6)" => WORKING
on-leave="myOpa(self, 1.0, 0.6)" => error
on-leave="myOpa(self, 1.01, 0.6)" => error
on-leave="myOpa(self, 1.02, 0.6)" => error
on-leave="myOpa(self, 1.021, 0.6)" => WORKING

and still (see comment #1): changing on-leave and on-enter is working fine.

OK, just some debugging output to narrow it down (TargetImage.py, lines 172+ changed to):
-----
        self.__widget.render(imgwidth, imgheight, opacity, saturation)
        self.__current_width = imgwidth
        self.__current_height = imgheight
        self.__current_opacity = opacity
        self.__current_saturation = saturation
        print "Opacity: "+str(opacity)
        print "Saturation: "+str(saturation)
        print "Width: "+str(imgwidth)
        print "Height: "+str(imgheight)+"\n"
-----

Is guess this shows when the error occurs:

On startup:

Opacity: 1.0
Saturation: 1.0
Width: 48
Height: 48

Using on-leave="myOpa(self, 1.02, 0.6)", moving in and out:

Opacity: 1.0
Saturation: 1.0
Width: 96
Height: 96

Opacity: 0.6
Saturation: 1.0
Width: 48
Height: 48

Using on-leave="myOpa(self, 1.021, 0.6)", moving in and out:

Opacity: 1.0
Saturation: 1.0
Width: 96
Height: 96

Opacity: 0.6
Saturation: 1.0
Width: 49
Height: 49

And using on-leave="myOpa(self, 0.999, 0.6)", moving in and out:
width and height are set to 47.

So it looks likeeverything is fine when width and height get a new value.

Still wondering why changing on-enter and on-leave (see comment #1) is working though...

Revision history for this message
Bjoern Koch (h.humpel) wrote :

Gotcha!

The problme was in utils/render.c:

-----
  if (srcwidth != width || srcheight != height)
    scaled = gdk_pixbuf_scale_simple (pbuf, width, height, GDK_INTERP_BILINEAR);
  else
    scaled = pbuf;
-----

Now the image gets re-rendered everytime (even if width and height stay the same) and everything is working fine.
I am not sure if this has a significant impact on the performace of gDesklets... ?!

Anyway, fixed in rev. #142.

Changed in gdesklets:
status: Confirmed → Fix Committed
Bjoern Koch (h.humpel)
Changed in gdesklets:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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