Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateMode/setMode behaviour differs from 11.5 #2114

Open
Endaris opened this issue Oct 22, 2024 · 2 comments
Open

updateMode/setMode behaviour differs from 11.5 #2114

Endaris opened this issue Oct 22, 2024 · 2 comments
Labels
bug Something isn't working library dependency Related to a library used by LÖVE
Milestone

Comments

@Endaris
Copy link

Endaris commented Oct 22, 2024

The window position updates in some odd and not quite predictable ways in love 12 using SDL3.
The expected outcome for the following repro is that the window stays centered at all times and modifies its position.
I am able to verify this with the 11.5 release as well as the output of a 12.0 CI run before the SDL3 adoption.

On my machine, using the CI build from 2 days ago, the first updateMode does not change the window position.
The second updateMode changes the window position but the new position is not centered on the display.

Repro main.lua:

local resize1 = false
local resize2 = false

function love.load()
  love.window.setMode(800, 600, { resizable = true, centered = true})
end

function love.update()
  if not resize1 and love.timer.getTime() > 4 then
    love.window.updateMode(640, 480)
    resize1 = true
  elseif not resize2 and love.timer.getTime() > 7 then
    love.window.updateMode(300, 480)
    resize2 = true
  end
end

function love.draw()
  love.graphics.print("resize1: " .. tostring(resize1), 10, 10)
  love.graphics.print("resize2: " .. tostring(resize2), 10, 30)
end

My machine uses debian 12
love.graphics.getRendererInfo output:
OpenGL;4.3.0 NVIDIA 535.183.01;NVIDIA Corporation;NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2

@Endaris Endaris changed the title Window resize behaviour differs from 11.5 updateMode/setMode behaviour differs from 11.5 Oct 22, 2024
@slime73 slime73 added the bug Something isn't working label Oct 22, 2024
@slime73 slime73 added this to the 12.0 milestone Oct 22, 2024
@slime73
Copy link
Member

slime73 commented Oct 26, 2024

I haven't been able to reproduce the issue, but I don't have a Linux machine to test on. Can you see if d099da1 fixed it for you?

@slime73 slime73 added the library dependency Related to a library used by LÖVE label Oct 26, 2024
@MadByteDE
Copy link

MadByteDE commented Oct 29, 2024

Fedora 41, Wayland, KDE 6.2
OpenGL 4.3.0 NVIDIA 560.35.03 NVIDIA Corporation NVIDIA GeForce RTX 4070/PCIe/SSE2

I can confirm that on my Linux machine, the provided code does indeed have different results in resizing between love11 and love12. used the latest action appImage build for love12 with the position fix.

Screencast_20241029_125837.webm

love11 stays centred while love12 does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working library dependency Related to a library used by LÖVE
Projects
None yet
Development

No branches or pull requests

3 participants