#2355·love

[LÖVE 12] love.mouse.getPosition() does not update when changing window size

Author: EnneaCreated Aug 23, 2026Updated Aug 23, 2026
Labelslibrary dependency
  • LÖVE version: 12 (commit 042d4a1e1c4d8b154c780e6ee1294d572a710242, latest as of creation of this ticket)
  • OS: Linux

Calling love.mouse.getPosition() after resizing the window via love.window.setMode() in such a way that the mouse is still in bounds of the window (and also was before changing the size) returns stale data that is only updated once the mouse is moved again. Here's a minimal reproduction of the issue:

lua
function love.load()
    love.window.setMode(800, 600)
end

function love.update()
    print(love.mouse.getPosition())
end

function love.keypressed(key)
    love.window.updateMode(love.math.random(600, 1000), 600, { centered = true })
end

function love.draw()
    love.graphics.clear({ 0, 0.1, 0.05, 1 })
end

Move the mouse into the window and press any key. The position printed by love.mouse.getPosition() will not update.