Process events before creating BrowserPage.
This commit is contained in:
parent
85f8366028
commit
2df276085c
@ -32,8 +32,8 @@ import functools
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QApplication, QDialog
|
from PyQt5.QtWidgets import QApplication, QDialog
|
||||||
from PyQt5.QtCore import (pyqtSlot, QTimer, QEventLoop, Qt, QStandardPaths,
|
from PyQt5.QtCore import (pyqtSlot, qInstallMessageHandler, QTimer, Qt, QUrl,
|
||||||
qInstallMessageHandler, QObject, QUrl)
|
QStandardPaths, QObject)
|
||||||
|
|
||||||
import qutebrowser
|
import qutebrowser
|
||||||
from qutebrowser.commands import userscripts, runners, cmdutils
|
from qutebrowser.commands import userscripts, runners, cmdutils
|
||||||
@ -236,10 +236,6 @@ class Application(QApplication):
|
|||||||
|
|
||||||
URLs to open have no prefix, commands to execute begin with a colon.
|
URLs to open have no prefix, commands to execute begin with a colon.
|
||||||
"""
|
"""
|
||||||
# QNetworkAccessManager::createRequest will hang for over a second, so
|
|
||||||
# we make sure the GUI is refreshed here, so the start seems faster.
|
|
||||||
self.processEvents(QEventLoop.ExcludeUserInputEvents |
|
|
||||||
QEventLoop.ExcludeSocketNotifiers)
|
|
||||||
tabbed_browser = objreg.get('tabbed-browser')
|
tabbed_browser = objreg.get('tabbed-browser')
|
||||||
for cmd in self._args.command:
|
for cmd in self._args.command:
|
||||||
if cmd.startswith(':'):
|
if cmd.startswith(':'):
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer, QUrl
|
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer, QUrl, QEventLoop
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication
|
||||||
from PyQt5.QtWebKit import QWebSettings
|
from PyQt5.QtWebKit import QWebSettings
|
||||||
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
|
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
|
||||||
@ -100,6 +100,11 @@ class WebView(QWebView):
|
|||||||
self.registry = objreg.ObjectRegistry()
|
self.registry = objreg.ObjectRegistry()
|
||||||
self.tab_id = next(tab_id_gen)
|
self.tab_id = next(tab_id_gen)
|
||||||
objreg.register('webview', self, registry=self.registry)
|
objreg.register('webview', self, registry=self.registry)
|
||||||
|
# QNetworkAccessManager init will hang for over a second, so
|
||||||
|
# we make sure the GUI is refreshed here, so the start seems faster.
|
||||||
|
app = objreg.get('app')
|
||||||
|
app.processEvents(QEventLoop.ExcludeUserInputEvents |
|
||||||
|
QEventLoop.ExcludeSocketNotifiers)
|
||||||
page = webpage.BrowserPage(self)
|
page = webpage.BrowserPage(self)
|
||||||
self.setPage(page)
|
self.setPage(page)
|
||||||
hintmanager = hints.HintManager(self)
|
hintmanager = hints.HintManager(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user