Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when moving cursor out of a Studio window into the screen border #795

Open
izmalk opened this issue Oct 23, 2023 · 1 comment
Open

Comments

@izmalk
Copy link
Contributor

izmalk commented Oct 23, 2023

Description

Studio crash.

Environment

  1. TypeDB version: 2.21.1
  2. OS of TypeDB server: macOS 13.4.1
  3. Studio version: 2.21.1
  4. OS of Studio: macOS 13.4.1
  5. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Open Studio (don't need any project directory or server connection)
  2. Have a second screen (monitor) connected to the machine. Side by side, the right one is slightly lower.
  3. Move Studio to the top right corner of the left screen.
  4. Move your mouse cursor fast horizontally to the right edge of the Studio (and screen), and make sure to pass the "Connect to TypeDB button".

Screenshot 2023-10-23 at 18 20 13

Expected Output

Nothing.

Actual Output

Title: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null
Trace: java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null
	at com.vaticle.typedb.studio.framework.common.Util.mousePoint-3ABfNKs(Util.kt:58)
	at com.vaticle.typedb.studio.framework.common.Util.isMouseHover-wH6b6FI(Util.kt:66)
	at com.vaticle.typedb.studio.framework.material.Form.BoxButton_pzZJ40c$mayShowOnTargetHover$55(Form.kt:764)
	at com.vaticle.typedb.studio.framework.material.Form.access$BoxButton_pzZJ40c$mayShowOnTargetHover$55(Form.kt:117)
	at com.vaticle.typedb.studio.framework.material.Form$BoxButton$1$4.invoke(Form.kt:775)
	at com.vaticle.typedb.studio.framework.material.Form$BoxButton$1$4.invoke(Form.kt:774)
	at androidx.compose.ui.input.pointer.PointerMoveFilter_desktopKt$pointerMoveFilter$5.invoke(PointerMoveFilter.desktop.kt:52)
	at androidx.compose.ui.input.pointer.PointerMoveFilter_desktopKt$pointerMoveFilter$5.invoke(PointerMoveFilter.desktop.kt:51)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter_skikoKt$onPointerEvent$1$1$1.invokeSuspend(SuspendingPointerInputFilter.skiko.kt:47)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
	at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:569)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:459)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:472)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:285)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:272)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:272)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:272)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:272)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:272)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:272)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:272)
	at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:152)
	at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:89)
	at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:97)
	at androidx.compose.ui.platform.SkiaBasedOwner.processPointerInput-gBdvCQM$ui(SkiaBasedOwner.skiko.kt:356)
	at androidx.compose.ui.platform.SkiaBasedOwner.processPointerInput-gBdvCQM$ui$default(SkiaBasedOwner.skiko.kt:349)
	at androidx.compose.ui.ComposeScene.processMove(ComposeScene.skiko.kt:551)
	at androidx.compose.ui.ComposeScene.processPointerInput(ComposeScene.skiko.kt:499)
	at androidx.compose.ui.ComposeScene.sendPointerEvent-BGSDPeU(ComposeScene.skiko.kt:482)
	at androidx.compose.ui.ComposeScene.sendPointerEvent-BGSDPeU$default(ComposeScene.skiko.kt:451)
	at androidx.compose.ui.awt.ComposeLayer_desktopKt.onMouseEvent(ComposeLayer.desktop.kt:470)
	at androidx.compose.ui.awt.ComposeLayer_desktopKt.access$onMouseEvent(ComposeLayer.desktop.kt:1)
	at androidx.compose.ui.awt.ComposeLayer$onMouseEvent$1.invoke(ComposeLayer.desktop.kt:398)
	at androidx.compose.ui.awt.ComposeLayer$onMouseEvent$1.invoke(ComposeLayer.desktop.kt:391)
	at androidx.compose.ui.awt.ComposeLayer.catchExceptions(ComposeLayer.desktop.kt:109)
	at androidx.compose.ui.awt.ComposeLayer.onMouseEvent(ComposeLayer.desktop.kt:391)
	at androidx.compose.ui.awt.ComposeLayer.access$onMouseEvent(ComposeLayer.desktop.kt:87)
	at androidx.compose.ui.awt.ComposeLayer$5.mouseMoved(ComposeLayer.desktop.kt:378)
	at java.desktop/java.awt.Component.processMouseMotionEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Additional information

It seems to me the button gets highlighted when moving the cursor above it, so probably, some logic invoked by moving the cursor from a button (and turning highlighting off) checks the cursor position. And if, at that moment, the cursor position is somewhere unusual (like the very edge of the screen that is extended by another screen, but misaligned, so that the cursor can't be pushed to another screen yet) it can crash. The issue is pretty reproducable

@alexjpwalker alexjpwalker changed the title Reproducible Studio crash when moving cursor out of a Studio window into the screen border Crash when moving cursor out of a Studio window into the screen border Oct 24, 2023
@alexjpwalker
Copy link
Member

Just encountered this same issue, same repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants