Menu

#25 GLib.spawn_async() opens new console window

1.0
closed
nobody
None
2015-08-27
2015-08-27
No

On Windows every call of GLib.spawn_asyn(...) starts not just the subprocess but a new console window too. On Linux it's not doing this. Am I missing something or is this a known bug?

Discussion

  • tumagonx

    tumagonx - 2015-08-27

    You meant the spawner window?
    There is two spawner: gspawn-win32-helper.exe and gspawn-win32-helper-console.exe, the former don't show window

     
    • Bajusz Tamás

      Bajusz Tamás - 2015-08-27

      Sorry, but how can I influence in my python code which one will be used by GLib.spawn_async()? I find nothing about this in documentation.

       
  • tumagonx

    tumagonx - 2015-08-27

    BTW, please consult gspwn documentation, especially windows section. At any rate this should reported upstream.

     
    • Bajusz Tamás

      Bajusz Tamás - 2015-08-27
       
    • Bajusz Tamás

      Bajusz Tamás - 2015-08-28

      I'v read gspawn*.c sources and the conclusion is that GLib has no functionality on Windows(Linux is ok) what we need in PyChess. PyChess is a chess GUI program spawning chess engines (console programs!) to play/analyze with, but don't need console windows of child processes (chess engines) at all, just stdin/stdout/stderr to communicate with them.

      It's pending from 2008: https://bugzilla.gnome.org/show_bug.cgi?id=509201
      The latest patch attached to the issue by Alexander Shaduri seems the way to go. Unfortunately not commented by upstream :(
      Consider to add that patch to pygobjctwin32, please!

       
      • tumagonx

        tumagonx - 2015-08-28

        Thanks for the link, I will think about it for the next rev22. I used to simply overwrite gspawn-win32-helper-console.exe with gspawn-win32-helper.exe when encounter such case.

         
        • Bajusz Tamás

          Bajusz Tamás - 2015-08-28

          Unfortunately it doesn't help in our case. It doesn't force the actual started process to not open console window.

           
        • Bajusz Tamás

          Bajusz Tamás - 2015-09-09

          First test with rev22 produced:

          AttributeError: 'gi.repository.GLib' object has no attribute 'SPAWN_WIN32_HIDDEN_CONSOLE'

          To let it work, the patch needs an additional change. It has to add 'WIN32_HIDDEN_CONSOLE' into the SPAWN flags list in gi\overrides\GLib.py in line#505.

           
          • tumagonx

            tumagonx - 2015-09-09

            I see, well it's supposedly introspected without SPAWN prefix and in lowercase I don't know it been overrided. Sorry but I won't make revision just for that, not without other updates at least.

             
            • Bajusz Tamás

              Bajusz Tamás - 2015-09-09

              No problem I'm ok with rev22. It's in a .py file, so I can fix it easily myself for PyChess. Thx for adding the patch!

               

              Last edit: Bajusz Tamás 2015-09-09
  • tumagonx

    tumagonx - 2015-08-27
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB