_windows subwindow popup fix
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled

This commit is contained in:
2024-12-27 12:49:06 +02:00
parent d5b64aece4
commit cd2e7140af

View File

@@ -133,6 +133,10 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
flags |= SDL_WINDOW_TRANSPARENT;
//flags |= SDL_WINDOW_HIGH_PIXEL_DENSITY;
// Disable parenting of child windows as those are always on top of the parent window and never show up in taskbar
//if (_settings.Parent != nullptr && (_settings.Type != WindowType::Tooltip && _settings.Type != WindowType::Popup))
// _settings.Parent = nullptr;
if (_settings.Parent == nullptr && (_settings.Type == WindowType::Tooltip || _settings.Type == WindowType::Popup))
{
// Creating a popup window on some platforms brings the parent window on top.
@@ -186,6 +190,14 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
auto parentPosition = _settings.Parent->ClientToScreen(Float2::Zero);
x -= Math::TruncToInt(parentPosition.X);
y -= Math::TruncToInt(parentPosition.Y);
auto parentParent = _settings.Parent->GetSettings().Parent;
if (parentParent != nullptr)
{
auto parentParentPosition = parentParent->ClientToScreen(Float2::Zero);
x -= Math::TruncToInt(parentParentPosition.X);
y -= Math::TruncToInt(parentParentPosition.Y);
}
}
if (SDLPlatform::UsesX11() && _settings.Parent != Engine::MainWindow)
{
@@ -254,7 +266,7 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
Int2 newpos = GetClientPosition();
//Int2 newposclient = GetClientPosition();
LOG(Info, "new window at {}, input {}, expected: {}", newpos, oldpos, oldpos2);
ASSERT(newpos == oldpos || newpos == oldpos2);
//ASSERT(newpos == oldpos || newpos == oldpos2);
/*oldpos = newpos;
SetPosition(newpos);