diff --git a/src/application.cpp b/src/application.cpp index f29fbb837..8f6338e04 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -36,6 +36,8 @@ Application::Application() // XXX singletons::SettingManager::getInstance().updateWordTypeMask(); + + singletons::NativeMessagingManager::getInstance().openGuiMessageQueue(); } Application::~Application() diff --git a/src/singletons/nativemessagingmanager.cpp b/src/singletons/nativemessagingmanager.cpp index 53a1c8b79..742e306c5 100644 --- a/src/singletons/nativemessagingmanager.cpp +++ b/src/singletons/nativemessagingmanager.cpp @@ -8,7 +8,9 @@ #include #include +#ifdef BOOSTLIBS #include +#endif #ifdef Q_OS_WIN #include @@ -79,6 +81,7 @@ void NativeMessagingManager::registerHost() void NativeMessagingManager::openGuiMessageQueue() { +#ifdef BOOSTLIBS static ReceiverThread thread; if (thread.isRunning()) { @@ -86,13 +89,14 @@ void NativeMessagingManager::openGuiMessageQueue() } thread.start(); +#endif } void NativeMessagingManager::sendToGuiProcess(const QByteArray &array) { #ifdef BOOSTLIBS writeByteArray("{\"b\": 1}"); - ipc::message_queue messageQueue(ipc::open_only, "chatterino_gui"); + ipc::message_queue messageQueue(ipc::open_or_create, "chatterino_gui", 100, MESSAGE_SIZE); writeByteArray("{\"b\": 2}"); try { @@ -108,7 +112,7 @@ void NativeMessagingManager::ReceiverThread::run() #ifdef BOOSTLIBS ipc::message_queue::remove("chatterino_gui"); - ipc::message_queue messageQueue(ipc::create_only, "chatterino_gui", 100, MESSAGE_SIZE); + ipc::message_queue messageQueue(ipc::open_or_create, "chatterino_gui", 100, MESSAGE_SIZE); while (true) { try {