Skip to content

Pressing Stop Does Not Send NOTIFICATION_WM_CLOSE_REQUEST using Embedded Game Window on macOS #114640

@stevemcilwain

Description

@stevemcilwain

Tested versions

Tested with Godot 4.5.1.stable.

This looks similar to a previous issue fixed for Windows and Linux in 4.4 beta 1, but I believe the mac implementation is a bit different:
#101863

System information

Godot v4.5.1.stable - macOS Tahoe (26.2.0) - Multi-window, 2 monitors - Metal (Forward+) - integrated Apple M2 (Apple8) - Apple M2 (8 threads) - 24.00 GiB memory

Issue description

When writing code to intercept window close requests, the notification is never received when playing via the editor's embedded game window on macOS.

Switching to "Make Game Workspace Floating on Next Play" works as expected, the notification is received.

Steps to reproduce

Run this code in the editor on macOS using the embedded game window.
After pressing stop, nothing is logged.

Run the same code using the floating game window and the log is present.

func _notification(what: int) -> void:
     if what == NOTIFICATION_WM_CLOSE_REQUEST:
		print("WM close request received")

MRP is included.

Minimal reproduction project (MRP)

mrp-wm-close.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions