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 672111 - Random grey box on logout
Random grey box on logout
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-15 00:30 UTC by Peter Hurley
Modified: 2012-03-19 13:04 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
[PATCH 1/1] libpanel-applet: Fix random grey box on logout (3.15 KB, patch)
2012-03-15 00:34 UTC, Peter Hurley
reviewed Details | Review
[PATCH v2 1/1] libpanel-applet: Fix random grey box on logout (3.23 KB, patch)
2012-03-15 13:02 UTC, Peter Hurley
none Details | Review
[PATCH v3 1/1] libpanel-applet: Fix random grey box on logout (1.60 KB, patch)
2012-03-15 13:05 UTC, Peter Hurley
reviewed Details | Review
[PATCH v4 1/1] libpanel-applet: Fix random grey box on logout (1.99 KB, patch)
2012-03-19 12:54 UTC, Peter Hurley
committed Details | Review

Description Peter Hurley 2012-03-15 00:30:05 UTC
When logging out, a grey box briefly appears in the upper left corner of the screen. This is commonly referred to as the "random grey box on logout".
Comment 1 Peter Hurley 2012-03-15 00:34:09 UTC
Created attachment 209795 [details] [review]
[PATCH 1/1] libpanel-applet: Fix random grey box on logout



See patch commit message for how and why this patch works
Comment 2 Vincent Untz 2012-03-15 09:13:54 UTC
Review of attachment 209795 [details] [review]:

Thanks for tracking this down!

The one major issue I can see is that everything we do in unrealize should be to match something done in realize. I agree that, in this specific case, it shouldn't matter much, but still.

So there are several ways to deal with it:
 - connect to the signal in realize
 - block the signal in init (and when we unrealize), and unblock it on realize
 - check that we're realized in panel_applet_container_plug_removed() before emitting "applet-broken"

I don't really like any of those solutions, but the last one feels the less broken to me. Maybe it's just a matter of taste.

Also, did you check everything still works fine by killing an applet while the panel is running?

::: gnome-panel/libpanel-applet-private/panel-applet-container.c
@@ +164,3 @@
+	 *  from being generated. This prevents the "random grey box on
+	 *  logout"
+	 */

"* " instead of "*  " to have proper alignment in the comment :-)
Comment 3 Peter Hurley 2012-03-15 13:00:25 UTC
I'm fine with any solution that works.  There's actually a bug in the existing patch (forgot to forward the unrealize -- whoops), so I'm attaching that patch as v2.

I'm also attaching a much simpler v3 patch based on option 3 above (ie, check the realized state). However, checking the realized state of the PanelAppletContainer doesn't work because gtk_widget_unrealize doesn't set the unrealized state until *after the children are unrealized* -- so the patch checks the unrealized state of the socket instead. Ok?
Comment 4 Peter Hurley 2012-03-15 13:02:12 UTC
Created attachment 209831 [details] [review]
[PATCH v2 1/1] libpanel-applet: Fix random grey box on logout
Comment 5 Peter Hurley 2012-03-15 13:05:59 UTC
Created attachment 209832 [details] [review]
[PATCH v3 1/1] libpanel-applet: Fix random grey box on logout
Comment 6 Vincent Untz 2012-03-16 08:11:59 UTC
Review of attachment 209832 [details] [review]:

Thanks, I think that's the approach I like best. A few comments, though:

Did you check it worked fine for the non-logout cases? (You can simulate an applet crashing by killing its process)

::: gnome-panel/libpanel-applet-private/panel-applet-container.c
@@ +230,3 @@
 static gboolean
 panel_applet_container_plug_removed (PanelAppletContainer *container)
 {

We need a comment explaining why we check the realized state of the socket. Something like:
"If the socket is not realized, then it means the container is getting unrealized and that's why the plug is removed."

@@ +232,3 @@
 {
+	if (!gtk_widget_get_realized (container->priv->socket))
+		return FALSE;

Actually, I wouldn't return FALSE: I'd just move the "g_signal_emit" in this if:

if (!gtk_widget_get_realized (container->priv->socket))
  g_signal_emit (container, signals[APPLET_BROKEN], 0);

I think we want to keep all the other code in this function when this occurs.
Comment 7 Peter Hurley 2012-03-16 12:23:27 UTC
I just forgot to mention that earlier: I tested both reload and don't reload code paths, and they function as expected.

Sure, I'll add a comment.

I just exited here because all the functionality for cleaning up after the container is in panel_applet_container_dispose. The functionality in panel_applet_container_plug_removed is present only for when the applet is being restarted so the relevant container state needs to be reset. I could add that to the comment as well.

That said, if you'd still prefer to execute this cleanup anyway, I'll just conditionalize the APPLET_BROKEN signal as you suggest.
Comment 8 Vincent Untz 2012-03-16 13:36:46 UTC
(In reply to comment #7)
> I just forgot to mention that earlier: I tested both reload and don't reload
> code paths, and they function as expected.

Good to know, thanks!

> I just exited here because all the functionality for cleaning up after the
> container is in panel_applet_container_dispose. The functionality in
> panel_applet_container_plug_removed is present only for when the applet is
> being restarted so the relevant container state needs to be reset. I could add
> that to the comment as well.
> 
> That said, if you'd still prefer to execute this cleanup anyway, I'll just
> conditionalize the APPLET_BROKEN signal as you suggest.

The reason I prefer to execute that cleanup is to avoid any kind of assumption like "we're getting unrealized, so we'll be disposed too very soon". It's likely a true statement, but not something that can be taken for granted.
Comment 9 Peter Hurley 2012-03-19 12:54:00 UTC
Created attachment 210087 [details] [review]
[PATCH v4 1/1] libpanel-applet: Fix random grey box on logout

Made requested changes; re-tested ok.
Comment 10 Vincent Untz 2012-03-19 13:04:17 UTC
Comment on attachment 210087 [details] [review]
[PATCH v4 1/1] libpanel-applet: Fix random grey box on logout

Thanks, pushed!