* Returns whether a window may be shown or not. * @param w The window to consider. * @return True iff it may be shown, otherwise false. */
| 855 | * @return True iff it may be shown, otherwise false. |
| 856 | */ |
| 857 | static bool MayBeShown(const Window *w) |
| 858 | { |
| 859 | /* If we're not modal, everything is okay. */ |
| 860 | if (!HasModalProgress()) return true; |
| 861 | |
| 862 | switch (w->window_class) { |
| 863 | case WC_MAIN_WINDOW: ///< The background, i.e. the game. |
| 864 | case WC_MODAL_PROGRESS: ///< The actual progress window. |
| 865 | case WC_CONFIRM_POPUP_QUERY: ///< The abort window. |
| 866 | return true; |
| 867 | |
| 868 | default: |
| 869 | return false; |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | /** |
| 874 | * Generate repaint events for the visible part of window w within the rectangle. |
no test coverage detected