From b83d5975b0fb652494725ec15d8bf364f07bd320 Mon Sep 17 00:00:00 2001 From: Maxim Ermilov Date: Wed, 9 Jun 2010 17:41:09 +0400 Subject: [PATCH] [appDisplay] Fix crash when app well is empty When the app well doesn't contain any applications, it displays a placeholder text to indicate that it's a drop target. When porting WellGrid from St.Bin to St.BoxLayout, the call to set_child() to set the text was overlooked. https://bugzilla.gnome.org/show_bug.cgi?id=617281 --- js/ui/appDisplay.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 7ebd19437..16f3aa635 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1040,6 +1040,7 @@ function AppWell() { AppWell.prototype = { _init : function() { + this._placeholderText = null; this._menus = []; this._menuDisplays = []; @@ -1096,10 +1097,14 @@ AppWell.prototype = { let display = new AppWellIcon(app); this._grid.addItem(display.actor); } + if (this._placeholderText) { + this._placeholderText.destroy(); + this._placeholderText = null; + } if (running.length == 0 && nFavorites == 0) { - let text = new St.Label({ text: _("Drag here to add favorites")}); - this._grid.actor.set_child(text); + this._placeholderText = new St.Label({ text: _("Drag here to add favorites") }); + this.actor.add_actor(this._placeholderText); } },