Skip to content

Commit

Permalink
mac do not touch main thread dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
VelorumS committed Apr 9, 2017
1 parent 2ad89bd commit d577f56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libopenage/gui/guisys/private/gui_application_impl.cpp
Expand Up @@ -26,7 +26,9 @@ GuiApplicationImpl::~GuiApplicationImpl() {

void GuiApplicationImpl::processEvents() {
assert(std::this_thread::get_id() == this->owner);
#ifndef __APPLE__
this->app.processEvents();
#endif
}

namespace {
Expand Down
9 changes: 9 additions & 0 deletions libopenage/gui/guisys/private/gui_event_queue_impl.cpp
Expand Up @@ -6,6 +6,10 @@

#include <QThread>

#ifdef __APPLE__
#include <QCoreApplication>
#endif

#include "../public/gui_event_queue.h"

namespace qtsdl {
Expand All @@ -24,7 +28,12 @@ GuiEventQueueImpl* GuiEventQueueImpl::impl(GuiEventQueue *event_queue) {

void GuiEventQueueImpl::process_callbacks() {
assert(QThread::currentThread() == this->thread);
#ifdef __APPLE__
if (QThread::currentThread() != QCoreApplication::instance()->thread())
this->callback_processor.processEvents();
#else
this->callback_processor.processEvents();
#endif
}

QThread* GuiEventQueueImpl::get_thread() {
Expand Down

0 comments on commit d577f56

Please sign in to comment.