MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / processEvent

Method processEvent

src/visualizer/window/window_manager.cpp:539–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537 }
538
539 void WindowManager::processEvent(const SDL_Event& event) {
540 const SDL_WindowID main_window_id = window_ ? SDL_GetWindowID(window_) : 0;
541
542 switch (event.type) {
543 case SDL_EVENT_QUIT:
544 should_close_ = true;
545 break;
546
547 case SDL_EVENT_WINDOW_CLOSE_REQUESTED:
548 if (!eventTargetsWindow(event, main_window_id))
549 break;
550 should_close_ = true;
551 break;
552
553 case SDL_EVENT_WINDOW_FOCUS_LOST:
554 if (!eventTargetsWindow(event, main_window_id))
555 break;
556 lfs::core::events::internal::WindowFocusLost{}.emit();
557 input_router_.onWindowFocusLost();
558 if (input_controller_) {
559 input_controller_->onWindowFocusLost();
560 }
561 titlebar_drag_active_ = false;
562 break;
563
564 case SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED:
565 if (!eventTargetsWindow(event, main_window_id))
566 break;
567 if (window_) {
568 const float scale = SDL_GetWindowDisplayScale(window_);
569 lfs::core::events::internal::DisplayScaleChanged{.scale = scale}.emit();
570 }
571 updateWindowSize(windowEventName(event.type), ResizeIntent::Exact);
572 break;
573
574 case SDL_EVENT_WINDOW_MAXIMIZED:
575 if (!eventTargetsWindow(event, main_window_id))
576 break;
577 LOG_DEBUG("SDL window event: {} data1={} data2={} fullscreen={}",
578 windowEventName(event.type),
579 event.window.data1,
580 event.window.data2,
581 is_fullscreen_);
582 normalizeNativeMaximize("native-window-maximized");
583 break;
584
585 case SDL_EVENT_WINDOW_RESIZED:
586 case SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED:
587 case SDL_EVENT_WINDOW_MINIMIZED:
588 case SDL_EVENT_WINDOW_RESTORED:
589 if (!eventTargetsWindow(event, main_window_id))
590 break;
591 LOG_DEBUG("SDL window event: {} data1={} data2={} fullscreen={}",
592 windowEventName(event.type),
593 event.window.data1,
594 event.window.data2,
595 is_fullscreen_);
596 updateWindowSize(windowEventName(event.type),

Callers 3

pollEventsMethod · 0.45
waitEventsMethod · 0.45
TESTFunction · 0.45

Calls 15

eventTargetsWindowFunction · 0.85
windowEventNameFunction · 0.85
sdlMouseButtonToAppFunction · 0.85
sdlScancodeToAppKeyFunction · 0.85
sdlKeycodeToAppKeyFunction · 0.85
sdlModsToAppModsFunction · 0.85
beginMouseButtonMethod · 0.80
handleMouseButtonMethod · 0.80
endMouseButtonMethod · 0.80
handleMouseMoveMethod · 0.80
handleScrollMethod · 0.80
handleKeyMethod · 0.80

Tested by 1

TESTFunction · 0.36