mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
fix crash when changing theme in linux (#348)
This commit is contained in:
parent
ef869a2851
commit
b8ce924ad8
@ -39,6 +39,8 @@ import ir.amirab.util.customwindow.HitSpots
|
||||
import ir.amirab.util.customwindow.util.CustomWindowDecorationAccessing
|
||||
import ir.amirab.util.customwindow.windowFrameItem
|
||||
import ir.amirab.util.ifThen
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
|
||||
// a window frame which totally rendered with compose
|
||||
@ -318,12 +320,14 @@ fun CustomWindow(
|
||||
val isLight = myColors.isLight
|
||||
val background = myColors.background
|
||||
LaunchedEffect(background) {
|
||||
withContext(Dispatchers.Main) {
|
||||
//I set window background fix window edge flickering on window resize
|
||||
window.background = background.takeOrElse {
|
||||
if (isLight) Color.White
|
||||
else Color.Black
|
||||
}.toWindowColorType()
|
||||
}
|
||||
}
|
||||
UiScaledContent {
|
||||
CompositionLocalProvider(
|
||||
LocalWindowController provides windowController,
|
||||
|
Loading…
x
Reference in New Issue
Block a user