Switching to windowed mode, have to click twice?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
randomnovice
Party member
Posts: 126
Joined: Sat May 09, 2015 9:15 pm

Switching to windowed mode, have to click twice?

Post 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?
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: Switching to windowed mode, have to click twice?

Post 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?
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
randomnovice
Party member
Posts: 126
Joined: Sat May 09, 2015 9:15 pm

Re: Switching to windowed mode, have to click twice?

Post 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!
Attachments
RPG Sandbox.love
(161.38 KiB) Downloaded 63 times
User avatar
dusoft
Party member
Posts: 510
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Switching to windowed mode, have to click twice?

Post 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.
User avatar
BrotSagtMist
Party member
Posts: 614
Joined: Fri Aug 06, 2021 10:30 pm

Re: Switching to windowed mode, have to click twice?

Post 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.
obey
randomnovice
Party member
Posts: 126
Joined: Sat May 09, 2015 9:15 pm

Re: Switching to windowed mode, have to click twice?

Post 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.
Post Reply

Who is online

Users browsing this forum: MrFariator and 67 guests