Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iconsistent close_requested emission with FLAG_POPUP #92417

Closed
Summersay415 opened this issue May 27, 2024 · 1 comment · Fixed by #92460
Closed

Iconsistent close_requested emission with FLAG_POPUP #92417

Summersay415 opened this issue May 27, 2024 · 1 comment · Fixed by #92460
Milestone

Comments

@Summersay415
Copy link
Contributor

Summersay415 commented May 27, 2024

Tested versions

  • Reproducible in v4.3.dev6.official [64520fe]
  • Reproducible in v4.2.2.stable.official [15073af]
  • Partially reproducible in v4.1.4.stable.official [fe0e8e5]
  • Partially reproducible in v4.0.4.stable.official [fc0b241]

System information

Godot v4.3.dev6 - Ubuntu 24.04 LTS 24.04 - X11 - GLES3 (Compatibility) - Mesa Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)

Issue description

There is some inconsistency with close_requested signal emission with enabled embed_subwindows and disabled.
We have three windows: one Window, one AcceptDialog, one PopupPanel, everything with popup_window enabled and exclusive disabled.
Behavior with embed_subwindows disabled:

  • Window: when clicked outside or close button pressed, emits close_requested (twice if version >4.2 and Linux/*BSD).
  • AcceptDialog: when clicked outside or close button pressed, emits close_requested and canceled (both twice if >4.2 and Linux/*BSD). When clicked on OK, (emits canceled and close_requested - if >4.2 and Linux/*BSD) and emits confirmed.
  • PopupPanel: when clicked outside, emits close_requested (twice if >4.2 and Linux/*BSD) and popup_hide.

It strangely changes when embed_subwindows is enabled:

  • Window: when clicked outside, does nothing... If close button pressed, emits close_requested (correct).
  • AcceptDialog: when clicked outside, emits only canceled AND closes. When clicked on OK, emits both canceled and confirmed, but not close_requested. If close button pressed, emits canceled and close_requested.
  • PopupPanel: when clicked outside, emits only popup_hide AND closes.

Related to: #85417

Steps to reproduce

  1. Download MRP.
  2. Do steps described higher.
  3. Observe result by looking at console.

Minimal reproduction project (MRP)

mrp.zip

@Summersay415 Summersay415 changed the title Iconsistent close_requested emission with FLAG_POPUP Iconsistent close_requested emission with FLAG_POPUP May 27, 2024
@Summersay415
Copy link
Contributor Author

Summersay415 commented May 28, 2024

Bisected when double emission started:

8c1ce404d7d96c7034018a37cbf4a8bcad6d7386 is the first bad commit
commit 8c1ce404d7d96c7034018a37cbf4a8bcad6d7386
Author: Markus Sauermann <6299227+Sauermann@users.noreply.github.com>
Date:   Wed Aug 2 00:17:25 2023 +0200

    Fix crash on Windows when closing `Window`
    
    Send `WINDOW_EVENT_MOUSE_EXIT` when a window is destroyed.
    
    Ensure, that on Windows, the event_callback is still valid during
    destroying the `Window`.

 platform/linuxbsd/x11/display_server_x11.cpp | 6 ++++++
 platform/windows/display_server_windows.cpp  | 4 ++++
 scene/main/window.cpp                        | 6 ------
 3 files changed, 10 insertions(+), 6 deletions(-)

PR: #80142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants