diff --git a/widget/src/os2/nsAppShell.cpp b/widget/src/os2/nsAppShell.cpp index 24ea6a9d898..835de50fab2 100644 --- a/widget/src/os2/nsAppShell.cpp +++ b/widget/src/os2/nsAppShell.cpp @@ -69,6 +69,19 @@ nsAppShell::~nsAppShell() nsresult nsAppShell::Init() { + // a message queue is required to create a window but + // it is not necessarily created yet + if (WinQueryQueueInfo(HMQ_CURRENT, NULL, 0) == FALSE) { + // Set our app to be a PM app before attempting Win calls + PPIB ppib; + PTIB ptib; + DosGetInfoBlocks(&ptib, &ppib); + ppib->pib_ultype = 3; + + HAB hab = WinInitialize(0); + WinCreateMsgQueue(hab, 0); + } + if (!sMsgId) { sMsgId = WinAddAtom( WinQuerySystemAtomTable(), "nsAppShell:EventID"); WinRegisterClass((HAB)0, "nsAppShell:EventWindowClass", EventWindowProc, NULL, 0); diff --git a/widget/src/os2/nsAppShell.h b/widget/src/os2/nsAppShell.h index f9a7aa1149b..5b0e39bcbd9 100644 --- a/widget/src/os2/nsAppShell.h +++ b/widget/src/os2/nsAppShell.h @@ -41,6 +41,7 @@ #include "nsBaseAppShell.h" #define INCL_DEV #define INCL_WIN +#define INCL_DOS #include /**