Fake fullscreen mode on JME3 wo Swing

Hello. I can not set the fake fullscreen mode…
If change settings.setFullscreen(true) - it is real fullscreen, ok.
But I need just increase the JME’s size to monitor dimension, It’s easy, right? ahah

private void doMaximize(AppSettings settings, DisplayMode vMode) {
        log.info("Do pseudo maximize window fullscreen...");
        settings.setWindowSize(vMode.getWidth(), vMode.getHeight() + 30);
        settings.setResolution(vMode.getWidth(), vMode.getHeight() + 30);
        settings.setWindowYPosition(30);
        settings.setFullscreen(false);
    }

It NOT WORKS !!!
Does anyone know how to do this? The JME window still has a border with buttons (they are hidden at the top of the monitor), and at the bottom I see a space with my desktop wallpaper -_-"


Well, I found the way:

private void doMaximize(AppSettings settings, DisplayMode vMode) {
        log.info("Do pseudo maximize window fullscreen...");
        settings.setFullscreen(true);
        settings.setWindowSize(vMode.getWidth() + 1, vMode.getHeight() + 1);
    }

the bottom line disappeared, the monitor resolution does not switch. Done for now.

It looks like you need an undecorated window. If you’re using LWJGL 3, try adding the following code snippet before resizing your window:

        long handle = ((LwjglWindow) app.getContext()).getWindowHandle();
        GLFW.glfwSetWindowAttrib(handle, GLFW.GLFW_DECORATED, 0);

Note that app is a reference to your application.

2 Likes