Linux install: Have the calibre GUI programs redirect stdout and stderr to null when launched via .desktop files to workaround systems where the GUI launchers are broken. See #1315458 (Calibre can't open AZW3 books if launched from Ubuntu Dash)

This commit is contained in:
Kovid Goyal 2014-05-03 09:22:32 +05:30
parent 482afd9952
commit 8a46cc45bb
2 changed files with 5 additions and 5 deletions

View File

@ -854,8 +854,8 @@ def setup_gui_option_parser(parser):
help='Detach from the controlling terminal, if any (linux only)') help='Detach from the controlling terminal, if any (linux only)')
def detach_gui(): def detach_gui():
if islinux and not DEBUG and sys.stdout.isatty(): if islinux and not DEBUG:
# We are a GUI process running in a terminal so detach from the controlling terminal # Detach from the controlling process.
if os.fork() != 0: if os.fork() != 0:
raise SystemExit(0) raise SystemExit(0)
os.setsid() os.setsid()

View File

@ -929,7 +929,7 @@ Name=E-book Viewer
GenericName=Viewer for E-books GenericName=Viewer for E-books
Comment=Viewer for E-books in all the major formats Comment=Viewer for E-books in all the major formats
TryExec=ebook-viewer TryExec=ebook-viewer
Exec=ebook-viewer %f Exec=ebook-viewer --detach %f
Icon=calibre-viewer Icon=calibre-viewer
Categories=Graphics;Viewer; Categories=Graphics;Viewer;
''' '''
@ -942,7 +942,7 @@ Name=Edit E-book
GenericName=Edit E-books GenericName=Edit E-books
Comment=Edit e-books in various formats Comment=Edit e-books in various formats
TryExec=ebook-edit TryExec=ebook-edit
Exec=ebook-edit %f Exec=ebook-edit --detach %f
Icon=calibre-ebook-edit Icon=calibre-ebook-edit
Categories=Office; Categories=Office;
''' '''
@ -955,7 +955,7 @@ Name=calibre
GenericName=E-book library management GenericName=E-book library management
Comment=E-book library management: Convert, view, share, catalogue all your e-books Comment=E-book library management: Convert, view, share, catalogue all your e-books
TryExec=calibre TryExec=calibre
Exec=calibre %F Exec=calibre --detach %F
Icon=calibre-gui Icon=calibre-gui
Categories=Office; Categories=Office;
''' '''