On linux ensure that WM_CLASS for the main calibre GUI is set to 'calibre-gui' to match the name of the calibre-gui.desktop file. This is apparently required by the GNOME 3 shell. Fixes #1020297 (application icons in gnome3)

This commit is contained in:
Kovid Goyal 2012-07-05 19:59:16 +05:30
parent 25758c4348
commit 8f6ff64b3b

View File

@ -736,6 +736,9 @@ class Application(QApplication):
def __init__(self, args, force_calibre_style=False): def __init__(self, args, force_calibre_style=False):
self.file_event_hook = None self.file_event_hook = None
if islinux and args[0].endswith(u'calibre'):
args = list(args)
args[0] += '-gui'
qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args] qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args]
QApplication.__init__(self, qargs) QApplication.__init__(self, qargs)
global gui_thread, qt_app global gui_thread, qt_app