| 584 | } |
| 585 | |
| 586 | void SDLWindow::Show() |
| 587 | { |
| 588 | if (_visible) |
| 589 | return; |
| 590 | |
| 591 | if (_showAfterFirstPaint) |
| 592 | { |
| 593 | if (RenderTask) |
| 594 | RenderTask->Enabled = true; |
| 595 | return; |
| 596 | } |
| 597 | |
| 598 | SDL_ShowWindow(_window); |
| 599 | if (_settings.AllowInput && _settings.ActivateWhenFirstShown) |
| 600 | Focus(); |
| 601 | else if (_settings.Parent == nullptr) |
| 602 | BringToFront(); |
| 603 | |
| 604 | // Reused top-most windows doesn't stay on top for some reason |
| 605 | if (_settings.IsTopmost && !IsPopupWindow(_settings.Type)) |
| 606 | SetIsAlwaysOnTop(true); |
| 607 | |
| 608 | if (_isTrackingMouse) |
| 609 | { |
| 610 | if (!SDL_CaptureMouse(true)) |
| 611 | { |
| 612 | if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors |
| 613 | LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError())); |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | WindowBase::Show(); |
| 618 | } |
| 619 | |
| 620 | void SDLWindow::Hide() |
| 621 | { |
nothing calls this directly
no test coverage detected