This patch implements an on-demand console window and enables OS/2 users to use the -help and -version commandline parameters. It adds a new function, StartOS2App() which examines the commandline, and if needed, restarts the app in a VIO session. The function is intended to be called from xre_main() as early in the startup processing as possible - in particular, before any other commandline handling. The patch also makes minor changes to xre_main and sNativeAppSupportOS2::Start. It incorporates some of the OS/2 startup code in xre_main as well as a few lines from Start. It also modifies Start to remove -console and -dde from the commandline arguments. Without this change, a URL immediately following these args would be ignored. For lack of a better idea, I've added StartOS2App() to the end of nsNativeAppSupportOS2 and placed its prototype in xre_main immediately preceding the call to this function. FYI... I will submit an xpfe version of this patch in the near future.
My c is really rusty but as I read the code I couldn't use both -dde and -console, is this correct or am I misreading the code?
Sorry, I read through the code once again and I think I was just misreading it.
Created attachment 174891 [details] [diff] [review] updated patch to implement console window minor update: adds '-console' to the commandline options displayed by -help
Comment on attachment 174891 [details] [diff] [review] updated patch to implement console window sweet r=mkaply although your parenthesis style drives me crazy!
(In reply to comment #5) > > although your parenthesis style drives me crazy! Which of the 6 different coding styles in ...AppSupportOS2 is yours? Are you the "don't let 'em touch" guy, e.g. if ([space]something[space])? Please advise and I will reformat accordingly (n.b. this offer does not extend to putting braces around single lines - $#@%&!!).
No big deal. I'm just messing with you. I general prefer: PRBool StartOS2App(int aArgc, char **aArgv); if (StartOS2App(gArgc, gArgv)) return 1; to PRBool StartOS2App( int aArgc, char **aArgv); if (StartOS2App( gArgc, gArgv)) return 1; And yes, I know the argument about easily skipping around in an editor. The truth be known, I don't even know what the keystroke in EPM is to go word by word - I just go a character at a time :)
One more question on this. I'm not sure on the naming. StartOS2App returns true if we are not going to start the app, but restart. Should be maybe call it something different?
Created attachment 175521 [details] [diff] [review] updated patch per Comment #8 Per Comment #8 - I've left the name as-is but reversed the sense of the return: TRUE if the app should start, FALSE if it should terminate. Also, per earlier comments, I've reformatted parenthesized expressions so as to render Ctrl-Right substantially useless...
Created attachment 175794 [details] [diff] [review] fixes bug in HandleCommandLine() New code removes "-console" & "-dde" from commandline passed to a running instance. Without this, any URL following these args would be ignored.
03-04-2005 09:04:07 SYS3183 PID 0069 TID 0001 Slot 00dc E:\BROWSERS\FIREFOX\FIREFOX.EXE c000009a 12055653 EAX=00400000 EBX=00d4d6a0 ECX=009cf1a0 EDX=3ff02750 ESI=00000000 EDI=0000041e DS=0053 DSACC=f0f3 DSLIM=ffffffff ES=0053 ESACC=f0f3 ESLIM=ffffffff FS=150b FSACC=00f3 FSLIM=00000030 GS=0000 GSACC=**** GSLIM=******** CS:EIP=005b:12055653 CSACC=f0df CSLIM=ffffffff SS:ESP=0053:009cf120 SSACC=f0f3 SSLIM=ffffffff EBP=009cf1b8 FLG=00002206 MOZJS.DLL 0001:00015653 when I use firefox!l.exe -help but it still displays the help. Hadn't built with the xpfe changes yet. -console and -version work fine, no popuplog.os2 entries. Andy
Fix checked in - r=mkaply, sr=blizzard (platform specific)