diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-16 13:44:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 13:44:51 +0200 |
commit | cd168363920545cd9b5dc3ee313882c9bff85435 (patch) | |
tree | 3b7d32e65b8b20a2f854f4c3f09cf1f56f152ed8 /scene/main/window.cpp | |
parent | 1a43d3b396c4916e795d78aef6ebd94ca8ed43ff (diff) | |
parent | 08e80ccd999bf8bf2c80d2300097ceb82e3f8c42 (diff) |
Merge pull request #37430 from bruvzg/fix_non_hidpi_popup_pos
[macOS] Fix popup positions on multiple screens.
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r-- | scene/main/window.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 6565f02503..b2fc17c0ab 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1024,6 +1024,15 @@ void Window::popup(const Rect2i &p_screen_rect) { set_size(adjust.size); } + int scr = DisplayServer::get_singleton()->get_screen_count(); + for (int i = 0; i < scr; i++) { + Rect2i r = DisplayServer::get_singleton()->screen_get_usable_rect(i); + if (r.has_point(position)) { + current_screen = i; + break; + } + } + set_transient(true); set_visible(true); _post_popup(); |