diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-10 15:41:26 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-10 15:41:26 +0200 |
| commit | 4b334594dc0d8989d8bb09c7db76694aacc71951 (patch) | |
| tree | 9b5fcedc0470209959cd6553b95d9632883f82de /src/Compositor.cpp | |
| parent | 06c0be5ea6e3ed6b7fe7a45a550d42bc646ad6db (diff) | |
Added splashes
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 906946c8..d4899280 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1,4 +1,6 @@ #include "Compositor.hpp" +#include "helpers/Splashes.hpp" +#include <random> CCompositor::CCompositor() { m_szInstanceSignature = GIT_COMMIT_HASH + std::string("_") + std::to_string(time(NULL)); @@ -22,6 +24,10 @@ 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_sWLRBackend = wlr_backend_autocreate(m_sWLDisplay); @@ -136,6 +142,14 @@ void handleCritSignal(int signo) { 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() { addWLSignal(&m_sWLRBackend->events.new_output, &Events::listen_newOutput, m_sWLRBackend, "Backend"); addWLSignal(&m_sWLRXDGShell->events.new_surface, &Events::listen_newXDGSurface, m_sWLRXDGShell, "XDG Shell"); |
