Do not require restart after decoration option change
This commit is contained in:
parent
764e79e505
commit
2d2bdad2ca
@ -3157,7 +3157,7 @@ Default:
|
|||||||
- +pass:[utm_term]+
|
- +pass:[utm_term]+
|
||||||
- +pass:[utm_content]+
|
- +pass:[utm_content]+
|
||||||
|
|
||||||
[[window.hide_wayland_decoration]]
|
[[window.hide_decoration]]
|
||||||
=== window.hide_decoration
|
=== window.hide_decoration
|
||||||
Hide the window decoration.
|
Hide the window decoration.
|
||||||
This setting requires a restart.
|
This setting requires a restart.
|
||||||
|
1
qutebrowser/config/.#configfiles.py
Symbolic link
1
qutebrowser/config/.#configfiles.py
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
rw@domper.local.3624
|
@ -1536,8 +1536,10 @@ url.yank_ignored_parameters:
|
|||||||
window.hide_decoration:
|
window.hide_decoration:
|
||||||
type: Bool
|
type: Bool
|
||||||
default: false
|
default: false
|
||||||
restart: true
|
restart: false
|
||||||
desc: Hide the window decoration.
|
desc: |
|
||||||
|
Hide the window decoration. Does require a restart for
|
||||||
|
Wayland users.
|
||||||
|
|
||||||
window.title_format:
|
window.title_format:
|
||||||
type:
|
type:
|
||||||
|
@ -90,6 +90,9 @@ def _init_envvars():
|
|||||||
if config.val.qt.force_platform is not None:
|
if config.val.qt.force_platform is not None:
|
||||||
os.environ['QT_QPA_PLATFORM'] = config.val.qt.force_platform
|
os.environ['QT_QPA_PLATFORM'] = config.val.qt.force_platform
|
||||||
|
|
||||||
|
if config.val.window.hide_wayland_decoration:
|
||||||
|
os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1'
|
||||||
|
|
||||||
if config.val.qt.highdpi:
|
if config.val.qt.highdpi:
|
||||||
os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = '1'
|
os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = '1'
|
||||||
|
|
||||||
|
@ -169,9 +169,6 @@ class MainWindow(QWidget):
|
|||||||
objreg.register('message-bridge', message_bridge, scope='window',
|
objreg.register('message-bridge', message_bridge, scope='window',
|
||||||
window=self.win_id)
|
window=self.win_id)
|
||||||
|
|
||||||
if config.val.window.hide_decoration:
|
|
||||||
window_flags = Qt.CustomizeWindowHint | Qt.NoDropShadowWindowHint
|
|
||||||
self.setWindowFlags(Qt.Window | window_flags)
|
|
||||||
self.setWindowTitle('qutebrowser')
|
self.setWindowTitle('qutebrowser')
|
||||||
self._vbox = QVBoxLayout(self)
|
self._vbox = QVBoxLayout(self)
|
||||||
self._vbox.setContentsMargins(0, 0, 0, 0)
|
self._vbox.setContentsMargins(0, 0, 0, 0)
|
||||||
@ -233,6 +230,8 @@ class MainWindow(QWidget):
|
|||||||
config.instance.changed.connect(self._on_config_changed)
|
config.instance.changed.connect(self._on_config_changed)
|
||||||
|
|
||||||
objreg.get("app").new_window.emit(self)
|
objreg.get("app").new_window.emit(self)
|
||||||
|
self._set_decoration(config.val.window.hide_decoration)
|
||||||
|
|
||||||
|
|
||||||
def _init_geometry(self, geometry):
|
def _init_geometry(self, geometry):
|
||||||
"""Initialize the window geometry or load it from disk."""
|
"""Initialize the window geometry or load it from disk."""
|
||||||
@ -347,6 +346,8 @@ class MainWindow(QWidget):
|
|||||||
elif option == 'statusbar.position':
|
elif option == 'statusbar.position':
|
||||||
self._add_widgets()
|
self._add_widgets()
|
||||||
self._update_overlay_geometries()
|
self._update_overlay_geometries()
|
||||||
|
elif option == 'window.hide_decoration':
|
||||||
|
self._set_decoration(config.val.window.hide_decoration)
|
||||||
|
|
||||||
def _add_widgets(self):
|
def _add_widgets(self):
|
||||||
"""Add or readd all widgets to the VBox."""
|
"""Add or readd all widgets to the VBox."""
|
||||||
@ -496,6 +497,15 @@ class MainWindow(QWidget):
|
|||||||
completion_obj.on_clear_completion_selection)
|
completion_obj.on_clear_completion_selection)
|
||||||
cmd.hide_completion.connect(completion_obj.hide)
|
cmd.hide_completion.connect(completion_obj.hide)
|
||||||
|
|
||||||
|
def _set_decoration(self, hidden):
|
||||||
|
""" Set the visibility of the window decoration via Qt."""
|
||||||
|
window_flags = Qt.Window
|
||||||
|
if hidden:
|
||||||
|
window_flags |= Qt.CustomizeWindowHint | Qt.NoDropShadowWindowHint
|
||||||
|
self.setWindowFlags(window_flags)
|
||||||
|
self.hide()
|
||||||
|
self.show()
|
||||||
|
|
||||||
@pyqtSlot(bool)
|
@pyqtSlot(bool)
|
||||||
def _on_fullscreen_requested(self, on):
|
def _on_fullscreen_requested(self, on):
|
||||||
if not config.val.content.windowed_fullscreen:
|
if not config.val.content.windowed_fullscreen:
|
||||||
|
Loading…
Reference in New Issue
Block a user