java setFullScreenWindow hides log in dialog in Mac
I was using a full screen window to something similar to screensaver. Us开发者_开发问答ing the method here,
GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice()
.setFullScreenWindow(this);
But when the screen is locked, or the screensaver runs, and this screen is shown, this screen is shown on top. I can't get access to the login prompt. So the java frame is on top and I can do nothing. I have to restart the computer to get rid of this.
Since when the login screen comes, no other window gets mouse/keyboard input. My window exit by pressing ESC or mouse movement events.
How can I get hold of the whole screen, but if the login dialog appears, it should be shown on top?
I am afraid that clear, pure java solution does not exist here. I'd suggest you to check whether the screen saver is running before opening this full screen window. So the question is how to detect whether screen saver is running? You are welcome to search yourself but my fast investigation showed that you need platform specific code.
The following link shows 2 solutions for windows: How to determine if a screensaver is running in Java?
Probably the second solution can help you in case of MAC. Check whether you can identify the process of screen saver. If you can just get list of running processes (by execution external command line) and verify that such process is running.
精彩评论