_window positioning that works on windows
This commit is contained in:
@@ -196,6 +196,10 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
|
||||
}
|
||||
}
|
||||
|
||||
Int2 oldpos2(x, y);
|
||||
|
||||
// It should be noted that SDL creates the window in client-space coordinates (ignoring window decorations)
|
||||
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_SetNumberProperty(props, "flags", flags);
|
||||
SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, settings.Title.ToStringAnsi().Get());
|
||||
@@ -242,16 +246,17 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
|
||||
SDL_GetWindowSizeInPixels(_window, &rect.w, &rect.h);
|
||||
_cachedClientRectangle = Rectangle((float)rect.x, (float)rect.y, (float)rect.w, (float)rect.h);
|
||||
|
||||
Int2 newpos = GetPosition();
|
||||
LOG(Info, "new window at {}, expected: {}", newpos, oldpos);
|
||||
ASSERT(newpos == oldpos);
|
||||
Int2 newpos = GetClientPosition();
|
||||
//Int2 newposclient = GetClientPosition();
|
||||
LOG(Info, "new window at {}, input {}, expected: {}", newpos, oldpos, oldpos2);
|
||||
ASSERT(newpos == oldpos || newpos == oldpos2);
|
||||
|
||||
oldpos = newpos;
|
||||
/*oldpos = newpos;
|
||||
SetPosition(newpos);
|
||||
newpos = GetPosition();
|
||||
|
||||
LOG(Info, "new window sanity set at {}", newpos);
|
||||
ASSERT(newpos == oldpos);
|
||||
ASSERT(newpos == oldpos);*/
|
||||
|
||||
SDL_SetWindowHitTest(_window, &OnWindowHitTest, this);
|
||||
InitSwapChain();
|
||||
@@ -952,6 +957,11 @@ void GetRelativeWindowPosition(const SDLWindow* window, Int2& relativePosition,
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if PLATFORM_WINDOWS
|
||||
//relativePosition = Int2::Zero;
|
||||
return;
|
||||
#endif
|
||||
|
||||
SDLWindow* parent;
|
||||
if (SDLPlatform::UsesX11())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user