Skip to content

Commit

Permalink
Mir: Handle close window events
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogrip committed Jan 13, 2018
1 parent 0cba684 commit 7cd39b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/video/mir/SDL_mirevents.c
Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down

0 comments on commit 7cd39b7

Please sign in to comment.