diff --git a/widget/src/qt/nsAppShell.cpp b/widget/src/qt/nsAppShell.cpp index 84f1665f1f80..253d5a4cf742 100644 --- a/widget/src/qt/nsAppShell.cpp +++ b/widget/src/qt/nsAppShell.cpp @@ -56,11 +56,7 @@ PRLogModuleInfo *gWidgetIMLog = nsnull; PRLogModuleInfo *gWidgetDrawLog = nsnull; #endif -void nsAppShell::EventNativeCallback() -{ - NativeEventCallback(); - return; -} +static int sPokeEvent; nsAppShell::~nsAppShell() { @@ -80,14 +76,16 @@ nsAppShell::Init() gWidgetDrawLog = PR_NewLogModule("WidgetDraw"); #endif - connect (this, SIGNAL(activated()), SLOT(EventNativeCallback())); + sPokeEvent = QEvent::registerEventType(); + return nsBaseAppShell::Init(); } void nsAppShell::ScheduleNativeEventCallback() { - emit activated(); + QCoreApplication::postEvent(this, + new QEvent((QEvent::Type) sPokeEvent)); } PRBool @@ -101,3 +99,14 @@ nsAppShell::ProcessNextNativeEvent(PRBool mayWait) qApp->processEvents(flags); return PR_TRUE; } + +bool +nsAppShell::event (QEvent *e) +{ + if (e->type() == sPokeEvent) { + NativeEventCallback(); + return true; + } + + return false; +} diff --git a/widget/src/qt/nsAppShell.h b/widget/src/qt/nsAppShell.h index 49bf3cb2946e..29ecf81d0b91 100644 --- a/widget/src/qt/nsAppShell.h +++ b/widget/src/qt/nsAppShell.h @@ -58,11 +58,7 @@ public: nsresult Init(); -signals: - void activated(); - -private slots: - void EventNativeCallback(); + virtual bool event (QEvent *e); protected: virtual void ScheduleNativeEventCallback();