I'm writing a libGDX application, using the Lwjgl3Launcher. Everything works nicely, there's just one problem:
I'm trying to create a borderless fullscreen window like this:
fun main(args: Array<String>) {
val displayMode = Lwjgl3ApplicationConfiguration.getDisplayMode()
Lwjgl3Application(Orbitrucker("assets/native", displayMode), Lwjgl3ApplicationConfiguration().apply {
setTitle("Orbitrucker")
// TODO: There's mouse cursor offset when a borderless window has screen size!
setWindowedMode(1920, 1080)
setResizable(false)
setDecorated(false)
setAutoIconify(true)
})
}
Where the screen resolution is actually 1920x1080, everything looks fine. I.e. I get my application on the entire screen, with nothing else there (taskbar not visible). However, the mouse behaves as though the taskbar was still visible, and the window was sitting on top of it. I.e. all the mouse Y coordinates are offset by the height of the Taskbar.
Surprisingly, I'm not really finding any information about this issue when googling, though I can't possibly be the first running into this. Maybe the solution is so simple it's not worth mentioning, but I haven't found it yet.
If the resolution is smaller than the entire screen, the mouse position is fine. If I don't set decorated to false, the position is fine (but then the taskbar is visible, so that's not what I want). With decorated set to false it all looks just like I want it, but apparently for the purpose of the mouse the taskbar is still there...