When resizing a Love window in Windows, the "new" area that is exposed is rendered black until the resize operation is complete.
Is there a flag that allows this to be updated during the resize, or is this a limitation of the underlying graphics library?
Black area while resizing window
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Black area while resizing window
Check love.resize function. You will need to provide whatever calculations for making your draw/screen area larger here.

Re: Black area while resizing window
Hi, dusoft.
Thanks for the response, but I think I didn't describe the issue well.
Once the resize operation is done and the mouse button is released, I have no problems dealing with it. As you mentioned, love.resize passes that information on the program, and I can perform any adjustments I need so love.paint works with the new window size.
The "problem" is that while the drag operation is going on during the window resizing, there's no love.resize messages being sent, and there's no love.draw operation happening. That only happens on the mouse release of the resize operation. So any areas that are exposed during the drag are painted black.
If I do something like:
It won't print any events while it's resizing, so that verifies that it only triggers once the window is resized.
Similarly, if I try:
The draw event stops triggering during the resize event.
It's as if the underlying toolkit stops processing messages during the Windows resize event.
Google claims that LOVE2D uses the ANGLE library to handle graphics. But other programs that use ANGLE (for example, Godot) don't see to have this limitation. So I assume that it's not a limitation of the graphics library.
I redefined love.run as:
And it looks like run doesn't trigger during the window drag, either. So there doesn't seem to be any obvious way to force Love2D to trigger an event during a resize.
Is there some way to make Love2D repaint while a resize drag is happening?
Thanks for the response, but I think I didn't describe the issue well.
Once the resize operation is done and the mouse button is released, I have no problems dealing with it. As you mentioned, love.resize passes that information on the program, and I can perform any adjustments I need so love.paint works with the new window size.
The "problem" is that while the drag operation is going on during the window resizing, there's no love.resize messages being sent, and there's no love.draw operation happening. That only happens on the mouse release of the resize operation. So any areas that are exposed during the drag are painted black.
If I do something like:
Code: Select all
function love.resize()
print("resizing")
io.flush()
end
Similarly, if I try:
Code: Select all
local count = 1
function love.draw()
-- set window background color
love.graphics.clear(GREY)
love.graphics.setColor(GREY)
love.graphics.rectangle("fill", 1, 1, 1000, 1000)
print("draw", count)
count = count + 1
io.flush()
end
It's as if the underlying toolkit stops processing messages during the Windows resize event.
Google claims that LOVE2D uses the ANGLE library to handle graphics. But other programs that use ANGLE (for example, Godot) don't see to have this limitation. So I assume that it's not a limitation of the graphics library.
I redefined love.run as:
Code: Select all
local c = 1
function love.run()
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
-- We don't want the first frame's dt to include time taken by love.load.
if love.timer then love.timer.step() end
local dt = 0
-- Main loop time.
return function()
c = c + 1
print("run", c)
io.flush()
...
Is there some way to make Love2D repaint while a resize drag is happening?
Re: Black area while resizing window
Ah, not sure about this, maybe somebody else can chip in... But just to run you through some ideas:
Does love.update run during resizing?
I see this:
You can try play with both present() and vsync value, if that changes anything.
Does love.update run during resizing?
I see this:
mentioned here: https://love2d.org/wiki/love.graphics.presentIf love.window.setMode has vsync equal to true, this function can't run more frequently than the refresh rate (e.g. 60 Hz), and will halt the program until ready if necessary.
You can try play with both present() and vsync value, if that changes anything.

Re: Black area while resizing window
Thanks!
After the last post, I looked all the flag options.
Turning sync on or off makes no difference.
I suspect it was a design decision from a long time ago, but it's the one feature that really bugs me, because no other library behaves like that.
You don't resize often for games, but for desktop apps - I know, not the target market - it looks terrible.
After the last post, I looked all the flag options.
Turning sync on or off makes no difference.
I suspect it was a design decision from a long time ago, but it's the one feature that really bugs me, because no other library behaves like that.
You don't resize often for games, but for desktop apps - I know, not the target market - it looks terrible.
- BrotSagtMist
- Party member
- Posts: 680
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Black area while resizing window
This is a you problem.
Works on all my test boxes, so whatever you see there, this is specific to your system and not löve.
Works on all my test boxes, so whatever you see there, this is specific to your system and not löve.
obey
Re: Black area while resizing window
No.Does love.update run during resizing?
As far as I can tell, no callback is executing during a resize.
I figured that maybe something wasn't callinglove.run[/i] during that time, so I rewrote love.run so it went into a loop instead of returning a function in hopes to stop that:
Code: Select all
-- Main loop time.
return function()
-- Process events.
Code: Select all
local dt = 0
-- Main loop time.
while true do
-- Process events.

This seems to confirm that it looks like it's an issue with SD_PumpEvent:.
There's a work-around, but it requires more knowledge about SDL than I've got, which at the moment is about zero.If you are using a single thread, setting up an event watcher using SDL_AddEventWatch is not enough. This is because SDL_PumpEvents (which is called directly or indirectly by sdl) will not return until resizing is done, effectively blocking your thread.
Hrm... in the source code in wrap_Window.cpp, it looks like message boxes and file dialogs are exposed. But I don't know how to get to them from Love2D. They would sure be nice to have, instead of having to write a cross-platform file dialog myself in LFS.

Re: Black area while resizing window
It's not specific to my machine - I've run this on multiple Windows machines for years, and have always seen this behavior.BrotSagtMist wrote: ↑Fri Jan 31, 2025 8:44 pm This is a you problem.
Works on all my test boxes, so whatever you see there, this is specific to your system and not löve.
Here's a minimal program:
Code: Select all
function love.load()
love.window.setMode( 100, 100, {resizable=true, borderless=false})
end
function love.draw()
love.graphics.clear({0,1,0})
end

Re: Black area while resizing window
I think Brot is a Linux man.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
pen and paper gridiron. Build a team then watch simulated matches: https://togfox.itch.io/pad-and-pencil-gridiron
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
pen and paper gridiron. Build a team then watch simulated matches: https://togfox.itch.io/pad-and-pencil-gridiron
Re: Black area while resizing window
I've logged this into the LOVE GitHub.
Who is online
Users browsing this forum: No registered users and 2 guests