1

I'm using a JOGL FPSAnimator and Apple's FullScreenUtilies class. I implemented this some time ago, and it worked fine. Here is my code for enabling the native OS X fullscreen capability, similar to other code on SO and around the web:

 String className = "com.apple.eawt.FullScreenUtilities";
 String methodName = "setWindowCanFullScreen";
 try {
      Class<?> clazz = Class.forName(className);
      Method method = clazz.getMethod(methodName,
           new Class<?>[] { Window.class, boolean.class });
      method.invoke(null, frame, true);
 } catch ...

It also works fine in the context of a simple test program I made in an attempt to isolate the issue. I'm not sure at what point the behaviour changed - I haven't spotted anything incriminating in SVN logs. It's likely that I first implemented the feature on an earlier version of OS X, and have also upgraded JOGL version and MyDoggy which we use for docking since. However, all of these things work with fullscreen in the context of other applications.

When I press the green fullscreen button, the usual OSX fullscreen transition starts (it gets its own desktop space), but the window appears frozen from that point on.

The main AWT Event thread carries on running, and I can see that my GLEventListener.display() method is being regularly called. I've tried adding a return to the beginning of that method to eliminate the impact of my rendering code, this unsurprisingly made no difference.

For testing purposes, I added a FullScreenListener:

 FullScreenUtilities.addFullScreenListenerTo(frame, new FullScreenAdapter() {
      @Override
      public void windowEnteringFullScreen(FullScreenEvent arg0) {
           log(">>> Entering fullscreen... <<<");
      }
      @Override
      public void windowEnteredFullScreen(FullScreenEvent arg0) {
           log(">>> Entered fullscreen. <<<");
      }
 });

As anticipated, I get the entering fullscreen event, but not the entered one.

It's a fairly large program, but there should be a fairly small surface of things that are potentially relevant here... unfortunately I haven't managed to trace them down. Happy if anyone has any pointers.

PeterT
  • 1,454
  • 1
  • 12
  • 22
  • A complete example is shown [here](http://stackoverflow.com/a/30308671/230513). – trashgod Feb 20 '16 at 16:09
  • Like I say, my application uses similar code to what can be found in various examples on SO and elsewhere on the web... the code in my question is very similar to the `enableOSXFullscreen(Window)` method from that example, which worked at first, and works in a trivial test app, but not now in my real app unfortunately. – PeterT Feb 20 '16 at 17:35
  • 1
    but thanks @trashgod, I suppose it gives more full context to have a complete example. – PeterT Feb 20 '16 at 17:36
  • Java 8, MacOS 10.11.3, seems to work okay for me – MadProgrammer Feb 20 '16 at 21:17
  • Like I say, the basic method works, but "something" in my application goes wrong when invoked in that context meaning that it doesn't complete the transition. Perhaps SO isn't the right place to ask, since I can't provide enough info for someone to answer, but I'm hoping someone will have some idea of the sorts of things that could cause a lock here... must be related to Swing / AWT threading... – PeterT Feb 20 '16 at 22:25

0 Answers0