diff --git a/main.cpp b/main.cpp index 1cf3d2d..8da4191 100644 --- a/main.cpp +++ b/main.cpp @@ -69,6 +69,10 @@ int main(int argc, const char * argv[]) { // main window sc::gui::Window& window {sc::gui::Window::new_window("screensaver")}; + window.add_event_handler([](const SDL_Event& event, bool quit) -> bool { + std::cerr << "closing window " << event.window.windowID << '\n'; + return quit; + }, SDL_WINDOWEVENT_CLOSE); int opt_char, opt_val; struct option long_options[] = {