Fix bug 657755 - [PATCH] Missing close button for Event dialog under Gnome3. r=philipp
authorAlexandre Demers <alexandre.f.demers@gmail.com>
Thu, 01 Dec 2011 21:41:00 +0100
changeset 10387 f7d035d679629152bbc7ecc5e74fbc9951019b2c
parent 10386 899c2df75f2d77cd8918a278a72366b039afcb25
child 10388 71326b6d853187d8d6792d2f33ae397476926ede
push id402
push userbugzilla@standard8.plus.com
push dateTue, 13 Mar 2012 21:17:18 +0000
treeherdercomm-beta@d080a8ebf16a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs657755
Fix bug 657755 - [PATCH] Missing close button for Event dialog under Gnome3. r=philipp
calendar/base/content/calendar-item-editing.js
--- a/calendar/base/content/calendar-item-editing.js
+++ b/calendar/base/content/calendar-item-editing.js
@@ -34,16 +34,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
 Components.utils.import("resource://calendar/modules/calUtils.jsm");
+Components.utils.import("resource://gre/modules/Services.jsm");
 
 /**
  * Takes a job and makes sure the dispose function on it is called. If there is
  * no dispose function or the job is null, ignore it.
  *
  * @param job       The job to dispose.
  */
 function disposeJob(job) {
@@ -358,17 +359,27 @@ function openEventDialog(calendarItem, c
     if (isCalendarWritable(calendar)
         && (mode == "new"
             || (mode == "modify" && !isInvitation && userCanModifyItem((calendarItem))))) {
         url = "chrome://calendar/content/calendar-event-dialog.xul";
     } else {
         url = "chrome://calendar/content/calendar-summary-dialog.xul";
     }
 
-    openDialog(url, "_blank", "chrome,titlebar,resizable", args);
+    var features;
+    if (Services.appinfo.OS == "WINNT") {
+        features = "chrome,titlebar,resizable,dependent";
+    } else if (Services.appinfo.OS == "Darwin") {
+        features = "chrome,titlebar,resizable,minimizable=no";
+    } else {
+        // All other targets, mostly Linux flavors using gnome.
+        features = "chrome,titlebar,resizable,dependent,minimizable=no,dialog=no";
+    }
+
+    openDialog(url, "_blank", features, args);
 }
 
 /**
  * Prompts the user how the passed item should be modified. If the item is an
  * exception or already a parent item, the item is returned without prompting.
  * If "all occurrences" is specified, the parent item is returned. If "this
  * occurrence only" is specified, then aItem is returned. If "this and following
  * occurrences" is selected, aItem's parentItem is modified so that the