You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Fix native popups auto-closing when interacting with non-client area.
(cherry picked from commit e26a6c36c8)
This commit is contained in:
@@ -3928,7 +3928,7 @@ bool DisplayServerX11::mouse_process_popups() {
|
|||||||
// Find top popup to close.
|
// Find top popup to close.
|
||||||
while (E) {
|
while (E) {
|
||||||
// Popup window area.
|
// Popup window area.
|
||||||
Rect2i win_rect = Rect2i(window_get_position(E->get()), window_get_size(E->get()));
|
Rect2i win_rect = Rect2i(window_get_position_with_decorations(E->get()), window_get_size_with_decorations(E->get()));
|
||||||
// Area of the parent window, which responsible for opening sub-menu.
|
// Area of the parent window, which responsible for opening sub-menu.
|
||||||
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
|
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
|
||||||
if (win_rect.has_point(pos)) {
|
if (win_rect.has_point(pos)) {
|
||||||
|
|||||||
@@ -3800,7 +3800,7 @@ bool DisplayServerMacOS::mouse_process_popups(bool p_close) {
|
|||||||
// Find top popup to close.
|
// Find top popup to close.
|
||||||
while (E) {
|
while (E) {
|
||||||
// Popup window area.
|
// Popup window area.
|
||||||
Rect2i win_rect = Rect2i(window_get_position(E->get()), window_get_size(E->get()));
|
Rect2i win_rect = Rect2i(window_get_position_with_decorations(E->get()), window_get_size_with_decorations(E->get()));
|
||||||
// Area of the parent window, which responsible for opening sub-menu.
|
// Area of the parent window, which responsible for opening sub-menu.
|
||||||
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
|
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
|
||||||
if (win_rect.has_point(pos)) {
|
if (win_rect.has_point(pos)) {
|
||||||
|
|||||||
@@ -2503,7 +2503,7 @@ LRESULT DisplayServerWindows::MouseProc(int code, WPARAM wParam, LPARAM lParam)
|
|||||||
// Find top popup to close.
|
// Find top popup to close.
|
||||||
while (E) {
|
while (E) {
|
||||||
// Popup window area.
|
// Popup window area.
|
||||||
Rect2i win_rect = Rect2i(window_get_position(E->get()), window_get_size(E->get()));
|
Rect2i win_rect = Rect2i(window_get_position_with_decorations(E->get()), window_get_size_with_decorations(E->get()));
|
||||||
// Area of the parent window, which responsible for opening sub-menu.
|
// Area of the parent window, which responsible for opening sub-menu.
|
||||||
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
|
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
|
||||||
if (win_rect.has_point(pos)) {
|
if (win_rect.has_point(pos)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user