Doesn't that mean that there's no way to tell if window dimensions have actually changed without constantly polling for them, by extension making love.resize completely pointless since it doesn't detect window resize? This gotta be a bug.zorg wrote: Worth noting that the love.resize callback won't be called if maximize succeeds
Getting the usable screen dimension
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Getting the usable screen dimension
Last edited by raidho36 on Sun Oct 09, 2016 6:54 am, edited 1 time in total.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Getting the usable screen dimension
I'm (or was at least) pretty sure that [wiki]love.window.maximize[/wiki] calls [wiki]love.resize[/wiki] if it succeeds. Since it resizes the window to it's maximized state, it is basically pressing the "maximize" button programmatically, which does trigger love.resize.
What doesn't call love.resize is a successful [wiki]love.window.setMode[/wiki] which is entirely different from love.window.maximize
What doesn't call love.resize is a successful [wiki]love.window.setMode[/wiki] which is entirely different from love.window.maximize
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: Getting the usable screen dimension
I see that event doesn't trigger if programmatical resize succeeds since you already would know proper dimensions, but I really think that it should trigger anyway - to execute code related to window resizing.
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Getting the usable screen dimension
Okay, my bad, though imo the wiki wording could be a bit more straightforward.Positive07 wrote:I'm (or was at least) pretty sure that [wiki]love.window.maximize[/wiki] calls [wiki]love.resize[/wiki] if it succeeds. Since it resizes the window to it's maximized state, it is basically pressing the "maximize" button programmatically, which does trigger love.resize.
What doesn't call love.resize is a successful [wiki]love.window.setMode[/wiki] which is entirely different from love.window.maximize
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Getting the usable screen dimension
Well it says
Anyway I didn't understand what VectorNormal meant with
So yeah I don't think that includes love.window.maximize whichLÖVE Wiki wrote: Calls to love.window.setMode will only trigger this event if the width or height of the window after the call doesn't match the requested width and height...
I don't think the wording is wrong or somethingLÖVE Wiki wrote: ...it essentially programmatically presses the window's "maximize" button.
Anyway I didn't understand what VectorNormal meant with
VectorNormal wrote: when in windowed mode if you maximize the screen, the reported size of the window does not change. This is because resizing and maximizing are completely separate concepts
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: Getting the usable screen dimension
I think that VectorNormal's complaint is that love.graphics.getDimensions() doesn't return the new size immediately after calling love.window.maximize. However, note that it does in love.resize:
This prints in my case:
(with an appropriate conf.lua that includes setting c.window.resizable = true)
Edit: Posted to the issue tracker as requested below: https://bitbucket.org/rude/love/issues/ ... rt-changed
Code: Select all
function love.load()
print("Before:", love.graphics.getDimensions())
love.window.maximize()
print("After:", love.graphics.getDimensions())
end
function love.resize(w, h)
print("love.resize:", w, h, love.graphics.getDimensions())
end
Code: Select all
Before: 800 600
After: 800 600
love.resize: 1278 992 1278 992
Edit: Posted to the issue tracker as requested below: https://bitbucket.org/rude/love/issues/ ... rt-changed
Last edited by pgimeno on Sun Oct 09, 2016 10:51 pm, edited 1 time in total.
- slime
- Solid Snayke
- Posts: 3172
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Getting the usable screen dimension
Can you make a post on the issue tracker about that? So I don't forget.pgimeno wrote:I think that VectorNormal's complaint is that love.graphics.getDimensions() doesn't return the new size immediately after calling love.window.maximize.
-
- Prole
- Posts: 8
- Joined: Sun Oct 02, 2016 5:58 am
Re: Getting the usable screen dimension
Thank you very much Pgimeno! There was a point where I was certain I'd tried this and love.resize() never got called. Maybe I've been working too hard. I'll have to fiddle around a little bit more to see if I can figure out the other order of events that fail to trigger it. But you got it and it's working in my display/window managers (light DM and LXDM) wooo!
Lots of really great info in this thread, thanks everyone!
Lots of really great info in this thread, thanks everyone!
Re: Getting the usable screen dimension
Looks like in the next version that problem won't happen https://bitbucket.org/rude/love/issues/ ... rt-changed
Thanks, slime.
Thanks, slime.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest