adoptium / adoptium-support

For end-user problems reported with our binary distributions
Apache License 2.0
48 stars 13 forks source link

jpackage: Busy cursor remains after application has launched #593

Closed tunedal closed 1 year ago

tunedal commented 2 years ago

Please provide a brief summary of the bug

When an application is packaged for Windows with jpackage and then launched from the desktop icon or start menu (using the launcher created by jpackage) the mouse cursor continues showing a busy indicator for several seconds after the application has finished launching and displayed its main window.

It might be because Windows is waiting for the launched process to call GetMessage: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa

See also: https://stackoverflow.com/questions/7522685

Please provide steps to reproduce where possible

  1. Take any simple Swing application (that will launch relatively quickly).
  2. Package the application for Windows using jpackage with the "--win-shortcut" option.
  3. Install the packaged application.
  4. Launch the application from the desktop using the installed shortcut.

Expected Results

The mouse cursor should have stopped showing the busy indicator, i.e. should have turned into a normal mouse cursor, when the application window is displayed.

Actual Results

The mouse cursor continues showing the busy indicator for several seconds after the application has finished launching and is displaying its main window.

jpackage-cursor-bug

What Java Version are you using?

openjdk 17.0.4.1 2022-08-12 OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1) OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode, sharing)

What is your operating system and platform?

Microsoft Windows [Version 10.0.19044.2006]

How did you install Java?

The MSI installer from adoptium.net: OpenJDK17U-jdk_x64_windows_hotspot_17.0.4.1_1.msi

Did it work before?

It works when the JAR file is launched using javaw.exe.

Did you test with other Java versions?

The problem also occurs with Azul's JDK: zulu17.36.17-ca-jdk17.0.4.1-win_x64.msi

Relevant log output

No response

karianna commented 2 years ago

@tunedal - Do you have a small simple program that demonstrates this?

tunedal commented 2 years ago

The attached zip file contains an example program (HelloSwing.java) along with a WSH script (build.js) which packages and installs the example program. After running the script with cscript build.js there will be two desktop shortcuts:

issue-593-example.zip

karianna commented 2 years ago

Thank you - reported upstream at: https://bugs.openjdk.org/browse/JDK-8294706

tunedal commented 2 years ago

Oops, I seem to have caused a duplicate in the OpenJDK bug tracker. I initially reported the issue to Oracle, before I knew about the Temurin bug reporting process, so JDK-8294699 is a duplicate of the same issue. Sorry about that.

github-actions[bot] commented 1 year ago

We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable. It will be closed soon unless the stale label is removed by a committer, or a new comment is made.

karianna commented 1 year ago

closing as reported upstream