summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp14
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");