boolean () { ApplicationEx app = ApplicationManagerEx.getApplicationEx(); if (app != null) { app.flushNativeEventQueue(); } AWTEvent event = Toolkit.getDefaultToolkit().getSystemEventQueue().peekEvent(); return event != null && event.getClass().getName().equals("sun.awt.PeerEvent"); }