Rename qt_args and force_software_rendering to add qt. prefix

Closes #3077
This commit is contained in:
Florian Bruhin 2017-10-11 07:45:38 +02:00
parent abbd69f604
commit 0cd5d4300b
8 changed files with 59 additions and 49 deletions

View File

@ -56,7 +56,7 @@ Added
- New back/forward indicator in the statusbar
- New `bindings.key_mappings` setting to map keys to other keys
- New `qt_args` setting to pass additional arguments to Qt/Chromium
- New `qt.args` setting to pass additional arguments to Qt/Chromium
- New `backend` setting to select the backend to use (auto/webengine/webkit).
Together with the previous setting, this should make wrapper scripts
unnecessary.

View File

@ -179,7 +179,6 @@
|<<fonts.web.size.default_fixed,fonts.web.size.default_fixed>>|The default font size for fixed-pitch text.
|<<fonts.web.size.minimum,fonts.web.size.minimum>>|The hard minimum font size.
|<<fonts.web.size.minimum_logical,fonts.web.size.minimum_logical>>|The minimum logical font size that is applied when zooming out.
|<<force_software_rendering,force_software_rendering>>|Force software rendering for QtWebEngine.
|<<hints.auto_follow,hints.auto_follow>>|Controls when a hint can be automatically followed without pressing Enter.
|<<hints.auto_follow_timeout,hints.auto_follow_timeout>>|A timeout (in milliseconds) to ignore normal-mode key bindings after a successful auto-follow.
|<<hints.border,hints.border>>|CSS border value for hints.
@ -211,7 +210,8 @@
|<<new_instance_open_target_window,new_instance_open_target_window>>|Which window to choose when opening links as new tabs.
|<<prompt.filebrowser,prompt.filebrowser>>|Show a filebrowser in upload/download prompts.
|<<prompt.radius,prompt.radius>>|The rounding radius for the edges of prompts.
|<<qt_args,qt_args>>|Additional arguments to pass to Qt, without leading `--`.
|<<qt.args,qt.args>>|Additional arguments to pass to Qt, without leading `--`.
|<<qt.force_software_rendering,qt.force_software_rendering>>|Force software rendering for QtWebEngine.
|<<scrolling.bar,scrolling.bar>>|Show a scrollbar.
|<<scrolling.smooth,scrolling.smooth>>|Enable smooth scrolling for web pages.
|<<session_default_name,session_default_name>>|The name of the session to save by default.
@ -2115,17 +2115,6 @@ Type: <<types,Int>>
Default: +pass:[6]+
[[force_software_rendering]]
=== force_software_rendering
Force software rendering for QtWebEngine.
This is needed for QtWebEngine to work with Nouveau drivers. This setting requires a restart.
Type: <<types,Bool>>
Default: +pass:[false]+
This setting is only available with the QtWebEngine backend.
[[hints.auto_follow]]
=== hints.auto_follow
Controls when a hint can be automatically followed without pressing Enter.
@ -2444,8 +2433,8 @@ Type: <<types,Int>>
Default: +pass:[8]+
[[qt_args]]
=== qt_args
[[qt.args]]
=== qt.args
Additional arguments to pass to Qt, without leading `--`.
With QtWebEngine, some Chromium arguments (see https://peter.sh/experiments/chromium-command-line-switches/ for a list) will work.
This setting requires a restart.
@ -2454,6 +2443,17 @@ Type: <<types,List of String>>
Default: empty
[[qt.force_software_rendering]]
=== qt.force_software_rendering
Force software rendering for QtWebEngine.
This is needed for QtWebEngine to work with Nouveau drivers. This setting requires a restart.
Type: <<types,Bool>>
Default: +pass:[false]+
This setting is only available with the QtWebEngine backend.
[[scrolling.bar]]
=== scrolling.bar
Show a scrollbar.

View File

@ -88,31 +88,6 @@ session_default_name:
If this is set to null, the session which was last loaded is saved.
qt_args:
type:
name: List
valtype: String
none_ok: true
default: []
desc: >-
Additional arguments to pass to Qt, without leading `--`.
With QtWebEngine, some Chromium arguments (see
https://peter.sh/experiments/chromium-command-line-switches/ for a list)
will work.
This setting requires a restart.
force_software_rendering:
type: Bool
default: false
backend: QtWebEngine
desc: >-
Force software rendering for QtWebEngine.
This is needed for QtWebEngine to work with Nouveau drivers.
This setting requires a restart.
backend:
type:
name: String
@ -136,6 +111,41 @@ backend:
This setting requires a restart.
## qt
qt_args:
renamed: qt.args
qt.args:
type:
name: List
valtype: String
none_ok: true
default: []
desc: >-
Additional arguments to pass to Qt, without leading `--`.
With QtWebEngine, some Chromium arguments (see
https://peter.sh/experiments/chromium-command-line-switches/ for a list)
will work.
This setting requires a restart.
force_software_rendering:
renamed: qt.force_software_rendering
qt.force_software_rendering:
type: Bool
default: false
backend: QtWebEngine
desc: >-
Force software rendering for QtWebEngine.
This is needed for QtWebEngine to work with Nouveau drivers.
This setting requires a restart.
## auto_save
auto_save.interval:

View File

@ -82,7 +82,7 @@ def early_init(args):
def _init_envvars():
"""Initialize environment variables which need to be set early."""
if (objects.backend == usertypes.Backend.QtWebEngine and
config.val.force_software_rendering):
config.val.qt.force_software_rendering):
os.environ['QT_XCB_FORCE_SOFTWARE_OPENGL'] = '1'
if config.val.window.hide_wayland_decoration:
@ -138,5 +138,5 @@ def qt_args(namespace):
for name, value in namespace.qt_arg:
argv += ['--' + name, value]
argv += ['--' + arg for arg in config.val.qt_args]
argv += ['--' + arg for arg in config.val.qt.args]
return argv

View File

@ -167,7 +167,7 @@ def _handle_nouveau_graphics():
'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ):
return
button = _Button("Force software rendering", 'force_software_rendering',
button = _Button("Force software rendering", 'qt.force_software_rendering',
True)
_show_dialog(
backend=usertypes.Backend.QtWebEngine,
@ -177,7 +177,7 @@ def _handle_nouveau_graphics():
"<p>This allows you to use the newer QtWebEngine backend (based "
"on Chromium) but could have noticable performance impact "
"(depending on your hardware). "
"This sets the <i>force_software_rendering = True</i> option "
"This sets the <i>qt.force_software_rendering = True</i> option "
"(if you have a <i>config.py</i> file, you'll need to set this "
"manually).</p>",
buttons=[button],

View File

@ -329,7 +329,7 @@ def test_force_software_rendering(request, quteproc_new):
pytest.skip("Only runs with QtWebEngine")
args = (_base_args(request.config) +
['--temp-basedir', '-s', 'force_software_rendering', 'true'])
['--temp-basedir', '-s', 'qt.force_software_rendering', 'true'])
quteproc_new.start(args)
quteproc_new.open_path('chrome://gpu')
message = 'Canvas: Software only, hardware acceleration unavailable'

View File

@ -179,7 +179,7 @@ class TestCycle:
For example, we use [foo] which is represented as ["foo"].
"""
opt = 'qt_args'
opt = 'qt.args'
config_stub.set_obj(opt, ['foo'])
commands.config_cycle(opt, '[foo]', '[bar]')
assert config_stub.get(opt) == ['bar']

View File

@ -207,7 +207,7 @@ class TestEarlyInit:
usertypes.Backend.QtWebEngine)
monkeypatch.delenv(envvar, raising=False)
config_stub.val.force_software_rendering = True
config_stub.val.qt.force_software_rendering = True
configinit._init_envvars()
@ -300,7 +300,7 @@ class TestQtArgs:
def test_with_settings(self, config_stub, parser):
parsed = parser.parse_args(['--qt-flag', 'foo'])
config_stub.val.qt_args = ['bar']
config_stub.val.qt.args = ['bar']
assert configinit.qt_args(parsed) == [sys.argv[0], '--foo', '--bar']