1
1
Description: fork earlier to work around global menu and appindicator issue
2
2
Author: Marc Deslauriers <marc.deslauriers@ubuntu.com>
3
3
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/overlay-scrollbar/+bug/965318
4
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/virt-manager/+bug/973585
4
5
Forwarded: No, needs a better fix before sending upstream
6
7
Index: virt-manager-0.9.1/src/virt-manager.py.in
7
8
===================================================================
8
--- virt-manager-0.9.1.orig/src/virt-manager.py.in 2012-04-03 08:45:31.661376178 -0400
9
+++ virt-manager-0.9.1/src/virt-manager.py.in 2012-04-03 08:45:56.493375941 -0400
9
--- virt-manager-0.9.1.orig/src/virt-manager.py.in 2012-04-04 13:37:49.834148495 -0400
10
+++ virt-manager-0.9.1/src/virt-manager.py.in 2012-04-04 13:40:41.790143763 -0400
12
13
origargs = " ".join(sys.argv[:])
14
15
+ # We need to fork before importing gtk so global menus and appindicator
15
+ # support works. We also need to defer parsing the command line until
16
+ # after gtk strips out it's own options. Cheat by taking a peek into
17
+ # sys.argv directly here. We have to defer dropping stdio until later
18
+ # once we've actually parsed the command line, or we won't get any
19
+ # errors or help text.
20
+ if not '--no-fork' in sys.argv and not '--debug' in sys.argv:
16
+ # support works. Unfortunately, that means we need to parse the command
17
+ # line before gtk can strip out it's own options.
18
+ (options, ignore) = parse_commandline()
19
+ if not options.nofork and not options.debug:
23
+ # Ignore SIGHUP, otherwise a serial console closing drops the whole app
24
+ signal.signal(signal.SIGHUP, signal.SIG_IGN)
23
26
# Urgh, pygtk merely logs a warning when failing to open
24
27
# the X11 display connection, and lets everything carry
25
28
# on as if all were fine. Ultimately bad stuff happens,
31
warnings.resetwarnings()
33
- # Need to parse CLI after import gtk, since gtk strips --sync
34
- (options, ignore) = parse_commandline()
36
# Only raise this error after parsing the CLI, so users at least
37
# get --help output and CLI validation
27
40
dbus.mainloop.glib.threads_init()
28
41
import dbus.service
33
46
import virtManager.config
34
47
import virtManager.util
35
48
config = virtManager.config.vmmConfig(appname, appversion, glade_dir)
37
50
import virtManager.guidiff
38
51
virtManager.guidiff.is_gui(True)
40
53
- # Now we've got basic environment up & running we can fork
41
+ # Now we've got basic environment up & running we can drop stdio
42
if not options.nofork and not options.debug:
54
- if not options.nofork and not options.debug:
58
- # Ignore SIGHUP, otherwise a serial console closing drops the whole app
59
- signal.signal(signal.SIGHUP, signal.SIG_IGN)
61
from virtManager.engine import vmmEngine
46
# Ignore SIGHUP, otherwise a serial console closing drops the whole app
63
gtk.window_set_default_icon_name(appname)