XToolkit.java revision 5336
1696N/A private static final PlatformLogger eventLog = PlatformLogger.getLogger("sun.awt.X11.event.XToolkit");
1696N/A private static final PlatformLogger timeoutTaskLog = PlatformLogger.getLogger("sun.awt.X11.timeoutTask.XToolkit");
1696N/A private static final PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XToolkit");
1696N/A private static final PlatformLogger backingStoreLog = PlatformLogger.getLogger("sun.awt.X11.backingStore.XToolkit");
0N/A static final boolean PRIMARY_LOOP = false;
0N/A static final boolean SECONDARY_LOOP = true;
0N/A protected static boolean dynamicLayoutSetting = false;
870N/A private static boolean areExtraMouseButtonsEnabled = true;
0N/A private boolean loadedXSettings;
0N/A static int arrowCursor;
0N/A static int awt_multiclick_time;
0N/A static boolean securityWarningEnabled;
0N/A m_removeSourceEvents = SunToolkit.getMethod(EventQueue.class, "removeSourceEvents", new Class[] {Object.class, Boolean.TYPE}) ;
1216N/A noisyAwtHandler = AccessController.doPrivileged(new GetBooleanAction("sun.awt.noisyerrorhandler"));
3876N/A static native long getTrayIconDisplayTimeout();
1216N/A private static long saved_error_handler;
1216N/A private static boolean noisyAwtHandler;
1216N/A public static void RESTORE_XERROR_HANDLER() {
1216N/A if (noisyAwtHandler) {
0N/A static boolean isToolkitThread() {
0N/A static void initSecurityWarning() {
0N/A static boolean isSecurityWarningEnabled() {
0N/A return securityWarningEnabled;
0N/A static native void awt_output_flush();
0N/A static final void awtFUnlock() {
0N/A return uidefaults;
0N/A static void initUIDefaults() {
0N/A e.printStackTrace();
0N/A public static long getDisplay() {
0N/A public static long getDefaultRootWindow() {
870N/A areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
0N/A return awtAppClassName;
0N/A synchronized(winToDispatcher) {
0N/A synchronized(winToDispatcher) {
0N/A public interface XEventListener {
216N/A (ev.get_type() == XConstants.MotionNotify || ev.get_type() == XConstants.EnterNotify || ev.get_type() == XConstants.LeaveNotify))
0N/A synchronized(winToDispatcher) {
0N/A static native void awt_toolkit_init();
0N/A eventNumber++;
1696N/A if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
1696N/A if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
0N/A static int getDefaultScreenWidth() {
0N/A return screenWidth;
0N/A static int getDefaultScreenHeight() {
0N/A return screenHeight;
0N/A protected int getScreenWidth() {
0N/A return getDefaultScreenWidth();
0N/A protected int getScreenHeight() {
0N/A return getDefaultScreenHeight();
0N/A if (workareaPresent)
0N/A private Insets getScreenInsetsManually(long root, Rectangle rootBounds, Rectangle screenBounds)
0N/A boolean strutPresent = XA_NET_WM_STRUT_PARTIAL.getAtomData(window, XAtom.XA_CARDINAL, native_ptr, 4);
0N/A if (!strutPresent)
0N/A if (strutPresent)
0N/A public void setDynamicLayout(boolean b) {
0N/A dynamicLayoutSetting = b;
0N/A protected boolean isDynamicLayoutSet() {
0N/A return dynamicLayoutSetting;
0N/A protected boolean isDynamicLayoutSupported() {
0N/A public boolean isDynamicLayoutActive() {
0N/A return isDynamicLayoutSupported();
0N/A public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
0N/A public <T extends DragGestureRecognizer> T
0N/A int srcActions,
0N/A XCanvasPeer peer = (isXEmbedServerRequested() ? new XEmbedCanvasPeer(target) : new XCanvasPeer(target));
2520N/A public synchronized static boolean getSunAwtDisableGtkFileDialogs() {
0N/A throws IndexOutOfBoundsException {
0N/A public boolean isTraySupported() {
0N/A public int getMaximumCursorColors() {
0N/A public int getScreenResolution() {
0N/A static native long getDefaultXColormap();
0N/A static native long getDefaultScreenData();
0N/A return screenmodel;
0N/A return getStaticColorModel();
0N/A return new XInputMethodDescriptor();
0N/A static int getMultiClickTime() {
0N/A return awt_multiclick_time;
0N/A static void initializeMultiClickTime() {
0N/A String multiclick_time_query = XlibWrapper.XGetDefault(XToolkit.getDisplay(), "*", "multiClickTime");
0N/A throws HeadlessException
0N/A private static boolean initialized;
0N/A private static boolean timeStampUpdated;
0N/A new XEventDispatcher() {
0N/A timeStampUpdated = true;
0N/A static long getCurrentServerTime() {
0N/A if (!initialized) {
0N/A initialized = true;
0N/A timeStampUpdated = false;
0N/A if (isToolkitThread()) {
0N/A while (!timeStampUpdated) {
0N/A awtLockWait();
1696N/A if (log.isLoggable(PlatformLogger.FINE)) log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")");
0N/A protected void initializeDesktopProperties() {
1981N/A private native int getNumberOfButtonsImpl();
1224N/A public int getNumberOfButtons(){
2773N/A numberOfButtons = (numberOfButtons > MAX_BUTTONS_SUPPORTED)? MAX_BUTTONS_SUPPORTED : numberOfButtons;
2773N/A return numberOfButtons;
0N/A if (!loadedXSettings &&
0N/A loadedXSettings = true;
0N/A /* set the fontconfig/KDE property so that
0N/A private void loadXSettings() {
0N/A // Net/DndDragThreshold -> ???
0N/A // Net/DoubleClickTime -> awt.multiClickInterval
0N/A static int numLockMask;
0N/A static int modeSwitchMask;
0N/A static int modLockIsShiftLock;
0N/A static void setupModifierMap() {
216N/A final int modmask[] = { XConstants.ShiftMask, XConstants.LockMask, XConstants.ControlMask, XConstants.Mod1Mask,
0N/A static native void wakeup_poll();
0N/A wakeup_poll();
0N/A private long getNextTaskTime() {
0N/A private static void callTimeoutTasks() {
0N/A static long getAwtDefaultFg() {
0N/A return awt_defaultFg;
0N/A int numButtons = ((Integer)getDefaultToolkit().getDesktopProperty("awt.mouse.numButtons")).intValue();
0N/A static long reset_time_utc;
0N/A protected boolean needsXEmbedImpl() {
0N/A catch (IllegalAccessException e)
0N/A e.printStackTrace();
0N/A catch (InvocationTargetException e) {
0N/A e.printStackTrace();
0N/A public boolean isAlwaysOnTopSupported() {
0N/A public boolean useBufferPerWindow() {
0N/A static int getBackingStoreType() {
0N/A return backingStoreType;
0N/A private static void setBackingStoreType() {
0N/A private static int backingStoreType;
0N/A static boolean awt_UseXKB = false;
1067N/A static boolean awt_UseXKB_Calls = false;
1342N/A static boolean isXsunKPBehavior() {
1975N/A static void resetKeyboardSniffer() {
1975N/A static boolean isSunKeyboard() {
1975N/A static boolean isKanaKeyboard() {
0N/A static boolean isXKBenabled() {
1067N/A return awt_UseXKB;
1067N/A awt_UseXKB = XlibWrapper.XQueryExtension( getDisplay(), name, XlibWrapper.larg1, XlibWrapper.larg2, XlibWrapper.larg3);
1067N/A if( awt_UseXKB ) {
1067N/A if( awt_UseXKB_Calls ) {
1067N/A awt_UseXKB_Calls = XlibWrapper.XkbQueryExtension( getDisplay(), XlibWrapper.larg1, XlibWrapper.larg2,
1067N/A if( awt_UseXKB_Calls ) {
0N/A return awt_UseXKB;
1067N/A static boolean canUseXKBCalls() {
1067N/A return awt_UseXKB_Calls;
1067N/A static int getXKBEffectiveGroup() {
1067N/A return awt_XKBEffectiveGroup;
1067N/A static int getXKBBaseEventCode() {
1067N/A return awt_XKBBaseEventCode;
1067N/A static long getXKBKbdDesc() {
1067N/A return awt_XKBDescPtr;
0N/A private static long eventNumber;
0N/A public static long getEventNumber() {
0N/A return eventNumber;
0N/A private static boolean oops_updated;
0N/A private static boolean oops_failed;
0N/A oops_updated = true;
0N/A oops_failed = true;
0N/A oops_updated = false;
0N/A oops_failed = false;
1696N/A eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom()));
0N/A } catch (InterruptedException e) {
0N/A throw new RuntimeException(e);
0N/A public boolean isDesktopSupported(){
0N/A return new XDesktopPeer();
870N/A return areExtraMouseButtonsEnabled;
1045N/A public boolean isWindowOpacitySupported() {
1045N/A public boolean isWindowShapingSupported() {
1045N/A public boolean isWindowTranslucencySupported() {
1065N/A public static boolean getSunAwtDisableGrab() {