From 587d7839559d7292c9611dc076b6dc51911c90c8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 6 Sep 2018 18:53:00 -0700 Subject: [PATCH] Use SDL_WINDOWPOS_CENTERED_DISPLAY() to fix incorrect positioning on multi-display system on macOS --- app/streaming/session.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index dff470c1..a4cdf787 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -581,16 +581,11 @@ void Session::getWindowDimensions(int& x, int& y, if (SDL_GetDisplayUsableBounds(displayIndex, &usableBounds) == 0) { width = usableBounds.w; height = usableBounds.h; - x = usableBounds.x; - y = usableBounds.y; if (m_Window != nullptr) { int top, left, bottom, right; if (SDL_GetWindowBordersSize(m_Window, &top, &left, &bottom, &right) == 0) { - x += left; - y += top; - width -= left + right; height -= top + bottom; } @@ -615,8 +610,9 @@ void Session::getWindowDimensions(int& x, int& y, width = m_StreamConfig.width; height = m_StreamConfig.height; - x = y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(displayIndex); } + + x = y = SDL_WINDOWPOS_CENTERED_DISPLAY(displayIndex); } void Session::updateOptimalWindowDisplayMode()