Revert "Only apply workaround for QTBUG-68076 on non-background tabs"

This reverts commit 77c8575a88.
This commit is contained in:
Jay Kamat 2018-05-22 23:17:43 -07:00
parent 77c8575a88
commit 2f76ef1e53
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
4 changed files with 13 additions and 18 deletions

View File

@ -847,14 +847,7 @@ class AbstractTab(QWidget):
if predict:
self.predicted_navigation.emit(url)
def openurl(self, url, *, predict=True, background=False):
"""Open the given URL in this tab.
Arguments:
url: The QUrl to open.
predict: If set to False, predicted_navigation is not emitted.
background: Whether the tab is being opened in the background.
"""
def openurl(self, url, *, predict=True):
raise NotImplementedError
def reload(self, *, force=False):

View File

@ -782,10 +782,15 @@ class WebEngineTab(browsertab.AbstractTab):
self.zoom.set_factor(self._saved_zoom)
self._saved_zoom = None
def openurl(self, url, *, predict=True, background=False):
def openurl(self, url, *, predict=True):
"""Open the given URL in this tab.
Arguments:
url: The QUrl to open.
predict: If set to False, predicted_navigation is not emitted.
"""
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68076
if not background:
self._widget.setFocus()
self._widget.setFocus()
self._saved_zoom = self.zoom.factor()
self._openurl_prepare(url, predict=predict)
self._widget.load(url)

View File

@ -673,11 +673,9 @@ class WebKitTab(browsertab.AbstractTab):
settings = widget.settings()
settings.setAttribute(QWebSettings.PrivateBrowsingEnabled, True)
# pylint: disable=unused-argument
def openurl(self, url, *, predict=True, background=False):
def openurl(self, url, *, predict=True):
self._openurl_prepare(url, predict=predict)
self._widget.openurl(url)
# pylint: enable=unused-argument
def url(self, requested=False):
frame = self._widget.page().mainFrame()

View File

@ -477,12 +477,11 @@ class TabbedBrowser(QWidget):
idx = self._get_new_tab_idx(related)
self.widget.insertTab(idx, tab, "")
if url is not None:
tab.openurl(url)
if background is None:
background = config.val.tabs.background
if url is not None:
tab.openurl(url, background=background)
if background:
# Make sure the background tab has the correct initial size.
# With a foreground tab, it's going to be resized correctly by the