[gnome-shell] [appDisplay] Fix crash when app well is empty



commit b83d5975b0fb652494725ec15d8bf364f07bd320
Author: Maxim Ermilov <zaspire rambler ru>
Date:   Wed Jun 9 17:41:09 2010 +0400

    [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 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 7ebd194..16f3aa6 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);
         }
     },
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]