Merge lp:~widelands-dev/widelands/bug-1800182-focus-save-menu into lp:widelands

Proposed by Notabilis
Status: Merged
Merged at revision: 8910
Proposed branch: lp:~widelands-dev/widelands/bug-1800182-focus-save-menu
Merge into: lp:widelands
Diff against target: 11 lines (+1/-0)
1 file modified
src/wui/game_main_menu_save_game.cc (+1/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1800182-focus-save-menu
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+358284@code.launchpad.net

Commit message

Setting focus to edit box when opening the game save menu.

Description of the change

When the game save menu is opened, the keyboard focus isn't set to the filename input edit box. Besides the inconvenience of having to click in the edit box before entering the filename, keyboard input also modifies the state of the game, e.g., opening the minimap.

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

Working as expected :)

@bunnybot merge

review: Approve
Revision history for this message
Arty (artydent) wrote :

That keypresses affect the game window from the save menu is a more general issue that should be resolved. Sure, the name edit box grabs the keys when it has the focus, but as soon as the filename table is focued (which happends naturally when someone selects a name there), key handling (aside from a few keys like Up/Down) seems to be referred to the game window in the background.

We should generally prevent that. (Not necessarily in this branch.) Maybe it's enough to have the LoadOrSave table simply grab the keys instead of referring the key handling to something else. Hard to say right now, I haven't even checked which route the key handling takes to end up at the game window.

Revision history for this message
Arty (artydent) wrote :

Or rather than letting the save menu (and possibly some others) deal with "let's not accidentally refer key handling to the game window" issues, maybe the game window needs a "state" variable to distinguish between "game is running normally", "game is paused in background behind some other window" (and possibly other states), and then any key handling is suspended in certain states.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Can you open up a new bug report for the problem with the passing on of keypresses? Let's target that one to Build 21, since it's an old issue.

Revision history for this message
Arty (artydent) wrote :

Bug report is up.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/wui/game_main_menu_save_game.cc'
2--- src/wui/game_main_menu_save_game.cc 2018-10-26 07:09:29 +0000
3+++ src/wui/game_main_menu_save_game.cc 2018-11-04 08:51:30 +0000
4@@ -115,6 +115,7 @@
5 center_to_parent();
6 move_to_top();
7
8+ filename_editbox_.focus();
9 pause_game(true);
10 set_thinks(false);
11 layout();

Subscribers

People subscribed via source and target branches

to status/vote changes: