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 644122 - appmenu not showing icon
appmenu not showing icon
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
[gnome3-important]
: 644274 646760 (view as bug list)
Depends on:
Blocks: GnomeShell301
 
 
Reported: 2011-03-07 15:17 UTC by William Jon McCann
Modified: 2011-04-25 20:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
app-menu: Update clip on icon size changes (2.48 KB, patch)
2011-03-29 12:41 UTC, Florian Müllner
reviewed Details | Review
app-menu: Update clip on icon size changes (2.63 KB, patch)
2011-04-18 18:41 UTC, Florian Müllner
reviewed Details | Review
app-menu: Update clip on icon size changes (2.60 KB, patch)
2011-04-25 14:34 UTC, Florian Müllner
none Details | Review
app-menu: Update clip on icon size changes (2.62 KB, patch)
2011-04-25 20:07 UTC, Florian Müllner
committed Details | Review

Description William Jon McCann 2011-03-07 15:17:36 UTC
Try doing an alt-f2-r and you'll see there is no icon in the AppMenu until you hover over it.
Comment 1 Dan Winship 2011-03-07 15:35:24 UTC
probably another "we were accidentally depending on clutter queuing a redraw that it didn't need to" bug
Comment 2 Dan Winship 2011-03-08 18:27:01 UTC
poked at this a bit... it's not "needs a queue_redraw". The actor is painting, it's just painting nothing for some reason.
Comment 3 Florian Müllner 2011-03-09 08:42:38 UTC
*** Bug 644274 has been marked as a duplicate of this bug. ***
Comment 4 Florian Müllner 2011-03-28 16:26:28 UTC
OK, I poked around a little and I got a vague idea what's going on - I should be able to come up with a patch later ...
Comment 5 Florian Müllner 2011-03-29 12:41:26 UTC
Created attachment 184577 [details] [review]
app-menu: Update clip on icon size changes

To keep the app icon from overlapping the panel's (border-image)
border, a custom property for clipping the app menu icon's bottom
was introduced. But if the clip region is set before the initial
icon is set, the entire actor ends up clipped. Also the double
meaning of clutter_actor_get_height() (e.g. preferred height versus
allocated height), the clip region may end up too large and the icon
overlaps the panel's border-image.
Fix both problems by updating the clip region on size changes as
well, rather than on style changes only.
Comment 6 Dan Winship 2011-04-05 01:39:53 UTC
*** Bug 646760 has been marked as a duplicate of this bug. ***
Comment 7 Owen Taylor 2011-04-15 18:43:23 UTC
Review of attachment 184577 [details] [review]:

It looks like an improvement to me, but maybe only half a fix?

::: js/ui/panel.js
@@ +347,3 @@
             this._iconBox.set_clip(0, 0,
                                    this._iconBox.width,
+                                   this._iconBox.height - this._iconBottomClip);

the width seems to come into this as well? Maybe switch to using notify::allocation? (and get_allocation_box() if you want to avoid the breakage that is the clutter width/height properties, which when a resize is queued magically change to the size request, then change back to the allocation once the actor is allocate.)
Comment 8 Florian Müllner 2011-04-18 18:41:51 UTC
Created attachment 186223 [details] [review]
app-menu: Update clip on icon size changes

(In reply to comment #7)
> the width seems to come into this as well? Maybe switch to using
> notify::allocation? (and get_allocation_box() if you want to avoid the breakage
> that is the clutter width/height properties, which when a resize is queued
> magically change to the size request, then change back to the allocation once
> the actor is allocate.)

Yeah - the width shouldn't change at all, but using the actual allocation rather than whatever clutter reports as height at a given moment seems like a good idea anyway ...
Comment 9 Owen Taylor 2011-04-21 22:37:31 UTC
Review of attachment 186223 [details] [review]:

Sentence in the message body no verb.

 "Also the double
  meaning of clutter_actor_get_height() (e.g. preferred height versus
  allocated height), the clip region may end up too large and the icon
  overlaps the panel's border-image."

::: js/ui/panel.js
@@ +345,3 @@
+    _updateIconBoxClip: function() {
+        let allocation = this._iconBox.get_allocation_box();
+        if (allocation && this._iconBottomClip > 0)

result of allocation() is always a rectangle, so check is a little over-conservative.

One thing that's now bothering me is that get_allocation_box() actually synchronously forces a stage layout whenever we get the style-changed signal, which I think is *before* we are supposed to allocate the stage on initial creation. There's no way I know of to just say "give me the allocation to the best of your knowledge and tell me when it changes later". 

Ugh.

So, maybe we need to go back to your version - width and ::height which have their own issues, but don't cause an extra allocation to occur at a weird time on shell startup.
Comment 10 Florian Müllner 2011-04-25 14:34:26 UTC
Created attachment 186601 [details] [review]
app-menu: Update clip on icon size changes

(In reply to comment #9)
> So, maybe we need to go back to your version - width and ::height which have
> their own issues, but don't cause an extra allocation to occur at a weird time
> on shell startup.

*Sigh*

Re-attaching previous patch version (with an additional signal connection to notify::width) ...
Comment 11 Florian Müllner 2011-04-25 14:37:34 UTC
(In reply to comment #9)
> Review of attachment 186223 [details] [review]:
> 
> Sentence in the message body no verb.

Woops, still present in the re-attached version ...


>  "Also the double
>   meaning of clutter_actor_get_height()

Changed to:
"Also due to the double meaning ..."
Comment 12 Florian Müllner 2011-04-25 19:52:59 UTC
(In reply to comment #9)
> One thing that's now bothering me is that get_allocation_box() actually
> synchronously forces a stage layout whenever we get the style-changed signal,
> which I think is *before* we are supposed to allocate the stage on initial
> creation. There's no way I know of to just say "give me the allocation to the
> best of your knowledge and tell me when it changes later".

Hmm, on 2nd thought - the allocation property doesn't trigger a stage relayout (but may not be set, so over-conservative check would be necessary then) ... maybe worth using that instead?
Comment 13 Owen Taylor 2011-04-25 19:55:31 UTC
(In reply to comment #12)
> (In reply to comment #9)
> > One thing that's now bothering me is that get_allocation_box() actually
> > synchronously forces a stage layout whenever we get the style-changed signal,
> > which I think is *before* we are supposed to allocate the stage on initial
> > creation. There's no way I know of to just say "give me the allocation to the
> > best of your knowledge and tell me when it changes later".
> 
> Hmm, on 2nd thought - the allocation property doesn't trigger a stage relayout
> (but may not be set, so over-conservative check would be necessary then) ...
> maybe worth using that instead?

Ah, that would work. It actually is always set though:

    case PROP_ALLOCATION:
      g_value_set_boxed (value, &priv->allocation);
      break;

&priv->allocation can never be NULL.
Comment 14 Florian Müllner 2011-04-25 20:07:02 UTC
Created attachment 186615 [details] [review]
app-menu: Update clip on icon size changes

(In reply to comment #13)
> Ah, that would work. It actually is always set though:

Oh, right - I removed the check.
Comment 15 Owen Taylor 2011-04-25 20:16:29 UTC
Review of attachment 186615 [details] [review]:

Looks good.

::: js/ui/panel.js
@@ +348,3 @@
             this._iconBox.set_clip(0, 0,
+                                   allocation.x2 - allocation.x1,
+                                   allocation.y2 - allocation.y1 - this._iconBottomClip);

This could set a clip with negative width/height, which in my reading of clutter which seems to be allowed but have undefined semantics (depending on the exact code paths followed it can do differnet things). But I think it's OK since we should never have a negative rectangle when we're actually painting.
Comment 16 Florian Müllner 2011-04-25 20:24:29 UTC
Attachment 186615 [details] pushed as d97657b - app-menu: Update clip on icon size changes

(In reply to comment #15)
> This could set a clip with negative width/height, which in my reading of
> clutter which seems to be allowed but have undefined semantics (depending on
> the exact code paths followed it can do differnet things). But I think it's OK
> since we should never have a negative rectangle when we're actually painting.

Right. We used to get a negative height with the original code, but now it should only happen if we fail to get an icon (in which case I suppose we don't really care about the icon's clip anyway).