TPT waits for xdg-open to finish

  • LBPHacker
    5th May 2016 Developer 0 Permalink

    When I open a forum thread through a sign, TPT freezes until I exit the browser, most likely due to Platform.cpp:94 running xdg-open synchronously.

     

    Having no idea what else to say,

    $ uname -a
    Linux lbphacker-ubuntu1 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

  • jacob1
    5th May 2016 Developer 0 Permalink
    Well what should it do, create a new thread just to run the system() command?

    It is slow for me on windows too, but when I was on Linux it was usually instant. If we did make it asynchronous, it should probably give some sign to show that it tried to open the browser (right now freezing for half a second shows this)
  • LBPHacker
    5th May 2016 Developer 0 Permalink

    Oh wait. This is weird. I just set the default browser to chromium-browser.desktop and now xdg-open returns immediately (sort of, of course it waits some, as you've mentioned).

     

    EDIT: Nevermind all that. xdg-open totally waits until the program it started finishes. chromium returned because it opened a tab in the existing browser session.

     

    *break*

     

    Set it back to firefox.desktop. This might be firefox's fault. Right now I have a thread open in firefox and it doesn't seem willing to return.

    ...
    +powder---sh---xdg-open---firefox-+-{Cache I/O}
    ...

    EDIT: The editor didn't like pstree's output.

    Edited 2 times by LBPHacker. Last: 5th May 2016
  • jenn4
    5th May 2016 Member 0 Permalink
    @jacob1 (View Post)
    I guess it would be bad to run bash and
    xdg-open &
    ?
    Edited once by jenn4. Last: 5th May 2016
  • boxmein
    6th May 2016 Former Staff 0 Permalink
    @jacob1 (View Post)
    Could just be a modal with a spinner inside saying "Opening this forum thread in your browser.". Doesn't need to be anything else and this would offer way better user experience than just waiting until xdg-open finishes.