aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/javafx/newt/Window.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2009-01-05 21:45:45 +0000
committerKenneth Russel <[email protected]>2009-01-05 21:45:45 +0000
commit8d38222fc13c1e3f42ee0c0afb193e517749e94e (patch)
tree14f09bdf37173b6063622c5c44f1f5162795fd8c /src/classes/com/sun/javafx/newt/Window.java
parent5234bcafd962ac17c56162473acd72e0804911fa (diff)
Native (non-AWT) port of Newt to Mac OS X using Cocoa. Most
functionality (mouse click, mouse motion, mouse dragging, keyboard events) appears to be working. Currently works with the Apple JRE and requires the JVM command-line arguments -XstartOnFirstThread and -Djava.awt.headless=true . Will work with the standalone SoyLatte JRE pending additional launcher changes. Tested with Angeles demo and various JavaFX demos. Added -Dnewt.ws.name=AWT option to force the use of the AWT port of Newt on any supported platform. Known bugs: - While resizing a window or dropping down a menu, the application will hang. This is due to how the event processing is currently done in Newt (via Window.dispatchMessages()) and how Mac OS X deals with resize operations (by pushing a nested event loop into which we have no visibility). There are at least a couple of solutions. One would be to preserve the current API semantics but use a Newt Launcher class to move main() on to a different thread, saving the primordial thread for [NSApplication run]. Another would be to move Newt (and, by association, the JavaFX runtime code) to a callback model like GLUT. - Command-Q and the Quit menu option do not yet properly exit the application. - The coordinates for the WINDOW_MOVED event are wrong. Added the rest of the VK_ constants to the KeyEvent class. Made preliminary changes to support the SoyLatte JRE. Worked around initialization order issues with Fmod. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1838 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/javafx/newt/Window.java')
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/Window.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/classes/com/sun/javafx/newt/Window.java b/src/classes/com/sun/javafx/newt/Window.java
index ab0588e8e..710c88bbe 100755
--- a/src/classes/com/sun/javafx/newt/Window.java
+++ b/src/classes/com/sun/javafx/newt/Window.java
@@ -47,6 +47,20 @@ public abstract class Window implements NativeWindow
public static final boolean DEBUG_WINDOW_EVENT = false;
public static final boolean DEBUG_IMPLEMENTATION = false;
+ // Workaround for initialization order problems on Mac OS X
+ // between native Newt and (apparently) Fmod -- if Fmod is
+ // initialized first then the connection to the window server
+ // breaks, leading to errors from deep within the AppKit
+ static void init(String type) {
+ if (NewtFactory.MACOSX.equals(type)) {
+ try {
+ getWindowClass(type);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
private static Class getWindowClass(String type)
throws ClassNotFoundException
{
@@ -175,7 +189,7 @@ public abstract class Window implements NativeWindow
protected int width, height, x, y;
protected int eventMask;
- protected String title = "AWT NewtWindow";
+ protected String title = "Newt Window";
protected boolean undecorated = false;
public String getTitle() {