diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 83f9635fe..ba8c36857 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -259,6 +259,12 @@ content.default_encoding: The encoding must be a string describing an encoding such as _utf-8_, _iso-8859-1_, etc. +content.windowed_fullscreen: + type: Bool + default: false + desc: >- + Limit fullscreen to the browser window (does not expand to fill the screen). + content.developer_extras: type: Bool default: false diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 57e540a53..bf95d3e6a 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -491,11 +491,12 @@ class MainWindow(QWidget): @pyqtSlot(bool) def _on_fullscreen_requested(self, on): - if on: - self.state_before_fullscreen = self.windowState() - self.showFullScreen() - elif self.isFullScreen(): - self.setWindowState(self.state_before_fullscreen) + if not config.val.content.windowed_fullscreen: + if on: + self.state_before_fullscreen = self.windowState() + self.showFullScreen() + elif self.isFullScreen(): + self.setWindowState(self.state_before_fullscreen) log.misc.debug('on: {}, state before fullscreen: {}'.format( on, debug.qflags_key(Qt, self.state_before_fullscreen))) diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index 546cab8fb..f398feb4c 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -300,7 +300,10 @@ class FullscreenNotification(QLabel): self.setText("Page is now fullscreen.") self.resize(self.sizeHint()) - geom = QApplication.desktop().screenGeometry(self) + if config.val.content.windowed_fullscreen: + geom = self.parentWidget().geometry() + else: + geom = QApplication.desktop().screenGeometry(self) self.move((geom.width() - self.sizeHint().width()) / 2, 30) def set_timeout(self, timeout):