JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.92k stars 1.16k forks source link

Window content flickering (randomly getting black when mouse moves) #553

Open mpointner opened 3 years ago

mpointner commented 3 years ago

I just tried out the demo applications for Jetpack compose and on like every second start the window content flickers when moving with the mouse around:

lJ4K1DHaBj

Sometimes it also stays completely black at certain cursor positions.

System:

Windows 10 x64 Intellij Ultimate 2020.3.3 build 203.7717.56 OpenJDK 64-Bit Server VM Corretto-11.0.8.10.1 SDK Android 8.0 Intel(R) HD Graficis 4600 (Monitor connected to this graphics card) NVIDIA GeForce RTX 2060

Output:

11:30:30: Executing task 'run'...

Executing tasks: [run] in project C:\Users\Michael\Documents\Projects\compose-jb-master\examples\codeviewer\desktop

> Configure project :common
Kotlin Multiplatform Projects are an Alpha feature. See: https://kotlinlang.org/docs/reference/evolution/components-stability.html. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.

> Task :common:compileKotlinDesktop UP-TO-DATE
> Task :common:desktopProcessResources UP-TO-DATE
> Task :common:desktopMainClasses UP-TO-DATE
> Task :common:desktopJar UP-TO-DATE
> Task :desktop:compileKotlinJvm UP-TO-DATE
> Task :desktop:jvmProcessResources UP-TO-DATE
> Task :desktop:jvmMainClasses UP-TO-DATE
> Task :desktop:jvmJar UP-TO-DATE

> Task :desktop:run
The os does not support: 'Taskbar.setIconImage'

Whenever the flickering happens, the application also crashes when I try to resize the window:

> Task :desktop:run
The os does not support: 'Taskbar.setIconImage'
Failed Direct3D call. Error: 0x887a0001
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_UNCAUGHT_CXX_EXCEPTION (0xe06d7363) at pc=0x00007ff9f60ed759, pid=2756, tid=18528
#
# JRE version: OpenJDK Runtime Environment Corretto-11.0.8.10.1 (11.0.8+10) (build 11.0.8+10-LTS)
# Java VM: OpenJDK 64-Bit Server VM Corretto-11.0.8.10.1 (11.0.8+10-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [KERNELBASE.dll+0x2d759]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Michael\Documents\Projects\compose-jb-master\examples\codeviewer\desktop\hs_err_pid2756.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

> Task :desktop:run FAILED

Execution failed for task ':desktop:run'.
> Process 'command 'C:\Program Files\Amazon Corretto\jdk11.0.8_10\bin\java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

VM crash dump:

hs_err_pid25920.log

With SKIKO_RENDER_API=OPENGL as environment variable it works just fine.

olonho commented 3 years ago

Maybe new Angle-based renderer may help here. Decided, that it's not exactly the path we want to follow.

olonho commented 3 years ago

Please attach VM crashdump, or at least stacktrace from it.

mpointner commented 3 years ago

Added the stacktrace, how do I get the VM crash dump?

olonho commented 3 years ago

From file like C:\Users\Michael\Documents\Projects\compose-jb-master\examples\codeviewer\desktop\hs_err_pid2756.log. Actually the stacktrace I asked for is native one from the crashdump. Also what is exact videocard model? And what if you'll use OpenGL renderer (set SKIKO_RENDER_API=OPENGL)?

mpointner commented 3 years ago

Updated the description with the crashdump. With SKIKO_RENDER_API=OPENGL as environment variable it works just fine, tried like ten times without flickering/crashing when resizing.

mpointner commented 3 years ago

@olonho did you find something out from the crashdump that could fix it for the default renderer?

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.