_misc windowing
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:
2025-01-07 17:58:43 +02:00
parent 75c44122c6
commit d41f5bd3e6
2 changed files with 17 additions and 20 deletions

View File

@@ -203,7 +203,6 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
}
#endif
SDL_DisplayID display = SDL_GetDisplayForWindow(_window);
_dpiScale = SDL_GetWindowDisplayScale(_window);
_dpi = Math::TruncToInt(_dpiScale * DefaultDPI);
@@ -256,9 +255,9 @@ void* GetNativeWindowPointer(SDL_Window* window)
#if PLATFORM_WINDOWS
windowPtr = SDL_GetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, nullptr);
#elif PLATFORM_LINUX
windowPtr = SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, nullptr);
windowPtr = SDL_GetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, nullptr);
if (windowPtr == nullptr)
windowPtr = (void*)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);
windowPtr = (void*)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);
#elif PLATFORM_MAC
windowPtr = SDL_GetPointerProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, nullptr);
#elif PLATFORM_ANDROID
@@ -585,12 +584,10 @@ void SDLWindow::HandleEvent(SDL_Event& event)
// Check if window size has been changed
if (width > 0 && height > 0 && (_swapChain == nullptr || width != _swapChain->GetWidth() || height != _swapChain->GetHeight()))
OnResize(width, height);
LOG(Info, "Resized {}x{}", width, height);
return;
}
case SDL_EVENT_WINDOW_FOCUS_GAINED:
{
LOG(Info, "Focus gained {}", GetTitle());
#if PLATFORM_LINUX
_forcedFocus = false;
#endif
@@ -606,7 +603,6 @@ void SDLWindow::HandleEvent(SDL_Event& event)
}
case SDL_EVENT_WINDOW_FOCUS_LOST:
{
LOG(Info, "Focus lost {}", GetTitle());
#if PLATFORM_LINUX
_forcedFocus = false;
#endif
@@ -922,15 +918,6 @@ Int2 GetSDLWindowScreenPosition(const SDLWindow* window)
void SetSDLWindowScreenPosition(const SDLWindow* window, const int x, const int y)
{
#if PLATFORM_LINUX
/*if (SDLPlatform::UsesWayland())
{
int oldX, oldY;
SDL_GetWindowPosition(window->GetSDLWindow(), &oldX, &oldY);
if (x == oldX && y == oldY)
return;
}*/
#endif
Int2 relativePosition(x, y);
GetRelativeWindowOffset(window->GetSettings().Type, window->GetSettings().Parent, relativePosition);
SDL_SetWindowPosition(window->GetSDLWindow(), relativePosition.X, relativePosition.Y);