public DisplayMode init() throws LWJGLException { lockAWT(); try { Compiz.init(); delete_atom = internAtom("WM_DELETE_WINDOW", false); current_displaymode_extension = getBestDisplayModeExtension(); if (current_displaymode_extension == NONE) throw new LWJGLException("No display mode extension is available"); DisplayMode[] modes = getAvailableDisplayModes(); if (modes == null || modes.length == 0) throw new LWJGLException("No modes available"); switch (current_displaymode_extension) { case XRANDR: savedXrandrConfig = AccessController.doPrivileged(new PrivilegedAction<Screen[]>() { public Screen[] run() { return XRandR.getConfiguration(); } }); saved_mode = getCurrentXRandrMode(); break; case XF86VIDMODE: saved_mode = modes[0]; break; default: throw new LWJGLException("Unknown display mode extension: " + current_displaymode_extension); } current_mode = saved_mode; saved_gamma = getCurrentGammaRamp(); current_gamma = saved_gamma; return saved_mode; } finally { unlockAWT(); } }