Page 1 of 1
Switching to windowed mode, have to click twice?
Posted: Sun Feb 06, 2022 8:29 am
by randomnovice
Hi folks,
A pesky little annoyance I'd like to fix.
When I switch out from fullscreen to a window, I find that I have to click once to 'wake' the window before love.mousepressed registers anything (which it does with the second click). I've checked love.mousefocus and it doesn't seem to be negative as well as love.window.hasFocus and I've tried love.window.requestAttention.
I'm running OS X if that's relevant.
It's not a massive thing -- but is there a way to get around it?
Re: Switching to windowed mode, have to click twice?
Posted: Mon Feb 07, 2022 6:30 pm
by milon
I don't have that problem on my (Linux) system. But there's WAY too many variables to help diagnose the issue without seeing some code. Can you post your .love or a mini .lua that reproduces the issue?
Re: Switching to windowed mode, have to click twice?
Posted: Mon Feb 07, 2022 9:49 pm
by randomnovice
It's not much to look at yet but I've attached the .love file.
To reproduce:
-Click "Open Editor"
-Try clicking "New" (nothing happens)
-Click again without moving the mouse... it works!
Re: Switching to windowed mode, have to click twice?
Posted: Mon Feb 07, 2022 11:33 pm
by dusoft
randomnovice wrote: ↑Mon Feb 07, 2022 9:49 pm
It's not much to look at yet but I've attached the .love file.
To reproduce:
-Click "Open Editor"
-Try clicking "New" (nothing happens)
-Click again without moving the mouse... it works!
Works for me on Linux. First click brings up a popup.
Re: Switching to windowed mode, have to click twice?
Posted: Tue Feb 08, 2022 6:18 am
by BrotSagtMist
Usually this is a matter of the window manager and your settings, nothing that löve can control, if its not sending a click there is nothing to react on.
However, ive added a print in your love.run section:
Code: Select all
visibletrue nil nil nil nil nil
mousefocus true nil nil nil nil nil
focus true nil nil nil nil nil
mousepressed 922 326 1 false 1 nil
visibletrue nil nil nil nil nil
mousefocus true nil nil nil nil nil
focus true nil nil nil nil nil
focus false nil nil nil nil nil
focus true nil nil nil nil nil
resize 1920 1053 nil nil nil nil
mousereleased 922 326 1 false 1 nil
mousepressed 114 12 1 false 1 nil
mousereleased 114 12 1 false 1 nil
The focus flickers and the order of events seems to be odd.
In anycase i think you can just go around this by simply not using fullscreen but a frameless full screen sized window instead.
Re: Switching to windowed mode, have to click twice?
Posted: Tue Feb 08, 2022 6:34 am
by randomnovice
Usually this is a matter of the window manager and your settings, nothing that löve can control
Thanks for confirming. That's what I guessed but I wasn't sure.
you can just go around this by simply not using fullscreen but a frameless full screen sized window instead.
True. It was a preference thing, not a major deal.