Fix reading of fonts.monospace on init

See #2973
This commit is contained in:
Florian Bruhin 2017-10-11 21:09:08 +02:00
parent 96c0cde8b8
commit cbe9ff7435
2 changed files with 13 additions and 2 deletions

View File

@ -48,8 +48,6 @@ def early_init(args):
for cf in config.change_filters:
cf.validate()
configtypes.Font.monospace_fonts = config.val.fonts.monospace
config_commands = configcommands.ConfigCommands(
config.instance, config.key_instance)
objreg.register('config-commands', config_commands)
@ -76,6 +74,8 @@ def early_init(args):
except configexc.Error as e:
message.error("set: {} - {}".format(e.__class__.__name__, e))
configtypes.Font.monospace_fonts = config.val.fonts.monospace
_init_envvars()

View File

@ -200,6 +200,17 @@ class TestEarlyInit:
assert msg.text == "set: NoOptionError - No option 'foo'"
assert 'colors.completion.fg' not in config.instance._values
def test_monospace_fonts_init(self, init_patch, args):
"""Ensure setting fonts.monospace at init works properly.
See https://github.com/qutebrowser/qutebrowser/issues/2973
"""
args.temp_settings = [('fonts.monospace', '"Comic Sans MS"')]
configinit.early_init(args)
assert config.instance.get('fonts.keyhint') == '8pt "Comic Sans MS"'
assert config.instance.get('fonts.tabs').family() == 'Comic Sans MS'
def test_force_software_rendering(self, monkeypatch, config_stub):
"""Setting force_software_rendering should set the environment var."""
envvar = 'QT_XCB_FORCE_SOFTWARE_OPENGL'