it now actually runs lol

This commit is contained in:
vaxerski 2022-03-17 17:08:54 +01:00
parent d6c2553af2
commit a4ef84d987
4 changed files with 22 additions and 10 deletions

View file

@ -40,7 +40,7 @@ CCompositor::CCompositor() {
m_sWLRXDGActivation - wlr_xdg_activation_v1_create(m_sWLDisplay); m_sWLRXDGActivation - wlr_xdg_activation_v1_create(m_sWLDisplay);
m_sWLROutputLayout = wlr_output_layout_create(); m_sWLROutputLayout = wlr_output_layout_create();
wl_signal_add(&m_sWLRXDGActivation->events.request_activate, &Events::listen_activate); // wl_signal_add(&m_sWLRXDGActivation->events.request_activate, &Events::listen_activate);
wl_signal_add(&m_sWLROutputLayout->events.change, &Events::listen_change); wl_signal_add(&m_sWLROutputLayout->events.change, &Events::listen_change);
wl_signal_add(&m_sWLRBackend->events.new_output, &Events::listen_newOutput); wl_signal_add(&m_sWLRBackend->events.new_output, &Events::listen_newOutput);
@ -88,6 +88,21 @@ CCompositor::~CCompositor() {
} }
void CCompositor::startCompositor() { void CCompositor::startCompositor() {
// Init all the managers BEFORE we start with the wayland server so that ALL of the stuff is initialized
// properly and we dont get any bad mem reads.
//
Debug::log(LOG, "Creating the config manager!");
g_pConfigManager = std::make_unique<CConfigManager>();
Debug::log(LOG, "Creating the ManagerThread!");
g_pManagerThread = std::make_unique<CManagerThread>();
Debug::log(LOG, "Creating the InputManager!");
g_pInputManager = std::make_unique<CInputManager>();
//
//
m_szWLDisplaySocket = wl_display_add_socket_auto(m_sWLDisplay); m_szWLDisplaySocket = wl_display_add_socket_auto(m_sWLDisplay);
if (!m_szWLDisplaySocket) { if (!m_szWLDisplaySocket) {
@ -108,15 +123,6 @@ void CCompositor::startCompositor() {
wlr_xcursor_manager_set_cursor_image(m_sWLRXCursorMgr, "left_ptr", m_sWLRCursor); wlr_xcursor_manager_set_cursor_image(m_sWLRXCursorMgr, "left_ptr", m_sWLRCursor);
Debug::log(LOG, "Creating the config manager!");
g_pConfigManager = std::make_unique<CConfigManager>();
Debug::log(LOG, "Creating the ManagerThread!");
g_pManagerThread = std::make_unique<CManagerThread>();
Debug::log(LOG, "Creating the InputManager!");
g_pInputManager = std::make_unique<CInputManager>();
// This blocks until we are done. // This blocks until we are done.
Debug::log(LOG, "Hyprland is ready, running the event loop!"); Debug::log(LOG, "Hyprland is ready, running the event loop!");
wl_display_run(m_sWLDisplay); wl_display_run(m_sWLDisplay);

View file

@ -14,6 +14,9 @@ CManagerThread::~CManagerThread() {
} }
void CManagerThread::handle() { void CManagerThread::handle() {
g_pConfigManager->init();
while (3.1415f) { while (3.1415f) {
g_pConfigManager->tick(); g_pConfigManager->tick();

View file

@ -15,7 +15,9 @@ CConfigManager::CConfigManager() {
configValues["general:border_size"].intValue = 1; configValues["general:border_size"].intValue = 1;
configValues["general:gaps_in"].intValue = 5; configValues["general:gaps_in"].intValue = 5;
configValues["general:gaps_out"].intValue = 20; configValues["general:gaps_out"].intValue = 20;
}
void CConfigManager::init() {
loadConfigLoadVars(); loadConfigLoadVars();
isFirstLaunch = false; isFirstLaunch = false;

View file

@ -26,6 +26,7 @@ public:
CConfigManager(); CConfigManager();
void tick(); void tick();
void init();
int getInt(std::string); int getInt(std::string);
float getFloat(std::string); float getFloat(std::string);