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

Desktop window not capturable after upgrade from Compose 1.5 to 1.6 #4931

Closed
Stuie opened this issue Jun 6, 2024 · 4 comments
Closed

Desktop window not capturable after upgrade from Compose 1.5 to 1.6 #4931

Stuie opened this issue Jun 6, 2024 · 4 comments
Labels
bug Something isn't working desktop

Comments

@Stuie
Copy link

Stuie commented Jun 6, 2024

Describe the bug

A desktop app with a Window that is undecorated, transparent, and not focusable was capturable in OBS (software for streaming on services like Twitch or YouTube) using at least Compose 1.3.1, 1.4.x, and 1.5.x up to 1.5.12.

The same application with Compose upgraded to 1.6.x (starting with 1.6.0 for sure) is not capturable in OBS any more.

Affected platforms

  • Desktop - Only tested on Windows

Versions

  • Libraries:
[versions]
kotlin = "1.9.22"
compose = "1.6.0"

[plugins]

kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose" }

[libraries]

androidx-annotations = { group = "androidx.annotation", name = "annotation", version = "1.7.1" }
  • Kotlin version: 1.9.22
  • OS version(s) (required for Desktop and iOS issues): Windows 11
  • OS architecture (x86 or arm64): x86
  • Device (model or simulator for iOS issues):
  • JDK (for desktop issues): 19 (Amazon Corretto)

To Reproduce
Steps to reproduce the behavior:

  1. Create a window in your application that is undecorated, transparent, and not focusable
  2. Add that window to a scene in OBS
  3. With 1.5.12 the window will show up, from 1.6.0 it will not show up

I have created a minimal project that reproduces the issue, along with screenshots. The only relevant change between the two branches on the repo is the Compose version in libs.versions.toml.

Expected behavior
I would expect a window that was capturable by OBS with Compose 1.5.12 would continue to be capturable when upgrading to Compose 1.6.0.

Screenshots
Here's how OBS looks for 1.5.12:
OBS-Compose-1 5 12

Here's the same window in OBS for 1.6.0:
OBS-Compose-1 6 0

Additional context
No additional context, please see the linked repo for a repro case.

@Stuie Stuie added bug Something isn't working submitted labels Jun 6, 2024
@terrakok terrakok added desktop and removed submitted labels Jun 6, 2024
@terrakok
Copy link
Member

terrakok commented Jun 6, 2024

Could you try to call System.setProperty("skiko.renderApi", "OPENGL") before the app window creation.

@Stuie
Copy link
Author

Stuie commented Jun 6, 2024

@terrakok Thanks for that. I pulled the UI stuff out to a post-main function, set the property before calling it, and it seems to do the trick.

Was there documentation that I missed? The closest relevant thing I see in the release notes for 1.6.0 is this PR to do with transparency on desktop. It doesn't mention the property you mentioned above.

@Stuie Stuie closed this as completed Jun 6, 2024
@MatkovIvan
Copy link
Member

This property isn't new and you're right about that change - it fixes transparent window support on D3D (previously it failed on init and used OpenGL as fallback).
So you can use OpenGL if it works better in your case, hovewer I'd recommend to set this property only for WIndows.

@okushnikov
Copy link
Collaborator

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

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working desktop
Projects
None yet
Development

No branches or pull requests

5 participants