MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ handle_close()

void MayaFlux::Portal::Forma::Context::handle_close ( )
private

Definition at line 559 of file Context.cpp.

560{
561 auto* event_source = &m_window->get_event_source();
562 const std::string close_event_name = m_name + "_close";
563
564 for (auto& [id, callbacks] : m_callbacks) {
565 if (callbacks.close)
566 callbacks.close();
567 }
568 clear_focus();
569 detach_window(false);
570 event_source->defer([event_manager = &m_event_manager,
571 name = std::move(close_event_name)]() {
572 event_manager->cancel_event(name);
573 });
574}
std::string name
Definition VKDevice.cpp:123
Vruta::EventManager & m_event_manager
Definition Context.hpp:357
std::shared_ptr< Core::Window > m_window
Definition Context.hpp:356
const Vruta::WindowEventSource & event_source() const
Definition Context.cpp:188
std::unordered_map< uint32_t, ElementCallbacks > m_callbacks
Definition Context.hpp:361
void clear_focus()
Clear keyboard focus (no element focused).
Definition Context.cpp:158
void detach_window(bool cancel_close=true)
Definition Context.cpp:141
void defer(std::function< void()> action)
Run an action after the active outermost window-event dispatch.

References clear_focus(), MayaFlux::Vruta::WindowEventSource::defer(), detach_window(), event_source(), m_callbacks, m_event_manager, m_name, m_window, and name.

Referenced by register_handlers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: