I have a Java application that displays two JFrames on two separate monitors. On Ubuntu and Windows the application displays just fine. I can configure the JFrames to display on the monitors with the specified screen ID. However on openSUSE it keeps displaying on the same monitor regardless of the setting. What is different to openSUSE?

Here is some of the code that I use to determine on which monitor the JFrame must display:


    GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
    for (int s = 0; s < screens.length; s++) {
        GraphicsConfiguration configuration = null;
        for (int c = 0; c < screens[s].getConfigurations().length; c++) {
            if (AWTUtilities.isTranslucencyCapable(screens[s].getConfigurations()[c])) {
                configuration = screens[s].getConfigurations()[c];
                break;
            }
        }
        if (configuration == null) {
            configuration = screens[s].getDefaultConfiguration();
        }
        if (screens[s].getIDstring().equals[frame1_id]) {
            frame1 = new JFrame("Frame 1", configuration);
            frame1.setResizable(false);
            frame1.setUndecorated(true);
            frame1.setBounds(configuration.getBounds());
            frame1.setVisible(true);
        }
        if (screens[s].getIDstring().equals[frame2_id]) {
            frame2 = new JFrame("Frame 2", configuration);
            frame2.setResizable(false);
            frame2.setUndecorated(true);
            frame2.setBounds(configuration.getBounds());
            frame2.setVisible(true);
        }
    }
有帮助吗?

解决方案

The OpenSuse implementation of GraphicsEnvironment may depend on the choice of a particular window manager. You'll have to experiment to find the optimal one.

Addendum: @bouncer comments, "I have used the Gnome window manager, which caused the problem. After switching to KDE, the problem was solved." See also 10 things to do after installing openSUSE 12.3.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top