diff options
| author | Darksome <dev@darkso.me> | 2022-07-15 19:42:03 +0300 |
|---|---|---|
| committer | Darksome <dev@darkso.me> | 2022-07-15 19:42:03 +0300 |
| commit | 5388b54442614cb0d3d445f101e7cd86bf64c125 (patch) | |
| tree | 26057ff185e423e944e8b250ed7fe26654b69623 /src/Compositor.cpp | |
| parent | cb8a6f881b11e9a269fd5f7aa64eafe2beda0b0d (diff) | |
| parent | 6306d4dae3fa221a6099e109c7faef60bac4fac5 (diff) | |
Merge upstream
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 237 |
1 files changed, 200 insertions, 37 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 0d8698a6..da6ba1c5 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1,4 +1,16 @@ #include "Compositor.hpp" +#include "helpers/Splashes.hpp" +#include <random> + +int handleCritSignal(int signo, void* data) { + Debug::log(LOG, "Hyprland received signal %d", signo); + + if (signo == SIGTERM || signo == SIGINT || signo == SIGKILL) { + g_pCompositor->cleanup(); + } + + return 0; // everything went fine +} CCompositor::CCompositor() { m_szInstanceSignature = GIT_COMMIT_HASH + std::string("_") + std::to_string(time(NULL)); @@ -22,29 +34,36 @@ CCompositor::CCompositor() { Debug::log(INFO, "If you are crashing, or encounter any bugs, please consult https://github.com/hyprwm/Hyprland/wiki/Crashing-and-bugs\n\n"); + setRandomSplash(); + + Debug::log(LOG, "\nCurrent splash: %s\n\n", m_szCurrentSplash.c_str()); + m_sWLDisplay = wl_display_create(); + m_sWLEventLoop = wl_display_get_event_loop(m_sWLDisplay); + + // register crit signal handler + wl_event_loop_add_signal(m_sWLEventLoop, SIGTERM, handleCritSignal, nullptr); + //wl_event_loop_add_signal(m_sWLEventLoop, SIGINT, handleCritSignal, nullptr); + m_sWLRBackend = wlr_backend_autocreate(m_sWLDisplay); if (!m_sWLRBackend) { Debug::log(CRIT, "m_sWLRBackend was NULL!"); - RIP("m_sWLRBackend NULL!"); - return; + throw std::runtime_error("wlr_backend_autocreate() failed!"); } m_iDRMFD = wlr_backend_get_drm_fd(m_sWLRBackend); if (m_iDRMFD < 0) { Debug::log(CRIT, "Couldn't query the DRM FD!"); - RIP("DRMFD NULL!"); - return; + throw std::runtime_error("wlr_backend_get_drm_fd() failed!"); } m_sWLRRenderer = wlr_gles2_renderer_create_with_drm_fd(m_iDRMFD); if (!m_sWLRRenderer) { Debug::log(CRIT, "m_sWLRRenderer was NULL!"); - RIP("m_sWLRRenderer NULL!"); - return; + throw std::runtime_error("wlr_gles2_renderer_create_with_drm_fd() failed!"); } wlr_renderer_init_wl_display(m_sWLRRenderer, m_sWLDisplay); @@ -53,16 +72,14 @@ CCompositor::CCompositor() { if (!m_sWLRAllocator) { Debug::log(CRIT, "m_sWLRAllocator was NULL!"); - RIP("m_sWLRAllocator NULL!"); - return; + throw std::runtime_error("wlr_allocator_autocreate() failed!"); } m_sWLREGL = wlr_gles2_renderer_get_egl(m_sWLRRenderer); if (!m_sWLREGL) { Debug::log(CRIT, "m_sWLREGL was NULL!"); - RIP("m_sWLREGL NULL!"); - return; + throw std::runtime_error("wlr_gles2_renderer_get_egl() failed!"); } m_sWLRCompositor = wlr_compositor_create(m_sWLDisplay, m_sWLRRenderer); @@ -124,17 +141,26 @@ CCompositor::CCompositor() { m_sWLRForeignRegistry = wlr_xdg_foreign_registry_create(m_sWLDisplay); + m_sWLRIdleInhibitMgr = wlr_idle_inhibit_v1_create(m_sWLDisplay); + wlr_xdg_foreign_v1_create(m_sWLDisplay, m_sWLRForeignRegistry); wlr_xdg_foreign_v2_create(m_sWLDisplay, m_sWLRForeignRegistry); + + m_sWLRPointerGestures = wlr_pointer_gestures_v1_create(m_sWLDisplay); + + m_sWLRSession = wlr_backend_get_session(m_sWLRBackend); } CCompositor::~CCompositor() { - cleanupExit(); + cleanup(); } -void handleCritSignal(int signo) { - g_pCompositor->cleanupExit(); - exit(signo); +void CCompositor::setRandomSplash() { + std::random_device dev; + std::mt19937 engine(dev()); + std::uniform_int_distribution<> distribution(0, SPLASHES.size() - 1); + + m_szCurrentSplash = SPLASHES[distribution(engine)]; } void CCompositor::initAllSignals() { @@ -145,6 +171,9 @@ void CCompositor::initAllSignals() { addWLSignal(&m_sWLRCursor->events.button, &Events::listen_mouseButton, m_sWLRCursor, "WLRCursor"); addWLSignal(&m_sWLRCursor->events.axis, &Events::listen_mouseAxis, m_sWLRCursor, "WLRCursor"); addWLSignal(&m_sWLRCursor->events.frame, &Events::listen_mouseFrame, m_sWLRCursor, "WLRCursor"); + addWLSignal(&m_sWLRCursor->events.swipe_begin, &Events::listen_swipeBegin, m_sWLRCursor, "WLRCursor"); + addWLSignal(&m_sWLRCursor->events.swipe_update, &Events::listen_swipeUpdate, m_sWLRCursor, "WLRCursor"); + addWLSignal(&m_sWLRCursor->events.swipe_end, &Events::listen_swipeEnd, m_sWLRCursor, "WLRCursor"); addWLSignal(&m_sWLRBackend->events.new_input, &Events::listen_newInput, m_sWLRBackend, "Backend"); addWLSignal(&m_sSeat.seat->events.request_set_cursor, &Events::listen_requestMouse, &m_sSeat, "Seat"); addWLSignal(&m_sSeat.seat->events.request_set_selection, &Events::listen_requestSetSel, &m_sSeat, "Seat"); @@ -160,12 +189,12 @@ void CCompositor::initAllSignals() { addWLSignal(&m_sWLRXDGDecoMgr->events.new_toplevel_decoration, &Events::listen_NewXDGDeco, m_sWLRXDGDecoMgr, "XDGDecoMgr"); addWLSignal(&m_sWLRVirtPtrMgr->events.new_virtual_pointer, &Events::listen_newVirtPtr, m_sWLRVirtPtrMgr, "VirtPtrMgr"); addWLSignal(&m_sWLRRenderer->events.destroy, &Events::listen_RendererDestroy, m_sWLRRenderer, "WLRRenderer"); - - signal(SIGINT, handleCritSignal); - signal(SIGTERM, handleCritSignal); + addWLSignal(&m_sWLRIdleInhibitMgr->events.new_inhibitor, &Events::listen_newIdleInhibitor, m_sWLRIdleInhibitMgr, "WLRIdleInhibitMgr"); + if (m_sWLRSession) + addWLSignal(&m_sWLRSession->events.active, &Events::listen_sessionActive, m_sWLRSession, "Session"); } -void CCompositor::cleanupExit() { +void CCompositor::cleanup() { if (!m_sWLDisplay) return; @@ -180,8 +209,7 @@ void CCompositor::cleanupExit() { g_pXWaylandManager->m_sWLRXWayland = nullptr; } - wl_display_destroy_clients(m_sWLDisplay); - wl_display_destroy(m_sWLDisplay); + wl_display_terminate(m_sWLDisplay); m_sWLDisplay = nullptr; } @@ -245,7 +273,7 @@ void CCompositor::startCompositor() { if (!m_szWLDisplaySocket) { Debug::log(CRIT, "m_szWLDisplaySocket NULL!"); wlr_backend_destroy(m_sWLRBackend); - RIP("m_szWLDisplaySocket NULL!"); + throw std::runtime_error("m_szWLDisplaySocket was null! (wl_display_add_socket_auto failed)"); } setenv("WAYLAND_DISPLAY", m_szWLDisplaySocket, 1); @@ -258,7 +286,7 @@ void CCompositor::startCompositor() { Debug::log(CRIT, "Backend did not start!"); wlr_backend_destroy(m_sWLRBackend); wl_display_destroy(m_sWLDisplay); - RIP("Backend did not start!"); + throw std::runtime_error("The backend could not start!"); } wlr_xcursor_manager_set_cursor_image(m_sWLRXCursorMgr, "left_ptr", m_sWLRCursor); @@ -361,6 +389,12 @@ CWindow* CCompositor::vectorToWindow(const Vector2D& pos) { const auto PMONITOR = getMonitorFromVector(pos); if (PMONITOR->specialWorkspaceOpen) { + for (auto w = m_vWindows.rbegin(); w != m_vWindows.rend(); w++) { + wlr_box box = {(*w)->m_vRealPosition.vec().x, (*w)->m_vRealPosition.vec().y, (*w)->m_vRealSize.vec().x, (*w)->m_vRealSize.vec().y}; + if ((*w)->m_bIsFloating && (*w)->m_iWorkspaceID == SPECIAL_WORKSPACE_ID && (*w)->m_bIsMapped && wlr_box_contains_point(&box, pos.x, pos.y) && !(*w)->m_bHidden) + return (*w).get(); + } + for (auto& w : m_vWindows) { wlr_box box = {w->m_vRealPosition.vec().x, w->m_vRealPosition.vec().y, w->m_vRealSize.vec().x, w->m_vRealSize.vec().y}; if (w->m_iWorkspaceID == SPECIAL_WORKSPACE_ID && wlr_box_contains_point(&box, pos.x, pos.y) && w->m_bIsMapped && !w->m_bIsFloating && !w->m_bHidden) @@ -404,14 +438,29 @@ CWindow* CCompositor::vectorToWindowTiled(const Vector2D& pos) { return nullptr; } +void findExtensionForVector2D(wlr_surface* surface, int x, int y, void* data) { + const auto DATA = (SExtensionFindingData*)data; + + wlr_box box = {DATA->origin.x + x, DATA->origin.y + y, surface->current.width, surface->current.height}; + + if (wlr_box_contains_point(&box, DATA->vec.x, DATA->vec.y)) + *DATA->found = surface; +} + CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) { const auto PMONITOR = getMonitorFromVector(pos); // special workspace if (PMONITOR->specialWorkspaceOpen) { + for (auto w = m_vWindows.rbegin(); w != m_vWindows.rend(); w++) { + wlr_box box = {(*w)->m_vRealPosition.vec().x, (*w)->m_vRealPosition.vec().y, (*w)->m_vRealSize.vec().x, (*w)->m_vRealSize.vec().y}; + if ((*w)->m_bIsFloating && (*w)->m_iWorkspaceID == SPECIAL_WORKSPACE_ID && (*w)->m_bIsMapped && wlr_box_contains_point(&box, pos.x, pos.y) && !(*w)->m_bHidden && (*w)->m_iX11Type != 2) + return (*w).get(); + } + for (auto& w : m_vWindows) { wlr_box box = {w->m_vPosition.x, w->m_vPosition.y, w->m_vSize.x, w->m_vSize.y}; - if (w->m_iWorkspaceID == SPECIAL_WORKSPACE_ID && w->m_bIsMapped && wlr_box_contains_point(&box, pos.x, pos.y) && !w->m_bHidden) + if (!w->m_bIsFloating && w->m_iWorkspaceID == SPECIAL_WORKSPACE_ID && w->m_bIsMapped && wlr_box_contains_point(&box, pos.x, pos.y) && !w->m_bHidden && w->m_iX11Type != 2) return w.get(); } } @@ -419,13 +468,37 @@ CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) { // first loop over floating cuz they're above, m_lWindows should be sorted bottom->top, for tiled it doesn't matter. for (auto w = m_vWindows.rbegin(); w != m_vWindows.rend(); w++) { wlr_box box = {(*w)->m_vRealPosition.vec().x, (*w)->m_vRealPosition.vec().y, (*w)->m_vRealSize.vec().x, (*w)->m_vRealSize.vec().y}; - if ((*w)->m_bIsFloating && (*w)->m_bIsMapped && wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && isWorkspaceVisible((*w)->m_iWorkspaceID) && !(*w)->m_bHidden) - return w->get(); + if ((*w)->m_bIsFloating && (*w)->m_bIsMapped && isWorkspaceVisible((*w)->m_iWorkspaceID) && !(*w)->m_bHidden && (*w)->m_iX11Type != 2) { + if (wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y)) + return w->get(); + + if (!(*w)->m_bIsX11) { + wlr_surface* resultSurf = nullptr; + Vector2D origin =(*w)->m_vRealPosition.vec(); + SExtensionFindingData data = {origin, pos, &resultSurf}; + wlr_xdg_surface_for_each_popup_surface((*w)->m_uSurface.xdg, findExtensionForVector2D, &data); + + if (resultSurf) + return w->get(); + } + } } + // for windows, we need to check their extensions too, first. + for (auto& w : m_vWindows) { + if (!w->m_bIsX11 && !w->m_bIsFloating && w->m_bIsMapped && w->m_iWorkspaceID == PMONITOR->activeWorkspace && !w->m_bHidden && w->m_iX11Type != 2) { + wlr_surface* resultSurf = nullptr; + Vector2D origin = w->m_vRealPosition.vec(); + SExtensionFindingData data = {origin, pos, &resultSurf}; + wlr_xdg_surface_for_each_popup_surface(w->m_uSurface.xdg, findExtensionForVector2D, &data); + + if (resultSurf) + return w.get(); + } + } for (auto& w : m_vWindows) { wlr_box box = {w->m_vPosition.x, w->m_vPosition.y, w->m_vSize.x, w->m_vSize.y}; - if (!w->m_bIsFloating && w->m_bIsMapped && wlr_box_contains_point(&box, pos.x, pos.y) && w->m_iWorkspaceID == PMONITOR->activeWorkspace && !w->m_bHidden) + if (!w->m_bIsFloating && w->m_bIsMapped && wlr_box_contains_point(&box, pos.x, pos.y) && w->m_iWorkspaceID == PMONITOR->activeWorkspace && !w->m_bHidden && w->m_iX11Type != 2) return w.get(); } @@ -436,6 +509,12 @@ CWindow* CCompositor::windowFromCursor() { const auto PMONITOR = getMonitorFromCursor(); if (PMONITOR->specialWorkspaceOpen) { + for (auto w = m_vWindows.rbegin(); w != m_vWindows.rend(); w++) { + wlr_box box = {(*w)->m_vRealPosition.vec().x, (*w)->m_vRealPosition.vec().y, (*w)->m_vRealSize.vec().x, (*w)->m_vRealSize.vec().y}; + if ((*w)->m_bIsFloating && (*w)->m_iWorkspaceID == SPECIAL_WORKSPACE_ID && (*w)->m_bIsMapped && wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && !(*w)->m_bHidden) + return (*w).get(); + } + for (auto& w : m_vWindows) { wlr_box box = {w->m_vPosition.x, w->m_vPosition.y, w->m_vSize.x, w->m_vSize.y}; if (w->m_iWorkspaceID == SPECIAL_WORKSPACE_ID && wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && w->m_bIsMapped) @@ -536,7 +615,7 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { // we need to make the PLASTWINDOW not equal to m_pLastWindow so that RENDERDATA is correct for an unfocused window if (windowValidMapped(PLASTWINDOW)) { - updateWindowBorderColor(PLASTWINDOW); + updateWindowAnimatedDecorationValues(PLASTWINDOW); if (PLASTWINDOW->m_bIsX11) { wlr_seat_keyboard_notify_clear_focus(m_sSeat.seat); @@ -559,7 +638,7 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { const auto POINTERLOCAL = g_pInputManager->getMouseCoordsInternal() - pWindow->m_vRealPosition.goalv(); wlr_seat_pointer_notify_enter(m_sSeat.seat, PWINDOWSURFACE, POINTERLOCAL.x, POINTERLOCAL.y); - updateWindowBorderColor(pWindow); + updateWindowAnimatedDecorationValues(pWindow); // Send an event g_pEventManager->postEvent(SHyprIPCEvent("activewindow", g_pXWaylandManager->getAppIDClass(pWindow) + "," + pWindow->m_szTitle)); @@ -573,12 +652,16 @@ void CCompositor::focusSurface(wlr_surface* pSurface, CWindow* pWindowOwner) { if (m_sSeat.seat->keyboard_state.focused_surface == pSurface || (pWindowOwner && m_sSeat.seat->keyboard_state.focused_surface == g_pXWaylandManager->getWindowSurface(pWindowOwner))) return; // Don't focus when already focused on this. - if (!pSurface) - return; - // Unfocus last surface if should - if (m_pLastFocus && m_sSeat.seat->keyboard_state.focused_surface && wlr_surface_is_xdg_surface(m_pLastFocus)) - wlr_xdg_toplevel_set_activated(wlr_xdg_surface_from_wlr_surface(m_pLastFocus)->toplevel, false); + if (m_pLastFocus && ((m_sSeat.seat->keyboard_state.focused_surface && wlr_surface_is_xdg_surface(m_pLastFocus)) || !pSurface)) + g_pXWaylandManager->activateSurface(m_pLastFocus, false); + + if (!pSurface) { + wlr_seat_keyboard_clear_focus(m_sSeat.seat); + g_pEventManager->postEvent(SHyprIPCEvent("activewindow", ",")); // unfocused + return; + } + const auto KEYBOARD = wlr_seat_get_keyboard(m_sSeat.seat); @@ -598,6 +681,9 @@ void CCompositor::focusSurface(wlr_surface* pSurface, CWindow* pWindowOwner) { Debug::log(LOG, "Set keyboard focus to surface %x, with window name: %s", pSurface, pWindowOwner->m_szTitle.c_str()); else Debug::log(LOG, "Set keyboard focus to surface %x", pSurface); + + g_pXWaylandManager->activateSurface(pSurface, false); + m_pLastFocus = pSurface; } bool CCompositor::windowValidMapped(CWindow* pWindow) { @@ -689,6 +775,8 @@ void CCompositor::sanityCheckWorkspaces() { if (it == m_vWorkspaces.end()) break; + + continue; } if ((*it)->m_iID == SPECIAL_WORKSPACE_ID && WINDOWSONWORKSPACE == 0) { @@ -700,6 +788,8 @@ void CCompositor::sanityCheckWorkspaces() { if (it == m_vWorkspaces.end()) break; + + continue; } } } @@ -773,9 +863,12 @@ void CCompositor::moveWindowToTop(CWindow* pWindow) { } } -void CCompositor::cleanupFadingOut() { +void CCompositor::cleanupFadingOut(const int& monid) { for (auto& w : m_vWindowsFadingOut) { + if (w->m_iMonitorID != (long unsigned int)monid) + continue; + bool valid = windowExists(w); if (!valid || !w->m_bFadingOut || w->m_fAlpha.fl() == 0.f) { @@ -788,11 +881,16 @@ void CCompositor::cleanupFadingOut() { m_vWindowsFadingOut.erase(std::remove(m_vWindowsFadingOut.begin(), m_vWindowsFadingOut.end(), w)); Debug::log(LOG, "Cleanup: destroyed a window"); + + glFlush(); // to free mem NOW. return; } } for (auto& ls : m_vSurfacesFadingOut) { + if (ls->monitorID != monid) + continue; + if (ls->fadingOut && ls->readyToDelete && !ls->alpha.isBeingAnimated()) { for (auto& m : m_vMonitors) { for (auto& lsl : m->m_aLayerSurfaceLists) { @@ -808,6 +906,7 @@ void CCompositor::cleanupFadingOut() { Debug::log(LOG, "Cleanup: destroyed a layersurface"); + glFlush(); // to free mem NOW. return; } } @@ -910,6 +1009,29 @@ CWindow* CCompositor::getNextWindowOnWorkspace(CWindow* pWindow) { return nullptr; } +CWindow* CCompositor::getPrevWindowOnWorkspace(CWindow* pWindow) { + bool gotToWindow = false; + for (auto it = m_vWindows.rbegin(); it != m_vWindows.rend(); it++) { + if (it->get() != pWindow && !gotToWindow) + continue; + + if (it->get() == pWindow) { + gotToWindow = true; + continue; + } + + if ((*it)->m_iWorkspaceID == pWindow->m_iWorkspaceID && (*it)->m_bIsMapped && !(*it)->m_bHidden) + return it->get(); + } + + for (auto it = m_vWindows.rbegin(); it != m_vWindows.rend(); it++) { + if (it->get() != pWindow && (*it)->m_iWorkspaceID == pWindow->m_iWorkspaceID && (*it)->m_bIsMapped && !(*it)->m_bHidden) + return it->get(); + } + + return nullptr; +} + int CCompositor::getNextAvailableNamedWorkspace() { int lowest = -1337 + 1; for (auto& w : m_vWorkspaces) { @@ -1032,25 +1154,50 @@ SMonitor* CCompositor::getMonitorInDirection(const char& dir) { return nullptr; } -void CCompositor::updateAllWindowsBorders() { +void CCompositor::updateAllWindowsAnimatedDecorationValues() { for (auto& w : m_vWindows) { if (!w->m_bIsMapped) continue; - updateWindowBorderColor(w.get()); + updateWindowAnimatedDecorationValues(w.get()); } } -void CCompositor::updateWindowBorderColor(CWindow* pWindow) { +void CCompositor::updateWindowAnimatedDecorationValues(CWindow* pWindow) { // optimization static int64_t* ACTIVECOL = &g_pConfigManager->getConfigValuePtr("general:col.active_border")->intValue; static int64_t* INACTIVECOL = &g_pConfigManager->getConfigValuePtr("general:col.inactive_border")->intValue; + static auto *const PINACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:inactive_opacity")->floatValue; + static auto *const PACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:active_opacity")->floatValue; + static auto *const PFULLSCREENALPHA = &g_pConfigManager->getConfigValuePtr("decoration:fullscreen_opacity")->floatValue; + + // border const auto RENDERDATA = g_pLayoutManager->getCurrentLayout()->requestRenderHints(pWindow); if (RENDERDATA.isBorderColor) pWindow->m_cRealBorderColor = RENDERDATA.borderColor; else pWindow->m_cRealBorderColor = CColor(pWindow == m_pLastWindow ? *ACTIVECOL : *INACTIVECOL); + + + // opacity + if (pWindow->m_bIsFullscreen) { + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); + + if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) + pWindow->m_fActiveInactiveAlpha = *PFULLSCREENALPHA; + else { + if (pWindow == m_pLastWindow) + pWindow->m_fActiveInactiveAlpha = pWindow->m_sSpecialRenderData.alpha * *PACTIVEALPHA; + else + pWindow->m_fActiveInactiveAlpha = pWindow->m_sSpecialRenderData.alphaInactive != -1 ? pWindow->m_sSpecialRenderData.alphaInactive * *PINACTIVEALPHA : *PINACTIVEALPHA; + } + } else { + if (pWindow == m_pLastWindow) + pWindow->m_fActiveInactiveAlpha = pWindow->m_sSpecialRenderData.alpha * *PACTIVEALPHA; + else + pWindow->m_fActiveInactiveAlpha = pWindow->m_sSpecialRenderData.alphaInactive != -1 ? pWindow->m_sSpecialRenderData.alphaInactive * *PINACTIVEALPHA : *PINACTIVEALPHA; + } } void CCompositor::moveWindowToWorkspace(CWindow* pWindow, const std::string& work) { @@ -1188,4 +1335,20 @@ CWindow* CCompositor::getX11Parent(CWindow* pWindow) { } return nullptr; +} + +void CCompositor::updateWorkspaceWindowDecos(const int& id) { + for (auto& w : m_vWindows) { + if (w->m_iWorkspaceID != id) + continue; + + w->updateWindowDecos(); + } +} + +void CCompositor::scheduleFrameForMonitor(SMonitor* pMonitor) { + if ((m_sWLRSession && !m_sWLRSession->active) || !m_bSessionActive) + return; + + wlr_output_schedule_frame(pMonitor->output); }
\ No newline at end of file |
