src/windows/classes/sun/awt/windows/WGlobalCursorManager.java

Print this page

        

*** 25,34 **** --- 25,38 ---- package sun.awt.windows; import java.awt.*; import sun.awt.GlobalCursorManager; + import sun.awt.LightweightFrame; + import sun.swing.JLightweightFrame; + import sun.swing.LightweightContent; + import sun.swing.SwingAccessor; public final class WGlobalCursorManager extends GlobalCursorManager { private static WGlobalCursorManager manager; public static GlobalCursorManager getCursorManager() {
*** 44,54 **** */ public static void nativeUpdateCursor(Component heavy) { WGlobalCursorManager.getCursorManager().updateCursorLater(heavy); } ! protected native void setCursor(Component comp, Cursor cursor, boolean u); protected native void getCursorPos(Point p); protected native Component findComponentAt(Container con, int x, int y); /* * two native methods to call corresponding methods in Container and * Component --- 48,71 ---- */ public static void nativeUpdateCursor(Component heavy) { WGlobalCursorManager.getCursorManager().updateCursorLater(heavy); } ! protected void setCursor(final Component comp, final Cursor cursor, final boolean u) { ! JLightweightFrame lwFrameUnderCursor = WLightweightFramePeer.getFrameUnderCursor(); ! if (lwFrameUnderCursor != null) { ! LightweightContent lwContent = SwingAccessor ! .getJLightweightFrameAccessor() ! .getLightweightContent(lwFrameUnderCursor); ! lwContent.invokeOnClientToolkitThread(() -> setCursorDirect(comp, cursor, u)); ! } else { ! setCursorImpl(comp, cursor, u); ! } ! } ! ! protected native void setCursorImpl(Component comp, Cursor cursor, boolean u); ! protected native void setCursorDirect(Component component, Cursor cursor, boolean u); protected native void getCursorPos(Point p); protected native Component findComponentAt(Container con, int x, int y); /* * two native methods to call corresponding methods in Container and * Component