* Find a window and make it the relative top-window on the screen. * The window gets unshaded if it was shaded, and a white border is drawn at its edges for a brief period of time to visualize its "activation". * @param cls WindowClass of the window to activate * @param number WindowNumber of the window to activate * @return a pointer to the window thus activated */
| 1276 | * @return a pointer to the window thus activated |
| 1277 | */ |
| 1278 | Window *BringWindowToFrontById(WindowClass cls, WindowNumber number) |
| 1279 | { |
| 1280 | Window *w = FindWindowById(cls, number); |
| 1281 | |
| 1282 | if (w != nullptr) { |
| 1283 | if (w->IsShaded()) w->SetShaded(false); // Restore original window size if it was shaded. |
| 1284 | |
| 1285 | w->SetWhiteBorder(); |
| 1286 | BringWindowToFront(w); |
| 1287 | w->SetDirty(); |
| 1288 | } |
| 1289 | |
| 1290 | return w; |
| 1291 | } |
| 1292 | |
| 1293 | static inline bool IsVitalWindow(const Window *w) |
| 1294 | { |
no test coverage detected