Skip to content

Commit

Permalink
Merge pull request #49 from JetBrains/disable-dpi-on-linux
Browse files Browse the repository at this point in the history
Fix white screen on Ubuntu with 200% scale
  • Loading branch information
igordmn authored Jan 21, 2021
2 parents 3cdc1ed + 926a970 commit 0103686
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ internal val platformOperations: PlatformOperations by lazy {
}

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)
Expand Down

0 comments on commit 0103686

Please sign in to comment.