bugGNU Octave - Bugs: bug #41074, MinGW: avoid showing terminal...

 
 

bug #41074: MinGW: avoid showing terminal window while GUI is loading

Submitter:  Felipe G. Nievinski <fgnievinski>
Submitted:  Fri 03 Jan 2014 03:35:33 AM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  lostbard
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 04 Mar 2015 08:44:47 PM UTC, comment #34: 

Nah, I think the dubious distinction of most comments goes to bug #41699.  The comment count is now at 87, and still not resolved.

Rik <rik5>
Group administrator
Wed 04 Mar 2015 07:29:24 PM UTC, comment #33: 

Does this bug report have more comments than any other?

John W. Eaton <jwe>
Group administrator
Wed 04 Mar 2015 05:51:55 PM UTC, comment #32: 

Patches verified.  Closing report (finally).

Rik <rik5>
Group administrator
Tue 03 Mar 2015 05:56:10 PM UTC, comment #31: 
John Donoghue <lostbard>
Group Member
Mon 02 Mar 2015 08:05:55 PM UTC, comment #30: 

Success!

I used the new welcome wizard patch and re-built octave, then did 'make dist', and finally took the tarball over to MXE and built the nsis-installer.

After installation on the Windows side I added the octave.vbs script which can replace octave.bat to the bin directory of the Octave installation.  Finally, I changed the shortcut on the desktop to point to octave.vbs rather than octave.bat.

Upon launching no cmd window appears, nor is there a minimized window in the task bar, until the Octave GUI appears.  This is perfect.  And I deleted the octave directory under .config/ and re-ran and the Welcome Wizard is correctly displayed.

Please go ahead and commit the pieces when you can.

Rik <rik5>
Group administrator
Mon 02 Mar 2015 06:10:11 PM UTC, comment #29: 

HACK attached to force display of welcome wizard (when needed) in win32.


(file #33226)

John Donoghue <lostbard>
Group Member
Fri 27 Feb 2015 02:45:44 AM UTC, comment #28: 

Can anyone else running win7 verify seeing the same thing?

John Donoghue <lostbard>
Group Member
Fri 27 Feb 2015 02:26:05 AM UTC, comment #27: 

Weirdly, the script has suddenly started flashing the terminal window again, even when running from the original  script from comment 14.

John Donoghue <lostbard>
Group Member
Fri 27 Feb 2015 12:51:21 AM UTC, comment #26: 

I believe this bug was the reason: http://savannah.gnu.org/bugs/?40689

John Donoghue <lostbard>
Group Member
Fri 27 Feb 2015 12:19:33 AM UTC, comment #25: 

From memory, running octave.exe doesn't work in windows so had to be run as octave-gui.


John Donoghue <lostbard>
Group Member
Fri 27 Feb 2015 12:00:30 AM UTC, comment #24: 

John,

What is the benefit of having octave-gui --no-gui?
Do we really need so many flavors? Will plain
octave --no-gui with qt available be enough for
CLI users? And just octave for GUI folks?

Michael

Michael Godfrey <godfrey>
Group Member
Thu 26 Feb 2015 11:55:23 PM UTC, comment #23: 

John,

With the patch 81dbeb22a28f the current system
runs qt with --no-gui. print 'xxx.pdf' works,
but using the save menu item still does not
(minor issue).

This patch should probably be reviewed, but it
works for me.

Michael

Michael Godfrey <godfrey>
Group Member
Thu 26 Feb 2015 11:14:18 PM UTC, comment #22: 

update: My octave.vbs works except for the case of where the config/startup window would be displayed - at that point it started octave, but never shows anything

John Donoghue <lostbard>
Group Member
Thu 26 Feb 2015 10:52:32 PM UTC, comment #21: 

It might lead to 3 different desktop shortcuts, but I don't see a problem in doing that.

Rik <rik5>
Group administrator
Thu 26 Feb 2015 10:23:42 PM UTC, comment #20: 

If we patch Octave so that plotting with Qt widgets works when running octave --no-gui, could we also make it possible to run octave-gui --no-gui so that it starts in the terminal mode but can plot with Qt widgets?

It still makes sense to start octave-cli if you want to run a copy of Octave that is not linked with Qt so we should keep that as an option.

John W. Eaton <jwe>
Group administrator
Thu 26 Feb 2015 08:16:48 PM UTC, comment #19: 

This works for me  - I will replace octave.bat with octave.vbs


(file #33197)

John Donoghue <lostbard>
Group Member
Thu 26 Feb 2015 06:14:22 PM UTC, comment #18: 

I agree.  It's crazy to have vbs -> cmd.exe -> octave.bat -> start -> octave-gui.exe.  If one of the layers could be removed it would be a lot simpler.

Rik <rik5>
Group administrator
Thu 26 Feb 2015 06:03:40 PM UTC, comment #17: 

Will take a look tonight after my real work.

It might be good to see if we can get rid of octave.bat completely, and set any environment stuff etc in the vbs scripts instead

John Donoghue <lostbard>
Group Member
Thu 26 Feb 2015 05:21:17 PM UTC, comment #16: 

I'm totally swamped with other release tasks, as well as real work.  Could you incorporate the vbs script into MXE?  Otherwise, I can probably get to it this weekend, but I want to start trying to get a release candidate out tomorrow.

Rik <rik5>
Group administrator
Thu 26 Feb 2015 05:03:31 PM UTC, comment #15: 

Script works for me ... now can the script open up a splashscreen whilst it is loading the main program ? :)

John Donoghue <lostbard>
Group Member
Thu 26 Feb 2015 04:36:41 PM UTC, comment #14: 

So I think the /B is a good thing and I'll at least commit that change.

Final thing to try is a visual basic script which makes itself invisible before launching octave.bat.  With this, I don't even get a minimized icon in the taskbar.

See the attached runoctavebat.vbs file.

(file #33195)

Rik <rik5>
Group administrator
Thu 26 Feb 2015 01:58:31 PM UTC, comment #13: 

Adding /B /MIN in octave.bat appears to show the console minimized (on task bar) and never show it on the main screen.

However, at that point, with I delete the octave config, then the startup/config window is shown minimized.

John Donoghue <lostbard>
Group Member
Thu 26 Feb 2015 01:34:01 PM UTC, comment #12: 

The shortcuts in the nsis-installer are already minimized.

I started a virus check to put some load on my computer and tried again.

Watching the task bar, without /B I see two console windows applets display so before the main window dislays. On the main screen, it appears only one terminal is shown for a whil, other other flashes briefly.

WIth /B, on the taskbar, there is one terminal displayed - on the main screen, it look like the console starts minimized but then briefly is shown normal just before the main window is shown. 

With not minimized, but with the /B, there is only one console displayed, but is shown for a longer time on the screen than when minimized

John Donoghue <lostbard>
Group Member
Thu 26 Feb 2015 04:07:58 AM UTC, comment #11: 

In comment #5 you found that the Installer Wizard wasn't shown.  But this seems to apply only when the shortcut is running the executable directly.

Things seem to be different when the shortcut points to a .bat file, or maybe we fixed how to raise the window for the Wizard.  I have tested by removing the ~/.config/octave directory and provoking the Welcome Wizard and it works fine with the /B switch and the shortcut set to run minimized.

Maybe the only remaining issue is that John D. reports in comment #9 that it still doesn't completely eliminate a cmd window display.  From what I have read and can understand about Windows, this seems to be the terminal window which is processing the .bat file.  People suggest doing as little processing as possible before executing 'start ...' to minimize the time that this window is shown.  But I found that just switching the shortcut to run minimized was enough.  If John D. can test that then I think that will clear up this final issue.

I do have yet another possibility which is to create a trivial .vbs script which runs octave.bat silently, but this would really be overkill as a vbs script would invoke a .bat script which would invoke an executable.

Rik <rik5>
Group administrator
Thu 26 Feb 2015 01:14:52 AM UTC, comment #10: 

If /B does work, then great, but I seem to recall discussing it previously and there was some reason to avoid using it but unfortunately I don't remember the details.

What about the -Wl,subsystem,windows option?  Or is that just the same as /B?

John W. Eaton <jwe>
Group administrator
Thu 26 Feb 2015 12:12:26 AM UTC, comment #9: 

The extra window always runs quick for me (Win7), making it hard to see - however the amount of time that any console window is shown is halved for me - maybe shown for a 1/4 second.

John Donoghue <lostbard>
Group Member
Wed 25 Feb 2015 11:49:04 PM UTC, comment #8: 

The Octave shortcuts no longer run the executable files directly.  Instead they run octave.bat with the --no-gui or force-gui option.  I was able to get rid of the extra terminal window when running the GUI by editing octave.bat to throw the /B option to start.


start /B octave-gui.exe %*


I'm attaching a patch for the MXE repository.  Can someone else test and see if it works for them?  I only have a crappy Windows XP VM for testing and it is often different than a Win7 or Win8 machine.


(file #33191)

Rik <rik5>
Group administrator
Wed 08 Jan 2014 05:38:20 AM UTC, comment #7: 
John Donoghue <lostbard>
Group Member
Mon 06 Jan 2014 02:21:44 PM UTC, comment #6: 

agreed, better to revert the minimization hack.


as for the definitive solution, it seems to involve a linker setting, from "console" to "window", see:

<http://stackoverflow.com/questions/2139637/hide-console-of-windows-application>

Felipe G. Nievinski <fgnievinski>
Mon 06 Jan 2014 12:32:27 PM UTC, comment #5: 

I built a new installer to test and put it on a system where I had deleted the previous ~/.config/octave direcotry so I could make sure that the initial welcome wizard was still working properly.  With the "run minimized" option selected for the shortcut, the welcome wizard was also minimized, so at first I thought Octave was not working properly.  Maybe we are missing some kind of "raise" or "show" call in the wizard?  If that's not easy to fix, then I suggest that we switch back to the previous mode.  Then the initial terminal window can serve the purpose of the splash screen.  But seriously, starting the welcome wizard minimized is worse than briefly showing a terminal window.

John W. Eaton <jwe>
Group administrator
Fri 03 Jan 2014 03:49:18 PM UTC, comment #4: 
John Donoghue <lostbard>
Group Member
Fri 03 Jan 2014 02:51:10 PM UTC, comment #3: 

here's a diff as per <http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.3.4>

it's not an hg patch as mxe-octave is not in my tree

(file #30173)

Felipe G. Nievinski <fgnievinski>
Fri 03 Jan 2014 02:48:21 PM UTC, comment #2: 

Indeed, "Run minimized" helps.

Felipe G. Nievinski <fgnievinski>
Fri 03 Jan 2014 09:47:05 AM UTC, comment #1: 

Yeah this could be annoying, but IMO only slightly.

On my Windows systems (XP & 7) it's easily fixed in the shortcuts (Desktop & Start menu) by selecting "Run minimized" in the shortcut's Properties. I have no more access to Win 8, but IIRC it works similarly there.

Please try this out and report back.

I suppose this could already be fixed in the MXE-built NSIS installer - but I don't know my way around in NSIS, do you?
Hint: have a look in the makeinst-script.sh here:
http://hg.octave.org/mxe-octave
the Start Menu shortcut sections are easily found

Philip Nienhuis <philipnienhuis>
Group Member
Fri 03 Jan 2014 03:35:33 AM UTC, original submission:  

as per screenshot attached
sorry I have no clue where to search

Felipe G. Nievinski <fgnievinski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #33226:  welcomeshow.patch added by lostbard (1KiB - application/octet-stream)
file #33197:  octave.vbs added by lostbard (1KiB - application/octet-stream)
file #33195:  runoctavebat.vbs added by rik5 (142B - application/x-wine-extension-vbs)
file #33191:  nocmdwin.cset added by rik5 (795B - application/octet-stream)
file #30173:  makeinst-script.sh.diff added by fgnievinski (778B - application/octet-stream)
file #30159:  Clipboard02.png added by fgnievinski (154KiB - image/png)

 

Carbon-Copy List
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 22 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-04 rik5 Dependencies- bugs #41699 is dependent
    2015-03-04 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2015-03-02 lostbard Attached File- Added welcomeshow.patch, #33226
    2015-02-26 lostbard Attached File- Added octave.vbs, #33197
    2015-02-26 rik5 Attached File- Added runoctavebat.vbs, #33195
    2015-02-26 fgnievinski Carbon-CopyRemoved 92640 -
    2015-02-25 rik5 Attached File- Added nocmdwin.cset, #33191
        StatusIn Progress Patch Submitted
    2015-02-10 rik5 Dependencies- bugs #41088 is dependent
    2014-11-04 lostbard Dependencies- bugs #43523 is dependent
    2014-01-06 rik5 Carbon-CopyRemoved 72865 -
    2014-01-06 jwe StatusFixed In Progress
        Open/ClosedClosed Open
    2014-01-04 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2014-01-03 lostbard StatusNeed Info Ready For Test
        Assigned toNone lostbard
    2014-01-03 fgnievinski Attached File- Added makeinst-script.sh.diff, #30173
    2014-01-03 philipnienhuis StatusNone Need Info
        Summaryavoid showing terminal window while GUI is loading MinGW: avoid showing terminal window while GUI is loading
    2014-01-03 fgnievinski Attached File- Added Clipboard02.png, #30159

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code