From 7cd39b7d1511f50a8aa18c828ebbce29d05e001c Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Sat, 13 Jan 2018 01:58:11 +0100 Subject: [PATCH] Mir: Handle close window events --- src/video/mir/SDL_mirevents.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/video/mir/SDL_mirevents.c b/src/video/mir/SDL_mirevents.c index 352a9bf90..df92799f3 100644 --- a/src/video/mir/SDL_mirevents.c +++ b/src/video/mir/SDL_mirevents.c @@ -285,6 +285,11 @@ HandleWindow(MirWindowEvent const* event, SDL_Window* window) } } +static void +MIR_HandleClose(SDL_Window* window) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0, 0); +} + void MIR_HandleEvent(MirWindow* mirwindow, MirEvent const* ev, void* context) { @@ -302,6 +307,9 @@ MIR_HandleEvent(MirWindow* mirwindow, MirEvent const* ev, void* context) case (mir_event_type_window): HandleWindow(MIR_mir_event_get_window_event(ev), window); break; + case (mir_event_type_close_window): + MIR_HandleClose(window); + break; default: break; }