Mir: Handle close window events
authorMarius Gripsgard <marius@ubports.com>
Sat, 13 Jan 2018 01:58:11 +0100
changeset 1182613d922b387db
parent 11825 44536468cdd2
child 11827 922c27f2fa56
Mir: Handle close window events
src/video/mir/SDL_mirevents.c
     1.1 --- a/src/video/mir/SDL_mirevents.c	Mon Jan 15 10:29:53 2018 -0800
     1.2 +++ b/src/video/mir/SDL_mirevents.c	Sat Jan 13 01:58:11 2018 +0100
     1.3 @@ -285,6 +285,11 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +static void
     1.8 +MIR_HandleClose(SDL_Window* window) {
     1.9 +    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0, 0);
    1.10 +}
    1.11 +
    1.12  void
    1.13  MIR_HandleEvent(MirWindow* mirwindow, MirEvent const* ev, void* context)
    1.14  {
    1.15 @@ -302,6 +307,9 @@
    1.16              case (mir_event_type_window):
    1.17                  HandleWindow(MIR_mir_event_get_window_event(ev), window);
    1.18                  break;
    1.19 +            case (mir_event_type_close_window):
    1.20 +                MIR_HandleClose(window);
    1.21 +                break;
    1.22              default:
    1.23                  break;
    1.24          }