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

Layout flickers when resizing the window (regression) #4744

Closed
mahozad opened this issue May 1, 2024 · 7 comments
Closed

Layout flickers when resizing the window (regression) #4744

mahozad opened this issue May 1, 2024 · 7 comments
Assignees
Labels
bug Something isn't working desktop directx duplicate This issue or pull request already exists rendering Low level rendering reproduced skiko windows

Comments

@mahozad
Copy link
Contributor

mahozad commented May 1, 2024

Describe the bug
When changing window width on desktop, the content of the window repeatedly shrinks or expands while the resizing is in progress.

This problem did not exist in compose multiplatform 1.5.10.

Affected platforms

  • Desktop (Windows, Linux, macOS)

Versions

  • Kotlin version*: 1.9.23
  • Compose Multiplatform version*: 1.6.2
  • OS version(s)* (required for Desktop and iOS issues): Windows 11
  • OS architecture (x86 or arm64): x86
  • JDK (for desktop issues): 21

To Reproduce
Run the below app and resize the window with mouse.

fun main() = application {
    Window(onCloseRequest = ::exitApplication) {
        Box(Modifier.width(400.dp).height(50.dp).background(Color.Red))
    }
}

Additional context
This also happens even when window is not resizable. when programmatically changing window size, the content breaks for a moment:

video.mp4
@mahozad mahozad added bug Something isn't working submitted labels May 1, 2024
@elijah-semyonov elijah-semyonov self-assigned this May 2, 2024
@elijah-semyonov
Copy link
Contributor

Can't reproduce it on macOS.
@mahozad was macOS wrongly added to the affected platforms list, or you indeed have this behavior on macOS machine?

@elijah-semyonov
Copy link
Contributor

@MatkovIvan I don't think I touched windows related rendering since 1.5.10. Can you bisect the regression point on a Windows machine?

@babramovitch
Copy link

babramovitch commented May 10, 2024

I'm also having problems with window resizing on windows. I'm not sure if this is the same problem, but it might be? If it's different I can make another issue.

The hardcoded 200 width moves around as I resize the window, on windows, and then snaps back to 200 when I stop moving it. On a Mac, the 200 width remains in place as the rest of the window expands and shrinks.

This is on 1.6.2

Window(
    onCloseRequest = ::exitApplication,
    state = WindowState(width = 800.dp, height = 1000.dp),
) {
    Box(modifier = Modifier.fillMaxSize().background(Color.Red)) {
        Box(modifier = Modifier.width(200.dp).fillMaxHeight().background(Color.Blue))
    }
}

Please forgive this horrible video quality...

windowsresizing.mov

@mahozad
Copy link
Contributor Author

mahozad commented May 10, 2024

I should say that CMP 1.6.0 also did not have this problem.

@mahozad
Copy link
Contributor Author

mahozad commented May 10, 2024

Can't reproduce it on macOS...

@elijah-semyonov

Sorry. I only tested Windows. The macOS and Linux were remnants of issue template.

@MatkovIvan
Copy link
Member

MatkovIvan commented May 14, 2024

Reproduced in minimal skiko app without Compose. Happens only for DirectX. OpenGL for Windows works fine better (shows black bars instead of stretching sometimes)

@MatkovIvan
Copy link
Member

MatkovIvan commented May 14, 2024

Explanation here - #4521 (comment)

Closing as duplicate of #4521 #2925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop directx duplicate This issue or pull request already exists rendering Low level rendering reproduced skiko windows
Projects
None yet
Development

No branches or pull requests

5 participants