diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-16 17:56:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-16 17:56:25 +0100 |
| commit | 4cce7f60a9c8772d18ffb43cb74aa227ab4b3bc4 (patch) | |
| tree | 855b7ae720b92a79facd020b178cc233baf97a1b /src/Compositor.cpp | |
| parent | ff459f4a2af01e3c99ededc827b6a3edbda55965 (diff) | |
notifications: move and small refactor (#14094)
moves to notification/, and adds a new style manager getter.
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index d40f3ce8..87748109 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -73,7 +73,7 @@ #include "render/AsyncResourceGatherer.hpp" #include "plugins/PluginSystem.hpp" #include "hyprerror/HyprError.hpp" -#include "debug/HyprNotificationOverlay.hpp" +#include "notification/NotificationOverlay.hpp" #include "debug/HyprDebugOverlay.hpp" #include "helpers/MonitorFrameScheduler.hpp" #include "i18n/Engine.hpp" @@ -590,7 +590,7 @@ void CCompositor::cleanup() { g_pDecorationPositioner.reset(); g_pCursorManager.reset(); g_pPluginSystem.reset(); - g_pHyprNotificationOverlay.reset(); + Notification::overlay().reset(); g_pDebugOverlay.reset(); g_pEventManager.reset(); g_pSessionLockManager.reset(); @@ -697,8 +697,8 @@ void CCompositor::initManagers(eManagersInitStage stage) { Log::logger->log(Log::DEBUG, "Creating the HyprDebugOverlay!"); g_pDebugOverlay = makeUnique<CHyprDebugOverlay>(); - Log::logger->log(Log::DEBUG, "Creating the HyprNotificationOverlay!"); - g_pHyprNotificationOverlay = makeUnique<CHyprNotificationOverlay>(); + Log::logger->log(Log::DEBUG, "Creating the NotificationOverlay!"); + Notification::overlay(); Log::logger->log(Log::DEBUG, "Creating the PluginSystem!"); g_pPluginSystem = makeUnique<CPluginSystem>(); @@ -2573,7 +2573,7 @@ void CCompositor::performUserChecks() { if (!*PNOCHECKXDG) { const auto CURRENT_DESKTOP_ENV = getenv("XDG_CURRENT_DESKTOP"); if (!CURRENT_DESKTOP_ENV || std::string{CURRENT_DESKTOP_ENV} != "Hyprland") { - g_pHyprNotificationOverlay->addNotification( + Notification::overlay()->addNotification( I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_EXTERNAL_XDG_DESKTOP, {{"value", CURRENT_DESKTOP_ENV ? CURRENT_DESKTOP_ENV : "unset"}}), CHyprColor{}, 15000, ICON_WARNING); } @@ -2581,16 +2581,16 @@ void CCompositor::performUserChecks() { if (!*PNOCHECKGUIUTILS) { if (!NFsUtils::executableExistsInPath("hyprland-dialog")) - g_pHyprNotificationOverlay->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_NO_GUIUTILS), CHyprColor{}, 15000, ICON_WARNING); + Notification::overlay()->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_NO_GUIUTILS), CHyprColor{}, 15000, ICON_WARNING); } if (g_pHyprRenderer->m_failedAssetsNo > 0) { - g_pHyprNotificationOverlay->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_FAILED_ASSETS, {{"count", std::to_string(g_pHyprRenderer->m_failedAssetsNo)}}), - CHyprColor{1.0, 0.1, 0.1, 1.0}, 15000, ICON_ERROR); + Notification::overlay()->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_FAILED_ASSETS, {{"count", std::to_string(g_pHyprRenderer->m_failedAssetsNo)}}), + CHyprColor{1.0, 0.1, 0.1, 1.0}, 15000, ICON_ERROR); } if (!m_watchdogWriteFd.isValid() && !*PNOWATCHDOG) - g_pHyprNotificationOverlay->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_NO_WATCHDOG), CHyprColor{1.0, 0.1, 0.1, 1.0}, 15000, ICON_WARNING); + Notification::overlay()->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_NO_WATCHDOG), CHyprColor{1.0, 0.1, 0.1, 1.0}, 15000, ICON_WARNING); if (m_safeMode) openSafeModeBox(); @@ -2730,8 +2730,8 @@ void CCompositor::checkMonitorOverlaps() { for (const auto& m : m_monitors) { if (!monitorRegion.copy().intersect(m->logicalBox()).empty()) { Log::logger->log(Log::ERR, "Monitor {}: detected overlap with layout", m->m_name); - g_pHyprNotificationOverlay->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_INVALID_MONITOR_LAYOUT, {{"name", m->m_name}}), CHyprColor{}, 15000, - ICON_WARNING); + Notification::overlay()->addNotification(I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_INVALID_MONITOR_LAYOUT, {{"name", m->m_name}}), CHyprColor{}, 15000, + ICON_WARNING); break; } |
