简体   繁体   中英

AWT Frame in full-screen exclusive mode gets minimized on windows dialog popup

i am developing an application which uses an awt frame in full-screen exclusive mode. Everythings works fine until a windows popup gets visible. This will steal the focus and my application will be minimized.

Here is my init code of the frame:

if (ApplicationConfig.getInstance().useFullscreenMode()) {
    frame.setUndecorated(true);
    frame.setResizable(false);

    if (monitor.isFullScreenSupported()) {
        monitor.setFullScreenWindow(frame);
        if (monitor.isDisplayChangeSupported()) {
            DisplayMode defaultMode = new DisplayMode(
                    (int) appDimension.getWidth(),
                    (int) appDimension.getHeight(),
                    32,
                    DisplayMode.REFRESH_RATE_UNKNOWN);

            monitor.setDisplayMode(defaultMode);
            frame.setFulscreenDisplayMode(defaultMode);

            DisplayMode selectedMode = monitor.getDisplayMode();
            log.debug("Setting fullscreen display mode to " + selectedMode.getWidth() + "x" + selectedMode.getHeight() +
                    " color depth: " + selectedMode.getBitDepth() + " refresh rate: " + selectedMode.getRefreshRate());
        } else {
            log.error("Change display mode not supported");
        }
    } else {
        log.error("Full screen not supported");
    }
}

Is there a workaround or setting to avoid this?

the window manager usually doesn't enforce application window modality and for custom display mode application the wm is forced to either to drop you out of fullscreen or minimize as it cannot respect the dpi setting for the other window maintaining your own window resolution.

thee is a reason for that, explained here in the context of the Window OS

is this for some sort of kiosk system? then make your whole application the shell, as explained here: Keeping a Windows application on top of other windows and in focus - always

task manager will still pop in front of it, and alt tabbing should work as usual.

similar step for making a single app login in linux: http://www.instructables.com/id/Setting-Up-Ubuntu-as-a-Kiosk-Web-Appliance/?ALLSTEPS

to disable usb fixing, see the answer to this question: https://superuser.com/questions/33986/is-it-possible-to-disable-the-scan-and-fix-message-when-inserting-an-sd-card

note that the first answer entail fixing the disk, if you scroll below there are the step to disable that specific dialog.

Setting the awt frame modality type fixed my problem. As Lorenzo mentioned, using APPLICATION_EXCLUDE let the frame always be on top. Thank you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM