Browse Source

b=527260, r=Matt, Patch to add restore minimized window functionality to JS-API

matthew.gertner@gmail.com 15 years ago
parent
commit
dde0226dd8
2 changed files with 11 additions and 0 deletions
  1. 5 0
      components/public/nsIPlatformGlue.idl
  2. 6 0
      components/src/nsPlatformGlue.js

+ 5 - 0
components/public/nsIPlatformGlue.idl

@@ -167,6 +167,11 @@ interface nsIPlatformGlue : nsISupports
    * Use the appropriate platform-specific mechanism to indicate that the window requires attention.
    */
   void getAttention();
+
+  /**
+   * Restore minimized window
+   */
+  void restoreWindow();
   
   /**
    * Display the preferences dialog.

+ 6 - 0
components/src/nsPlatformGlue.js

@@ -407,6 +407,12 @@ PlatformGlue.prototype = {
     this._chromeWindow.getAttention();
   },
   
+  restoreWindow : function restoreWindow() {
+    var evt = this._window.document.createEvent("Events");
+    evt.initEvent("DOMActivate", true, false);
+    this._chromeWindow.dispatchEvent(evt);
+  },
+
   showPreferences : function showPreferences(paneToShow)
   {
     this._chromeWindow.openDialog("chrome://webrunner/content/preferences/preferences.xul", "preferences", "chrome,titlebar,toolbar,centerscreen,dialog", paneToShow);