Bug 1164302 - pocket button gets lost after a restart, r=jaws a=dolske
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 13 May 2015 22:18:00 +0100
changeset 260491 d5ba1bc97911
parent 260490 9a7a198e1b06
child 260492 06499c7a81a9
push id799
push userjdolske@mozilla.com
push date2015-05-14 03:46 +0000
treeherdermozilla-release@11c4678a21bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, dolske
bugs1164302
milestone38.0.1
Bug 1164302 - pocket button gets lost after a restart, r=jaws a=dolske
browser/components/customizableui/CustomizableUI.jsm
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -375,34 +375,37 @@ let CustomizableUIInternal = {
       // Try introducing after widgets that come before it in the default placements:
       for (let i = defaultWidgetIndex; i >= 0; i--) {
         // Special case: if the defaults list this widget as coming first, insert at the beginning:
         if (i === 0 && i === defaultWidgetIndex) {
           savedPlacements.splice(0, 0, widget.id);
           // Before you ask, yes, deleting things inside a let x of y loop where y is a Set is
           // safe, and we won't skip any items.
           futurePlacedWidgets.delete(widget.id);
+          gDirty = true;
           break;
         }
         // Otherwise, if we're somewhere other than the beginning, check if the previous
         // widget is in the saved placements.
         if (i) {
           let previousWidget = defaultPlacements[i - 1];
           let previousWidgetIndex = savedPlacements.indexOf(previousWidget);
           if (previousWidgetIndex != -1) {
             savedPlacements.splice(previousWidgetIndex + 1, 0, widget.id);
             futurePlacedWidgets.delete(widget.id);
+            gDirty = true;
             break;
           }
         }
       }
       // The loop above either inserts the item or doesn't - either way, we can get away
       // with doing nothing else now; if the item remains in gFuturePlacements, we'll
       // add it at the end in restoreStateForArea.
     }
+    this.saveState();
   },
 
   wrapWidget: function(aWidgetId) {
     if (gGroupWrapperCache.has(aWidgetId)) {
       return gGroupWrapperCache.get(aWidgetId);
     }
 
     let provider = this.getWidgetProvider(aWidgetId);