mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix popup positions on multiple screens (with same scaling only).
This commit is contained in:
parent
988dd09047
commit
08e80ccd99
2 changed files with 48 additions and 10 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue