[0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

This subforum contains all the issues which we already resolved.
User avatar
mward
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Dec 24, 2014 9:38 am
Contact:

[0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by mward »

In 0.16 minimising the Factorio screen with Alt-W would turn off Alt mode, which was a minor annoyance but could be worked around.

In 0.17, Alt mode only activates when the Alt key is raised: so this no longer happens. However, any key which is pressed along with Alt is now recognised even though Alt is pressed.

In my case, I press Alt-W to minimise a window: Factorio sees the W and so the player starts walking endlessly North, since the key raise is not passed to Factorio. So you could wander into a biter nest while the game is running in the background!

[Edit:] I tried pressing W then Alt to see if that made a difference: the player still walked North, the Factorio window minimised, then the window underneath also minimised!
Last edited by mward on Sat Mar 02, 2019 8:22 pm, edited 1 time in total.
tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by tehfreek »

Additionally, keypresses from windows above Factorio can cause the same thing; closing another window with Alt-F4 causes both Alt mode and the debug pane to toggle.
Twinsen
Factorio Staff
Factorio Staff
Posts: 1348
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by Twinsen »

Related viewtopic.php?f=7&t=67585
Not conflicting if solved properly.
Vegemeister
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Sun Dec 04, 2016 9:18 pm
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by Vegemeister »

mward wrote: Sat Mar 02, 2019 6:52 pm In my case, I press Alt-W to minimise a window
I suggest rebinding all window manager shortcuts to use the super key. Super is the standard global keycombo prefix. If this Alt-W binding is a default from your WM/desktop environment, complain to the developers of *that* that they're stepping on application shortcuts.
tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by tehfreek »

Vegemeister wrote: Wed Mar 13, 2019 6:39 pm
mward wrote: Sat Mar 02, 2019 6:52 pm In my case, I press Alt-W to minimise a window
I suggest rebinding all window manager shortcuts to use the super key. Super is the standard global keycombo prefix. If this Alt-W binding is a default from your WM/desktop environment, complain to the developers of *that* that they're stepping on application shortcuts.
But Alt-W isn't the application shortcut, W is. Surely you're not suggesting that all single-key keybindings that Factorio uses must not be used in any shortcuts for higher-level functionality.
Vegemeister
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Sun Dec 04, 2016 9:18 pm
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by Vegemeister »

tehfreek wrote: Wed Mar 13, 2019 6:46 pm
Vegemeister wrote: Wed Mar 13, 2019 6:39 pm
mward wrote: Sat Mar 02, 2019 6:52 pm In my case, I press Alt-W to minimise a window
I suggest rebinding all window manager shortcuts to use the super key. Super is the standard global keycombo prefix. If this Alt-W binding is a default from your WM/desktop environment, complain to the developers of *that* that they're stepping on application shortcuts.
But Alt-W isn't the application shortcut, W is. Surely you're not suggesting that all single-key keybindings that Factorio uses must not be used in any shortcuts for higher-level functionality.
I am indeed suggesting that all shortcuts for higher-level functionality should include the super key, and shortcuts using only ctrl and/or alt be reserved for applications. All applications, including Factorio, can then avoid conflicts by not using the super key in any shortcuts.

Kerbal Space Program was (is?) similarly affected by Gnome 2's bad defaults. Functions that are accessed through the alt key on every other platform are bound to something else on Linux, and Linux users can't get proper answers to questions on the forums, because 20 years ago Gnome thought their defaults should accommodate the extremely rare keyboards without a super key.
tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by tehfreek »

Vegemeister wrote: Wed Mar 13, 2019 8:59 pm
tehfreek wrote: Wed Mar 13, 2019 6:46 pm
Vegemeister wrote: Wed Mar 13, 2019 6:39 pm
mward wrote: Sat Mar 02, 2019 6:52 pm In my case, I press Alt-W to minimise a window
I suggest rebinding all window manager shortcuts to use the super key. Super is the standard global keycombo prefix. If this Alt-W binding is a default from your WM/desktop environment, complain to the developers of *that* that they're stepping on application shortcuts.
But Alt-W isn't the application shortcut, W is. Surely you're not suggesting that all single-key keybindings that Factorio uses must not be used in any shortcuts for higher-level functionality.
I am indeed suggesting that all shortcuts for higher-level functionality should include the super key, and shortcuts using only ctrl and/or alt be reserved for applications. All applications, including Factorio, can then avoid conflicts by not using the super key in any shortcuts.

Kerbal Space Program was (is?) similarly affected by Gnome 2's bad defaults. Functions that are accessed through the alt key on every other platform are bound to something else on Linux, and Linux users can't get proper answers to questions on the forums, because 20 years ago Gnome thought their defaults should accommodate the extremely rare keyboards without a super key.
I'm not sure that you're reading the issue correctly. It isn't "global shortcuts are messing up my game", it's "Factorio is consuming key event sequences that were initiated when Factorio wasn't even focused".
Twinsen
Factorio Staff
Factorio Staff
Posts: 1348
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by Twinsen »

Oh. This really sounds like your window manager is messed up or something. We just get and use the events that the OS gives us.
If the OS sends alt+f4 to Factorio, that's not right. Or maybe it's not sending the focus lost/focus gained events correctly.
Maybe you can detail more of what works and what doesn't.


I don't think tehfreek's issue is the same as the original post.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by Oxyd »

It would be nice to know which window manager you're using so that I can try to reproduce the issue. At least on Gnome 3 it isn't happening, so your WM is definitely a part of it.
tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by tehfreek »

I did some further testing and was able to reproduce the original issue on my system as well. Changing the modifier in use to Super did not mitigate it.

In my case the WM in use is Marco 1.20.3.
User avatar
mward
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Dec 24, 2014 9:38 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by mward »

I am using KDE 4.14: so the issue applies to more than one window manager.

If the "Walk North" key is "W" then "Alt-W" should not cause the player to walk north. Additionally, if the Factorio application loses focus then any keys that are pressed on losing focus should be released.

Note that the problem did not occur with earlier versions of Factorio.
Twinsen
Factorio Staff
Factorio Staff
Posts: 1348
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by Twinsen »

W+Alt should still allow the player to continue walking. (see viewtopic.php?f=7&t=67585)

Otherwise the character stopping when tapping alt would be too annoying. So this makes it quite tricky to solve.
Clearing the walking state on focus lost is probably a reasonable solution.
User avatar
mward
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Dec 24, 2014 9:38 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by mward »

Twinsen wrote: Fri Mar 15, 2019 12:19 pmClearing the walking state on focus lost is probably a reasonable solution.
That would be a perfectly acceptable solution, thanks.
User avatar
mward
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Dec 24, 2014 9:38 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by mward »

Bye the way: a workaround for the problem until it is fixed is to press "M" to switch to map mode before minimising the window. Then the map view will scroll endlessly north instead of the player scrolling endlessly north. On switching back, just press "M" again.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by Oxyd »

Okay, in 0.17.15 I fixed a similar bug that I managed to reproduce and I think that should fix this issue as well. If things are still broken after that release or they get broken in new and exciting ways, definitely let us know!
tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by tehfreek »

Both problems seem solved in 0.17.15.
User avatar
mward
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Dec 24, 2014 9:38 am
Contact:

Re: [0.17.4] Linux: Minimising full screen Factorio with Alt-W causes the player to walk North

Post by mward »

Minimising the window no longer changes Alt mode or causes endless walking :D
Post Reply

Return to “Resolved Problems and Bugs”