Handle -s argument earlier

This makes sure we can e.g. set software_rendering via -s
This commit is contained in:
Florian Bruhin 2017-09-28 10:10:14 +02:00
parent 45c6ffe991
commit 865fc2e0de
2 changed files with 7 additions and 7 deletions

View File

@ -207,12 +207,6 @@ def _init_icon():
def _process_args(args):
"""Open startpage etc. and process commandline args."""
for opt, val in args.temp_settings:
try:
config.instance.set_str(opt, val)
except configexc.Error as e:
message.error("set: {} - {}".format(e.__class__.__name__, e))
if not args.override_restore:
_load_session(args.session)
session_manager = objreg.get('session-manager')

View File

@ -26,7 +26,7 @@ from PyQt5.QtWidgets import QMessageBox
from qutebrowser.config import (config, configdata, configfiles, configtypes,
configexc)
from qutebrowser.utils import objreg, usertypes, log, standarddir
from qutebrowser.utils import objreg, usertypes, log, standarddir, message
from qutebrowser.misc import msgbox, objects
@ -70,6 +70,12 @@ def early_init(args):
objects.backend = get_backend(args)
for opt, val in args.temp_settings:
try:
config.instance.set_str(opt, val)
except configexc.Error as e:
message.error("set: {} - {}".format(e.__class__.__name__, e))
if (objects.backend == usertypes.Backend.QtWebEngine and
config.val.force_software_rendering):
os.environ['QT_XCB_FORCE_SOFTWARE_OPENGL'] = '1'