diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index ddd5df44c..309f1ab1d 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -327,6 +327,7 @@ |<>|URL parameters to strip with `:yank url`. |<>|Hide the window decoration. |<>|Format to use for the window title. The same placeholders like for +|<>|Set the main window background to transparent. |<>|Default zoom level. |<>|Available zoom levels. |<>|Number of zoom increments to divide the mouse wheel movements to. @@ -4206,6 +4207,22 @@ Type: <> Default: +pass:[{perc}{current_title}{title_sep}qutebrowser]+ +[[window.transparent]] +=== window.transparent +Set the main window background to transparent. + +This allows having a transparent tab- or statusbar (might require a compositor such +as picom). However, it breaks some functionality such as dmenu embedding via its +`-w` option. On some systems, it was additionally reported that main window +transparency negatively affects performance. + +Note this setting only affects windows opened after setting it. + + +Type: <> + +Default: +pass:[false]+ + [[zoom.default]] === zoom.default Default zoom level. diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index da64c0f6a..645342767 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -2074,6 +2074,19 @@ window.title_format: Format to use for the window title. The same placeholders like for `tabs.title.format` are defined. +window.transparent: + type: Bool + default: false + desc: | + Set the main window background to transparent. + + This allows having a transparent tab- or statusbar (might require a compositor such + as picom). However, it breaks some functionality such as dmenu embedding via its + `-w` option. On some systems, it was additionally reported that main window + transparency negatively affects performance. + + Note this setting only affects windows opened after setting it. + ## zoom zoom.default: diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index b8228545a..6273b3382 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -203,8 +203,10 @@ class MainWindow(QWidget): from qutebrowser.mainwindow.statusbar import bar self.setAttribute(Qt.WA_DeleteOnClose) - self.setAttribute(Qt.WA_TranslucentBackground) - self.palette().setColor(QPalette.Window, Qt.transparent) + if config.val.window.transparent: + self.setAttribute(Qt.WA_TranslucentBackground) + self.palette().setColor(QPalette.Window, Qt.transparent) + self._overlays: MutableSequence[_OverlayInfoType] = [] self.win_id = next(win_id_gen) self.registry = objreg.ObjectRegistry()