Signed-off-by: falkTX <falktx@falktx.com>pull/443/head
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * Permission to use, copy, modify, and/or distribute this software for any purpose with | ||||
* or without fee is hereby granted, provided that the above copyright notice and this | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -208,6 +208,9 @@ void Window::setOffsetY(const int y) | |||||
void Window::setOffset(const int x, const int y) | void Window::setOffset(const int x, const int y) | ||||
{ | { | ||||
// do not call this for embed windows! | |||||
DISTRHO_SAFE_ASSERT_RETURN(!pData->isEmbed,); | |||||
if (pData->view != nullptr) | if (pData->view != nullptr) | ||||
puglSetPosition(pData->view, x, y); | puglSetPosition(pData->view, x, y); | ||||
} | } | ||||
@@ -86,6 +86,10 @@ static PuglView* puglNewViewWithParentWindow(PuglWorld* const world, const uintp | |||||
if (PuglView* const view = puglNewView(world)) | if (PuglView* const view = puglNewView(world)) | ||||
{ | { | ||||
puglSetParentWindow(view, parentWindowHandle); | puglSetParentWindow(view, parentWindowHandle); | ||||
if (parentWindowHandle != 0) | |||||
puglSetPosition(view, 0, 0); | |||||
return view; | return view; | ||||
} | } | ||||
@@ -212,9 +216,6 @@ Window::PrivateData::PrivateData(Application& a, Window* const s, | |||||
#endif | #endif | ||||
modal() | modal() | ||||
{ | { | ||||
if (isEmbed) | |||||
puglSetParentWindow(view, parentWindowHandle); | |||||
initPre(width != 0 ? width : DEFAULT_WIDTH, height != 0 ? height : DEFAULT_HEIGHT, resizable); | initPre(width != 0 ? width : DEFAULT_WIDTH, height != 0 ? height : DEFAULT_HEIGHT, resizable); | ||||
} | } | ||||