From 614348b081fb606d2e2f5b9109507a443135d69b Mon Sep 17 00:00:00 2001 From: "Jerry.Kirk%Nexwarecorp.com" Date: Mon, 18 Oct 1999 19:34:07 +0000 Subject: [PATCH] Installed our own PtMainLoop() function that can be exited to allow the Create Profile Manager to display a dialog, then exit the GUI and display a different dialog. Bug# 16667 r=Michael.Kedl@Nexwarecorp.com git-svn-id: svn://10.0.0.236/trunk@51009 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/photon/nsAppShell.cpp | 37 +++++++++++++++++------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/mozilla/widget/src/photon/nsAppShell.cpp b/mozilla/widget/src/photon/nsAppShell.cpp index 0573d186760..2a568d51614 100644 --- a/mozilla/widget/src/photon/nsAppShell.cpp +++ b/mozilla/widget/src/photon/nsAppShell.cpp @@ -354,6 +354,19 @@ PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::PopThreadEventQueue\n")); } +int done_damn_it = 0; +void MyMainLoop( void ) +{ +// printf ("kedl: start main loop!\n"); fflush(stdout); + done_damn_it = 0; + while (! done_damn_it) + { +// printf ("kedl: process event\n"); fflush(stdout); + PtProcessEvent(); +// printf ("kedl: processed event\n"); fflush(stdout); + } +} + //------------------------------------------------------------------------- // // Run @@ -396,7 +409,6 @@ NS_IMETHODIMP nsAppShell::Run() return rv; } - done: #ifdef DEBUG @@ -410,8 +422,18 @@ done: printf("nsAppShell::Run Error calling PtAppAddFd\n"); exit(1); } - PtMainLoop(); + MyMainLoop(); +#ifdef DEBUG + printf("Calling PtAppRemoveFd with event queue\n"); +#endif /* DEBUG */ + + err=PtAppRemoveFd(NULL,EQueue->GetEventQueueSelectFD()); + if (err==-1) + { + printf ("nsAppShell:: Run Error calling PtAppRemoveFd\n"); + } + NS_IF_RELEASE(EQueue); Release(); return NS_OK; @@ -425,14 +447,9 @@ done: NS_METHOD nsAppShell::Exit() { - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::Exit - Not Implemented.\n")); - - // REVISIT - How do we do this under Photon??? - // PtSendEventToWidget( m_window, quit_event ); - - /* kirk: Hack until we figure out what to do here */ - /* No way to exit the Graphical portion without a raw EXIT */ - exit ( EXIT_SUCCESS ); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::Exit.\n")); +// printf ("kedl: TRY to exit main loop!\n"); fflush (stdout); + done_damn_it = 1; return NS_OK; }