Commit 926a970c authored by Igor Demin's avatar Igor Demin

Fix white screen on Ubuntu with 200% scale

parent be05f641
...@@ -68,7 +68,17 @@ internal val platformOperations: PlatformOperations by lazy { ...@@ -68,7 +68,17 @@ internal val platformOperations: PlatformOperations by lazy {
} }
override fun getDpiScale(component: Component): Float { override fun getDpiScale(component: Component): Float {
return linuxGetDpiScaleNative(component) return component.graphicsConfiguration.defaultTransform.scaleX.toFloat()
// TODO doesn't work well because java doesn't scale windows (content has offset with 200% scale)
//
// Two solutions:
// 1. dynamically change sun.java2d.uiScale (it is global property, so we have to be careful) and update all windows
//
// 2. apply contentScale manually to all windows
// (it is not good, because on different platform windows will have different size.
// Maybe we will apply contentScale manually on all platforms?)
// return linuxGetDpiScaleNative(component)
} }
override fun createHardwareRedrawer(layer: HardwareLayer) = LinuxRedrawer(layer) override fun createHardwareRedrawer(layer: HardwareLayer) = LinuxRedrawer(layer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment