Skip to content

Event::LoopDestroyed not always emmited  #1998

Closed

Description

@emilk

On Mac, when I press Cmd+Q the window closes, but there is no Event::LoopDestroyed emitted, so I cannot save my program state.

winit version: 0.25.0, used via glium/glutin.

Activity

  1. added
    DS - appkit
    C - needs investigation
    B - bug
    on Aug 15, 2021
  2. tinaun commented on Nov 25, 2021

    @tinaun
    Contributor

    I think this can be fixed by overriding applicationWillTerminate: to send a LoopDestroyed event in winits appdelegate

  3. madsmtm commented on Nov 26, 2021

    @madsmtm
    Member

    Huh, this changed in #1583 when a default macOS menu was added, because as it registers the Quit {process_name}, it also registers the key combination for it. It was even pointed out here: #1583 (comment), sorry it slipped past the changelog!

  4. madsmtm commented on Nov 26, 2021

    @madsmtm
    Member

    An alternative to the proposed PR would be to use the stop: selector in menu.rs instead of terminate:; this would allow run_return to resume, if I'm not mistaken? And the teardown code after [app run] would be called properly.

    Though I don't really have a preference

  5. added
    C - waiting on author
    and removed
    C - needs investigation
    on Jan 3, 2022
  6. added this to the Version 0.27 milestone on Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugC - waiting on authorDS - appkit

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions