(KDE only) Fixed window close button disappearing after exiting from fullscreen mode

This commit is contained in:
IgorTimofeev 2022-09-20 16:56:12 +03:00
parent 6c0b108fa9
commit ccd200a2ca

View File

@ -89,17 +89,31 @@ object UiHandler extends Logging {
Display.setDisplayModeAndFullscreen(Display.getDesktopDisplayMode)
}
else {
// Updating size from settings
val settingsSize = Settings.get.windowSize
root.size = if (settingsSize.isSet) Size2D(settingsSize.x, settingsSize.y) else Size2D(800, 600)
// Setting normal display mode (non-fullscreen by default)
Display.setDisplayMode(new DisplayMode(root.size.width.toInt, root.size.height.toInt))
// Updating position from settings
if (Settings.get.windowPosition.isSet)
Display.setLocation(Settings.get.windowPosition.x, Settings.get.windowPosition.y)
}
Display.setFullscreen(value)
Display.setResizable(!value)
// Window should be resizable even in fullscreen mode, because some DEs can hide close button after exit from it.
// But it seems like there's lwjgl bug with internal resizable value caching
// How to reproduce:
// 1) Enter fullscreen mode via setDisplayModeAndFullscreen(...) or setFullScreen(true)
// 2) Set window resizable via setResizable(true)
// 3) Exit from fullscreen mode
// 4) Set window resizable again
// Result:
// Window is not resizable and can't be resized with mouse
// Expected behaviour:
// Window should be resizable
Display.setResizable(false)
Display.setResizable(true)
Settings.get.windowFullscreen = value
}