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 682683 - ScreenShield/MessageTray: fix crash after the introduction of close buttons
ScreenShield/MessageTray: fix crash after the introduction of close buttons
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-08-25 19:05 UTC by Giovanni Campagna
Modified: 2012-09-03 21:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ScreenShield/MessageTray: fix crash after the introduction of close buttons (4.23 KB, patch)
2012-08-25 19:05 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-08-25 19:05:07 UTC
Commit 5c6b1fd0c modified the hierarchy of SummaryItem contents, by
introducing a notificationStackWidget in place of the StackView, but
forgot to update the bits in ScreenShield.NotificationsBox that accessed
and reparented that directly, causing a crash by invalid theme node access.
Comment 1 Giovanni Campagna 2012-08-25 19:05:10 UTC
Created attachment 222427 [details] [review]
ScreenShield/MessageTray: fix crash after the introduction of close buttons
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-08-25 19:19:41 UTC
Review of attachment 222427 [details] [review]:

The close button fixes seem unrelated.

::: js/ui/messageTray.js
@@ +1260,3 @@
+
+    set closeButtonVisible(v) {
+        this._closeButton.visible = v;

The notification controls its own closeButton visibility with show/hide. Maybe you should have a policy setter instead (showCloseButton = false; in screenShield)

@@ +2333,2 @@
             this._summaryBoxPointer.bin.child = this._summaryBoxPointerItem.notificationStackWidget;
+            this._summaryBoxPointerItem.closeButtonVisible = true;

I don't understand this. It should already be fine, right?
Comment 3 Giovanni Campagna 2012-08-25 19:44:21 UTC
(In reply to comment #2)
> Review of attachment 222427 [details] [review]:
> 
> The close button fixes seem unrelated.

No they're not: previous code assumed that all of the summary icon nSV was good to show, which is wrong after the introduction of the close button.

> ::: js/ui/messageTray.js
> @@ +1260,3 @@
> +
> +    set closeButtonVisible(v) {
> +        this._closeButton.visible = v;
> 
> The notification controls its own closeButton visibility with show/hide. Maybe
> you should have a policy setter instead (showCloseButton = false; in
> screenShield)

No, the notification does not interact with closeButtons. The message tray controls its own closeButton, but that's a different one. This is the one shown in summary mode.

> @@ +2333,2 @@
>              this._summaryBoxPointer.bin.child =
> this._summaryBoxPointerItem.notificationStackWidget;
> +            this._summaryBoxPointerItem.closeButtonVisible = true;
> 
> I don't understand this. It should already be fine, right?

Not after you go to the lock screen and back.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-08-25 19:59:26 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Review of attachment 222427 [details] [review] [details]:
> > 
> > The close button fixes seem unrelated.
> 
> No they're not: previous code assumed that all of the summary icon nSV was good
> to show, which is wrong after the introduction of the close button.

I'd still prefer this in a separate patch.

> > ::: js/ui/messageTray.js
> > @@ +1260,3 @@
> > +
> > +    set closeButtonVisible(v) {
> > +        this._closeButton.visible = v;
> > 
> > The notification controls its own closeButton visibility with show/hide. Maybe
> > you should have a policy setter instead (showCloseButton = false; in
> > screenShield)
> 
> No, the notification does not interact with closeButtons. The message tray
> controls its own closeButton, but that's a different one. This is the one shown
> in summary mode.

er, I was thinking "summary item" in my head, but wrote "notification"

> > @@ +2333,2 @@
> >              this._summaryBoxPointer.bin.child =
> > this._summaryBoxPointerItem.notificationStackWidget;
> > +            this._summaryBoxPointerItem.closeButtonVisible = true;
> > 
> > I don't understand this. It should already be fine, right?
> 
> Not after you go to the lock screen and back.

But this is for the summary box pointer? What's the steps to reproduce this?
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-08-25 19:59:45 UTC
Review of attachment 222427 [details] [review]:

::: js/ui/messageTray.js
@@ -1263,3 @@
         }
 
-        this.notificationStackWidget.width = this.notificationStackView.width;

I left this in on purpose. Why does this break?
Comment 6 Giovanni Campagna 2012-08-25 20:10:53 UTC
(In reply to comment #4)
> > 
> > No, the notification does not interact with closeButtons. The message tray
> > controls its own closeButton, but that's a different one. This is the one shown
> > in summary mode.
> 
> er, I was thinking "summary item" in my head, but wrote "notification"

Even so, the summary item does not control the visibility of the closeButton, it merely adds to nSW.

> > > @@ +2333,2 @@
> > >              this._summaryBoxPointer.bin.child =
> > > this._summaryBoxPointerItem.notificationStackWidget;
> > > +            this._summaryBoxPointerItem.closeButtonVisible = true;
> > > 
> > > I don't understand this. It should already be fine, right?
> > 
> > Not after you go to the lock screen and back.
> 
> But this is for the summary box pointer? What's the steps to reproduce this?

- Have a resident notification
- Go to the lock screen
  - Without the patch, it just crashes immediately
- Exit the lock screen
- Open the notification in summary mode
  - With the patch, without this line, the screenshield hides the close button, and nothing else shows it, so you don't have a close button there

(In reply to comment #5)
> Review of attachment 222427 [details] [review]:
> 
> ::: js/ui/messageTray.js
> @@ -1263,3 @@
>          }
> 
> -        this.notificationStackWidget.width = this.notificationStackView.width;
> 
> I left this in on purpose. Why does this break?

ScreenShield.NotificationsBox builds its contents before being added to the lockScreenContents actor (differently from MessageTray / SummaryItem), but accessing notificationStackView.width causes a get_preferred_width(), that in turn causes a get_theme_node() and crashes.
Comment 7 Giovanni Campagna 2012-09-03 21:13:18 UTC
Attachment 222427 [details] pushed as 47d46e3 - ScreenShield/MessageTray: fix crash after the introduction of close buttons