haze icon indicating copy to clipboard operation
haze copied to clipboard

Haze effect does not work properly on desktop when navigating between pages

Open Oveys-Dust opened this issue 11 months ago • 4 comments

Information

  • Haze version: 1.3.0
  • Platform: Windows
  • Platform version: Windows 10, 11

Expected Behavior

I have made a localHazeState to pass throu all my classes because there is only a background is using . so every element above of it when use the hazeEffect must blur behind of itself which is background.

Actual Behavior

the odd thing that happens is that if u move the app window to a new position and change the page by navigator or sth else, components that has hazeEffect on their modifier does not properly update their behind image.

Steps to Reproduce the Problem

Please include reproducible code where possible

  1. move application window to new position
  2. change the page by navigator or sth similar

this is the haze provider : val LocalHazeState = compositionLocalOf<HazeState> { error("HazeState not provided!") }

@Composable fun ProvideHazeState( hazeState: HazeState, content: @Composable () -> Unit ) { CompositionLocalProvider(LocalHazeState provides hazeState) { content() } }

Oveys-Dust avatar Feb 08 '25 12:02 Oveys-Dust

The code sample you provided is mostly useless, and you haven't provided a screen recording or screenshot showing the issue.

There's not enough information here.

chrisbanes avatar Feb 08 '25 12:02 chrisbanes

https://drive.google.com/file/d/1lR-ONef4HMY-oIcpa3UnaZdvSEbLAB/view?usp=sharing here, in this file I fully added my code and a video that how it produces in app

Oveys-Dust avatar Feb 08 '25 12:02 Oveys-Dust

Thanks for the video.

I've got a speculative workaround in the PR above. I think this is more of a bug in CMP on Desktop. I think positionOnScreen updates happen quite slowly which is causing issues.

chrisbanes avatar Feb 09 '25 19:02 chrisbanes

Hello sir, Thanks for your consideration. latest version (1.3.1) has been solved the moving window issue but one bug remained which also is in the video I uploaded. the video does not show my mouse but as u notice at the right box, the blur color does not update unless the mouse goes over it.

Oveys-Dust avatar Feb 11 '25 08:02 Oveys-Dust