jMonkeyEngine / jMonkeyEngine/jmonkeyengine

Force-Ungrab Mouse in Error Dialog

Open
#941 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.3k
Forks
1.2k
Avg merge
4d 7h
Merged PRs (30d)
14

Description

This is probably only/mostly affecting Linux (Here Kubuntu) because of how it handles mouse ungrabbing (you are unable to see a cursor unless you kill the process):
When an exception occurs, SimpleApplication has an ExceptionHandler which spawns an AWT dialog with a partial error message and an OK Button.
Since the mouse is not ungrabbed though, you have to tab until you reach the Button and then press return or space.
So it would be wise to add a call to inputManager.setCursorEnabled(false); in the Exception Handler for these cases (and maybe while we're at it adding a stacktrace output to this dialog)

We just have to find out if there are other uses of https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java#L119 were it would be bad to disattach the cursor automatically

Edit: Maybe we could/should also put this code here instead: https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/app/LegacyApplication.java#L615

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ExceptionHandler in SimpleApplication and inspect the referenced locations in jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java around line 119 and jme3-core/src/main/java/com/jme3/app/LegacyApplication.java around line 615. Compare their cursor-handling behavior and determine where the error dialog should release the mouse. Done means the dialog can be operated normally when an exception occurs without breaking other cursor uses.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.