diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-17 20:22:29 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-17 20:22:29 +0100 |
| commit | bc937e3e711e53774e2c9fa26d13125427f6378b (patch) | |
| tree | bf2c3bf70de21158d5d965ad186699a753290f8a /src/Compositor.cpp | |
| parent | ab7d727532cb409c980bb849507984d634611235 (diff) | |
Renderer
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 7a535b5d..fbf98eb9 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -62,6 +62,8 @@ CCompositor::CCompositor() { wl_signal_add(&m_sWLRSeat->events.request_set_cursor, &Events::listen_requestMouse); wl_signal_add(&m_sWLRSeat->events.request_set_selection, &Events::listen_requestSetSel); + m_sWLRPresentation = wlr_presentation_create(m_sWLDisplay, m_sWLRBackend); + // TODO: XWayland } @@ -82,6 +84,9 @@ void CCompositor::startCompositor() { Debug::log(LOG, "Creating the InputManager!"); g_pInputManager = std::make_unique<CInputManager>(); + + Debug::log(LOG, "Creating the HyprRenderer!"); + g_pHyprRenderer = std::make_unique<CHyprRenderer>(); // // @@ -111,4 +116,31 @@ void CCompositor::startCompositor() { // This blocks until we are done. Debug::log(LOG, "Hyprland is ready, running the event loop!"); wl_display_run(m_sWLDisplay); +} + +SMonitor* CCompositor::getMonitorFromID(const int& id) { + for (auto& m : m_vMonitors) { + if (m.ID == id) { + return &m; + } + } + + return nullptr; +} + +SMonitor* CCompositor::getMonitorFromCursor() { + const auto COORDS = g_pInputManager->getMouseCoordsInternal(); + const auto OUTPUT = wlr_output_layout_output_at(m_sWLROutputLayout, COORDS.x, COORDS.y); + + if (!OUTPUT) { + Debug::log(WARN, "getMonitorFromCursor: cursour outside monitors??"); + return &m_vMonitors[0]; + } + + for (auto& m : m_vMonitors) { + if (m.output == OUTPUT) + return &m; + } + + return &m_vMonitors[0]; }
\ No newline at end of file |
