mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-69397 On MacOS X, hide mouse cursor when typing
This commit is contained in:
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
#include <jni.h>
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_intellij_util_ui_MacUIUtil_doHideCursor
|
||||
(JNIEnv *env, jclass clazz) {
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_intellij_util_ui_MacUIUtil_doShowCursor
|
||||
(JNIEnv *env, jclass clazz) {
|
||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
gcc -arch i386 -arch x86_64 -mmacosx-version-min=10.5 -framework ApplicationServices -I/System/Library/Frameworks/JavaVM.framework/Headers/ cursorHider.c -shared -fPIC -o cursorHider.jnilib
|
||||
-3
@@ -26,7 +26,6 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.wm.impl.IdeGlassPaneImpl;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.ui.MacUIUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -130,8 +129,6 @@ public final class IdeMouseEventDispatcher {
|
||||
resetPopupTrigger(e);
|
||||
}
|
||||
|
||||
MacUIUtil.showCursor();
|
||||
|
||||
if (!(e.getID() == MouseEvent.MOUSE_PRESSED ||
|
||||
e.getID() == MouseEvent.MOUSE_RELEASED ||
|
||||
e.getID() == MOUSE_CLICKED)) {
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package com.intellij.util.ui;
|
||||
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.mac.foundation.Foundation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -27,7 +27,6 @@ import javax.swing.plaf.TreeUI;
|
||||
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||
import java.awt.*;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
@@ -39,33 +38,13 @@ public class MacUIUtil {
|
||||
public static final String MAC_FILL_BORDER = "MAC_FILL_BORDER";
|
||||
public static final int MAC_COMBO_BORDER_V_OFFSET = SystemInfo.isMacOSLion ? 1 : 0;
|
||||
private static Cursor INVERTED_TEXT_CURSOR;
|
||||
private static boolean CURSOR_HIDER_LOADED = false;
|
||||
|
||||
static {
|
||||
if (SystemInfo.isMac) {
|
||||
try {
|
||||
System.load(PathManager.getBinPath() + File.separatorChar + "cursorHider.jnilib");
|
||||
CURSOR_HIDER_LOADED = true;
|
||||
} catch (UnsatisfiedLinkError ignored) {}
|
||||
}
|
||||
}
|
||||
|
||||
private MacUIUtil() {
|
||||
}
|
||||
|
||||
public static void hideCursor() {
|
||||
if (CURSOR_HIDER_LOADED) {
|
||||
doHideCursor();
|
||||
}
|
||||
Foundation.invoke("NSCursor", "setHiddenUntilMouseMoves:", true);
|
||||
}
|
||||
private static native void doHideCursor();
|
||||
|
||||
public static void showCursor() {
|
||||
if (CURSOR_HIDER_LOADED) {
|
||||
doShowCursor();
|
||||
}
|
||||
}
|
||||
private static native void doShowCursor();
|
||||
|
||||
public static class EditorTextFieldBorder implements Border {
|
||||
private JComponent myEnabledComponent;
|
||||
|
||||
Reference in New Issue
Block a user