mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-7484 Update the cursor on mouse entered/exited
AppKit resets the cursor on native mouse entered/exited events. Depending on the order of events, it may end up setting the wrong cursor. So update it forcibly on such events.
(cherry picked from commit 2de56405aa)
This commit is contained in:
@@ -67,6 +67,11 @@ final class CCursorManager extends LWCursorManager {
|
||||
return;
|
||||
}
|
||||
currentCursor = cursor;
|
||||
setCurrentCursor();
|
||||
}
|
||||
|
||||
void setCurrentCursor() {
|
||||
Cursor cursor = currentCursor;
|
||||
|
||||
if (cursor == null) {
|
||||
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
|
||||
|
||||
@@ -117,6 +117,11 @@ final class CPlatformResponder {
|
||||
|
||||
boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers, jeventType);
|
||||
|
||||
if (jeventType == MouseEvent.MOUSE_ENTERED || jeventType == MouseEvent.MOUSE_EXITED) {
|
||||
// JBR-7484: AppKit resets the cursor we set previously on entered/exit events, so we re-set it.
|
||||
CCursorManager.getInstance().setCurrentCursor();
|
||||
}
|
||||
|
||||
eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber,
|
||||
x, y, absX, absY, jmodifiers, jclickCount,
|
||||
jpopupTrigger, null);
|
||||
|
||||
Reference in New Issue
Block a user