Page 1 of 1

Minimize on alt tab and GUIs

Posted: Sat Sep 10, 2022 2:23 pm
by nuhll
So im talking about the option top right under graphic, something along the line, "minimizes itself when alt tabbed".

I dont know if its intented or not, but all guis which are on the bottom gets dragged in the middle of the screen after each alt tab. I dont need that option (and i dont know why its enabled) but disabling it makes everything normal. I found it out bc SE has this new GUI for life support and its left bottom next to your action bar, but not when you alt tab, then its in the middle of the screen.

Latest version WIN 10, Factorio, SE, Krastorio and QoL

And yeah, it happens to Vanilla GUIs also...

Ive addes some pictures for better description...
this option.jpg
this option.jpg (2.63 MiB) Viewed 1148 times
1 before alt tab when disabled.jpg
1 before alt tab when disabled.jpg (2.29 MiB) Viewed 1148 times
2 after alt tab when disabled.jpg
2 after alt tab when disabled.jpg (2.69 MiB) Viewed 1148 times
3 before alt tab when enabled.jpg
3 before alt tab when enabled.jpg (2.7 MiB) Viewed 1148 times
4 after alt tab when enabled.jpg
4 after alt tab when enabled.jpg (2.56 MiB) Viewed 1148 times

Re: Minimize on alt tab and GUIs

Posted: Sat Sep 10, 2022 6:55 pm
by BurninSun
Changing resolution causes any of Factorio's center GUIs to reset back to center. With that setting enabled, when alt-tabbing out, the Factorio window is converted back to a window from full screen, then minimized. That conversion causes a resolution change which causes Factorio to reset its GUIs. Factorio's GUI's don't save their position between open/close, so they reset to where ever they're supposed to when opened.

Re: Minimize on alt tab and GUIs

Posted: Sat Sep 10, 2022 7:20 pm
by nuhll
I was talking to some friendly guys on SE discord.

I have some ideas to fix this:

1.) maybe you can stop windows from resizing the window before alt tabbing (dont know). Im also not sure if that is factorios fault or windows.

2.) what about storing locations bound to resolution (that would make perfectly sense)

2b.) they said you store all window positions global between all players, because some windows might need it. Scripted events or something. What about defaulting windows to not be synced, im naive and i think most windows dont need to be synced because its not relevant (performance?), if a modder needs it synced, they could add a tag or something to their window.

3.) if you know the game get alt tabbed just restore the "before value" and or ignore the auto resize

Thats my 2 cents.

edit:

if u enter (save before and load after)
/c
script.on_event(defines.events.on_player_display_resolution_changed, function (event)
local player = game.get_player(event.player_index) game.print("Old: " .. serpent.line(event.old_resolution) .. " New: " .. serpent.line(player.display_resolution))
end)

it will print out the resolution change while alt tabbing, thats the whole reason for this bug
6.png
6.png (112.58 KiB) Viewed 1124 times

Re: Minimize on alt tab and GUIs

Posted: Sat Sep 10, 2022 9:56 pm
by Rseding91
Thanks for the report however none of this is a bug.

Re: Minimize on alt tab and GUIs

Posted: Sun Sep 11, 2022 12:54 pm
by nuhll
so its working as intented that GUIs get moved around without user interaction? (and only when that option is enabled)