merged
authorwenzelm
Fri, 10 Jan 2014 12:30:05 +0100
changeset 54966 2a010ef82fd7
parent 54961 e60428f432bc (current diff)
parent 54965 a8af7a9c38d1 (diff)
child 54967 78de75e3e52a
child 54981 a128df2f670e
merged
--- a/README_REPOSITORY	Fri Jan 10 11:47:10 2014 +0100
+++ b/README_REPOSITORY	Fri Jan 10 12:30:05 2014 +0100
@@ -1,13 +1,13 @@
 Important notes on Mercurial repository access for Isabelle
 ===========================================================
 
-Quick start in 25min
+Quick start in 30min
 --------------------
 
 1a. Linux and Mac OS X: ensure that Perl (with libwww) and Mercurial (hg)
     is installed (see also http://www.selenic.com/mercurial)
 
-1b. Windows: ensure that Cygwin with Mercurial and Perl is installed (see
+1b. Windows: ensure that Cygwin with Perl and Mercurial is installed (see
     also http://www.cygwin.com)
 
 2. Clone repository (bash shell commands):
--- a/src/Pure/GUI/gui.scala	Fri Jan 10 11:47:10 2014 +0100
+++ b/src/Pure/GUI/gui.scala	Fri Jan 10 12:30:05 2014 +0100
@@ -8,6 +8,7 @@
 package isabelle
 
 
+import java.lang.{ClassLoader, ClassNotFoundException, NoSuchMethodException}
 import java.awt.{Image, Component, Container, Toolkit, Window, Font}
 import java.awt.font.{TextAttribute, TransformAttribute, FontRenderContext, LineMetrics}
 import java.awt.geom.AffineTransform
@@ -38,6 +39,28 @@
     UIManager.getSystemLookAndFeelClassName() == UIManager.getLookAndFeel.getClass.getName
 
 
+  /* X11 window manager */
+
+  def window_manager(): Option[String] =
+  {
+    if (Platform.is_windows || Platform.is_macos) None
+    else
+      try {
+        val XWM = Class.forName("sun.awt.X11.XWM", true, ClassLoader.getSystemClassLoader)
+        val getWM = XWM.getDeclaredMethod("getWM")
+        getWM.setAccessible(true)
+        getWM.invoke(null) match {
+          case null => None
+          case wm => Some(wm.toString)
+        }
+      }
+      catch {
+        case _: ClassNotFoundException => None
+        case _: NoSuchMethodException => None
+      }
+  }
+
+
   /* simple dialogs */
 
   def scrollable_text(txt: String, width: Int = 60, height: Int = 20, editable: Boolean = false)