fix a bug with LÖVE 12 and DPI scaling

akkartik
Aug 19, 2025, 3:45 AM
547OUOVJYFHQBNXHTSNR4VQ7Y6J4MZZBTRDHXPRGBA6UOPJENOJAC

Dependencies

  • [2] JMUD7T3O get rid of ugly side-effects in tests
  • [3] AD34IX2Z couple more tests
  • [4] AVTNUQYR basic test-enabled framework
  • [5] JFFUF5AL override mouse state lookups in tests
  • [6] ZLJGZYQG select text with shift + mouseclick
  • [*] 3QNOKBFM beginnings of a test harness

Change contents

  • replacement in app.lua at line 466
    [3.7988][2.1191:1233]()
    App.screen.resize = love.window.setMode
    [3.7988]
    [2.1233]
    App.screen.resize = function(w, h, flags)
    -- Hack. On Linux with LÖVE 12, I've observed love.window.setMode go awry.
    -- Guidance from LÖVE folks (https://github.com/love2d/love/issues/2214)
    -- is that everything should be working with density-independent units
    -- most of the time, but on some platforms love.window.setMode doesn't do
    -- so. In that case, make sure to pass in values in raw pixel units to it.
    local w1 = love.window.getMode()
    local w2 = love.graphics.getDimensions()
    if w1 ~= w2 then
    w, h = love.window.toPixels(w, h)
    end
    love.window.setMode(w, h, flags)
    end