MCPcopy Create free account
hub / github.com/clementgallet/libTAS / pushQuitEvent

Function pushQuitEvent

src/library/frame.cpp:519–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519static void pushQuitEvent(void)
520{
521 if (Global::game_info.video & GameInfo::SDL1) {
522 SDL1::SDL_Event ev;
523 ev.type = SDL1::SDL_QUIT;
524 sdlEventQueue.insert(&ev);
525 }
526
527 if (Global::game_info.video & GameInfo::SDL2) {
528 SDL_Event ev;
529 ev.type = SDL_QUIT;
530 sdlEventQueue.insert(&ev);
531 }
532
533#ifdef __unix__
534 if (XlibGameWindow::get() == 0)
535 return;
536
537 GlobalNoLog gnl;
538 XEvent xev;
539 xev.xclient.type = ClientMessage;
540 xev.xclient.window = XlibGameWindow::get();
541 xev.xclient.format = 32;
542 xev.xclient.data.l[1] = CurrentTime;
543
544 for (int i=0; i<GAMEDISPLAYNUM; i++) {
545 if (x11::gameDisplays[i]) {
546 xev.xclient.message_type = x11_atom(WM_PROTOCOLS);
547 xev.xclient.data.l[0] = x11_atom(WM_DELETE_WINDOW);
548 NATIVECALL(XSendEvent(x11::gameDisplays[i], XlibGameWindow::get(), False, NoEventMask, &xev));
549 NATIVECALL(XSync(x11::gameDisplays[i], false));
550 }
551 }
552#endif
553}
554
555static void screen_redraw(std::function<void()> draw, RenderHUD& hud, const AllInputsFlat& preview_ai, bool noidle)
556{

Callers 1

receive_messagesFunction · 0.85

Calls 3

XSendEventFunction · 0.85
XSyncFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected