Author: sveinung Date: Wed Mar 9 16:04:33 2016 New Revision: 32211 URL: http://svn.gna.org/viewcvs/freeciv?rev=32211&view=rev Log: Close the action selection dialog on lost focus.
The action selection dialog is opened based on current unit focus. Have losing focus close a unit's action selection dialog. This makes open action selection dialogs pop down when the connection to the server is lost. See bug #24506 Modified: trunk/client/control.c Modified: trunk/client/control.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/control.c?rev=32211&r1=32210&r2=32211&view=diff ============================================================================== --- trunk/client/control.c (original) +++ trunk/client/control.c Wed Mar 9 16:04:33 2016 @@ -444,6 +444,11 @@ **************************************************************************/ static void current_focus_remove(struct unit *punit) { + /* Close the action selection dialog if the actor unit lose focus. */ + if (action_selection_actor_unit() == punit->id) { + action_selection_close(); + } + unit_list_remove(current_focus, punit); refresh_unit_mapcanvas(punit, unit_tile(punit), TRUE, FALSE); } @@ -495,6 +500,13 @@ store_previous_focus(); focus_changed = TRUE; } + + /* Close the action selection dialog if the actor unit lose focus. */ + unit_list_iterate(current_focus, punit_old) { + if (action_selection_actor_unit() == punit_old->id) { + action_selection_close(); + } + } unit_list_iterate_end; /* Redraw the old focus unit (to fix blinking or remove the selection * circle). */ _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits