summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-17tests: Fix QApplication argumentsqt6-v2Florian Bruhin
With Qt 6.5, QtWebEngine complains and aborts when it gets an empty argv: https://bugreports.qt.io/browse/QTBUG-110157 https://codereview.qt-project.org/c/qt/qtwebengine/+/455347 https://codereview.qt-project.org/c/qt/qtwebengine/+/457045 https://www.riverbankcomputing.com/pipermail/pyqt/2023-March/045216.html However, our custom qapp_args override for pytest-qt *does* return [] as argv, causing all tests using QtWebEngine to fail. We might decide to add sys.argv[0] to the given qapp_args in pytest-qt: https://github.com/pytest-dev/pytest-qt/issues/483 But probably this should be fixed on the application-side, so let's do exactly that. See #7624
2023-03-17tests: Update FIXME commentFlorian Bruhin
PyQt insists using the deprecated signal overload, seemingly nothing we can do to change that: https://www.riverbankcomputing.com/pipermail/pyqt/2023-March/045215.html See #7624
2023-03-17Qt 6.5: Skip elf testsFlorian Bruhin
The ELF file structure changed in a way that it seems impossible to support reliably. Given that we have an API to get the version nowadays, let's not bother with this. We might need to figure this out for PySide6 support, but not now. See #7624, #3625
2023-03-17scripts: Patch relative links for correct doc generationFlorian Bruhin
In doc/help/index.asciidoc, we have links like this: * link:../quickstart{outfilesuffix}[Quick start guide] That is correct in e.g. the GitHub file structure, as those files are stored in e.g. doc/quickstart.asciidoc indeed. It's *no* longer true when we view the built files via qute://help, however: There, this turns into a flat file structure, with those pages being at qute://help/index.html and qute://help/quickstart.html, respectively. It looks like QtWebEngine < 6.5 did just ignore the <a href="../quicktart.html"> and pointed from qute://help/index.html to qute://help/quickstart.html anyways, weirdly. With QtWebEngine 6.5, however, this is now interpreted as a link pointing to qute://quickstart.html instead, which is clearly wrong. Until we have a less messy doc generation (probably as part of #345), let's just patch the link to be correct. See #7624
2023-03-17Update settings docsFlorian Bruhin
2023-03-17Qt 6.5: Always use new dark mode values for newer Qt'sFlorian Bruhin
I don't quite understand why the value changed from #00000 to #121212 there with Qt 6.3, but it looks like the change is here to stay. Instead of keeping #000000 the default and adding an override for every new Qt release, let's just switch over and add an override for the old versions (5.15 and 6.2), so this won't break again for every new release. See #7624
2023-03-17tests: Ignore more Qt 6.5 / debug build messagesFlorian Bruhin
See #7624
2023-03-15Override QTabBar text eildingtoofar
The fontMetrics().elidedText(...) call is copied from the base QTabBar implementation of initStyleOption(). But here we are calling it with a text_rect from our custom style class. In Qt6 QStyleSheetStyle no longer calls into our custom Style class for the SE_TabBarTabText SubElement so it ends up getting a text width from QCommonStyle which is wrong for vertical tabs (`QCommonStylePrivate::tabLayout()` seems to transpose the rect, maybe it thinks vertical tabs should have the text running vertically too). Also resolves the issue that when tabs.title.alignment is set to center the leftmost character or two of titles wouldn't be visible when tabs where small enough that the text got elided. Not 100% sure why but presumably it wasn't picking up the padding etc logic in our custom style class. In the test I don't test the exact elided text when we don't have much room because it might differ based on what monospace font is picked up in the tests. So the amount elided might change. Also in the not-elided one I'm only testing endswith() because the index should be at the start of the string which I don't really care about. Fixes: #7313 Fixes: #7205
2023-03-14tox: Install doc requirements for tests tooFlorian Bruhin
Needed so that tests generating :help docs run properly. Follow-up to af176f749fd7f5521d3978e268a1fad169ac2bd4 and bbdc83f638ed1a8e263a3efac0da8a901c1a1420 (cherry picked from commit 3d56f57e502ffaad40936f19f44083a2b63f0690)
2023-03-14PDF.js: Update to newer API to avoid deprecation warningsFlorian Bruhin
A quick tour through the PDF.js API: v1.0.1040 introduced the ability to pass an object to PDFView.open() instead of passing an URL: https://github.com/mozilla/pdf.js/pull/5254 v1.6.210 (?) renamed PDFView to PDFViewerApplication: ffa276a1826a95bf1f80b15f48cfbf2b9cfe6dad v3.3.122 made it mandatory to pass an object (and also made originalURL optional when doing so): https://github.com/mozilla/pdf.js/pull/15972 We should probably properly get rid of old version support at some point (see #7619), but until then, I *think* this approach should work with older versions still. Fixes #7618 (cherry picked from commit 924a7a5907124a0a33e2cc9454e389b7a2634244)
2023-03-14CI: generate archlinux-webengine-qt6 docker imagetoofar
I'm not 100% sure we need this. But there is an existing test matrix that I want to active for now. We can review all the configuration later I guess?
2023-01-29Fix missing raw string prefixFlorian Bruhin
2022-12-16scripts: Ignore CreateCommandBuffer warning for release smoketestFlorian Bruhin
2022-12-13tests: Ignore another spurious Chromium errorFlorian Bruhin
2022-12-13Fix duplicate testcase after mergeFlorian Bruhin
2022-12-13Merge branch 'master' into qt6-v2Florian Bruhin
2022-12-13Make shellcheck happy again about password_fillFlorian Bruhin
v0.9.0 seems to add SC2317 ("Command appears to be unreachable."): https://www.shellcheck.net/wiki/SC2317 This adds various false-positives in password_fill, let's just ignore those... Also see: https://github.com/koalaman/shellcheck/issues/2613
2022-12-13ci: I shouldn't push changes before my first coffeeFlorian Bruhin
2022-12-13ci: Adjust for asciidoc changesFlorian Bruhin
2022-12-12Merge pull request #7521 from qutebrowser/update-dependenciesFlorian Bruhin
Update dependencies
2022-12-12Merge pull request #7510 from qutebrowser/qt6-delay-window-showFlorian Bruhin
qt6: Delay showing windows
2022-12-12Update changelog URLs for tox 4Florian Bruhin
2022-12-12Update dependenciesqutebrowser bot
2022-12-12More adjustments for tox 4 subtletiesFlorian Bruhin
2022-12-12Fix lint/ciFlorian Bruhin
2022-12-12scripts: Use pip-installed asciidocFlorian Bruhin
Fixes #7352, closes #6793
2022-12-12scripts: Show asciidoc errors while discoveringFlorian Bruhin
2022-12-12Update tox.ini syntax for tox 4 compatFlorian Bruhin
See https://tox.wiki/en/4.0.3/faq.html#tox-4-changed-ini-rules
2022-12-06Fix lintqt6-delay-window-showFlorian Bruhin
2022-12-06Use QProxyStyle for TabBarStyleFlorian Bruhin
Closes #812 This does *not* seem to help with the crashes in #5385 or #5124, weirdly enough, but it still seems simpler, so why not do it.
2022-12-06Always delay stage 2 shutdown, not only with promptsFlorian Bruhin
If we shut down qutebrowser directly, in some rare situations, we seem to get into some trouble related to a QWidget trying to call into a Q(Common|StyleSheet)Style at shutdown (checking the style hint SH_Widget_ShareActivation, to figure out the palette to use when the window is hidden, or somesuch?). With the recent changes for #7504, those crashes suddenly started happening much more often. After staring at the related changes and gdb for over a day, I still have no idea what actually causes them and why it's crashing - it smells like some kind of PyQt/Qt cleanup order bug... However, what I *did* find out (after a lot of painful debugging and messing around with things) is that delaying the shutdown done from :quit seems to reliably get rid of the issue. I don't know *why*, but I haven't seen it happen anymore with the latest changes... Fixes #5385 and #5124, both speculatively. Closes #7504 since this was the last change required to make it all work.
2022-12-06quitter: Simplify :quit implementationFlorian Bruhin
None is the default value for instance.shutdown()'s "session", so we can simplify this a bit.
2022-12-06tests: Make sure we close history database connectionsFlorian Bruhin
With pytest main, pytest now reuses temporary directories...
2022-12-06Use a proper @pyqtSlot for FilenamePromptFlorian Bruhin
In bleeding tests, we started to get a segfault on the second test in tests/unit/mainwindow/test_prompt.py, with a stacktrace like: Thread 1 "python" received signal SIGSEGV, Segmentation fault. 0x00007ffff7b55912 in _PyFunction_Vectorcall (func=<function at remote 0x7fffc4368ca0>, stack=0x7fffd74656a8, nargsf=<optimized out>, kwnames=0x0) at Objects/call.c:341 341 if (((PyCodeObject *)f->fc_code)->co_flags & CO_OPTIMIZED) { (gdb) bt #0 0x00007ffff7b55912 in _PyFunction_Vectorcall (func=<function at remote 0x7fffc4368ca0>, stack=0x7fffd74656a8, nargsf=<optimized out>, kwnames=0x0) at Objects/call.c:341 #1 0x00007ffff4e0b3f1 in PyQtSlot::call(_object*, _object*) const (this=0x555556c759c0, args=('/tmp/pytest-of-florian/pytest-70/test_simple_completion_1_next_0/test',), callable=<function at remote 0x7fffc4368ca0>) at ../../qpy/QtCore/qpycore_pyqtslot.cpp:247 #2 PyQtSlot::invoke(void**, _object*, void*, bool) const (this=0x555556c759c0, qargs=<optimized out>, qargs@entry=0x7fffffff86c0, self=<optimized out>, self@entry=0x0, result=result@entry=0x0, no_receiver_check=<optimized out>) at ../../qpy/QtCore/qpycore_pyqtslot.cpp:159 #3 0x00007ffff4e12213 in PyQtSlot::invoke(void**, bool) const (no_receiver_check=<optimized out>, qargs=0x7fffffff86c0, this=<optimized out>) at ../../qpy/QtCore/qpycore_pyqtslot.cpp:78 #4 PyQtSlotProxy::unislot(void**) (qargs=0x7fffffff86c0, this=0x555557193e20) at ../../qpy/QtCore/qpycore_pyqtslotproxy.cpp:205 #5 PyQtSlotProxy::unislot(void**) (qargs=0x7fffffff86c0, this=0x555557193e20) at ../../qpy/QtCore/qpycore_pyqtslotproxy.cpp:186 #6 PyQtSlotProxy::qt_metacall(QMetaObject::Call, int, void**) (this=0x555557193e20, _c=<optimized out>, _id=0, _a=0x7fffffff86c0) at ../../qpy/QtCore/qpycore_pyqtslotproxy.cpp:170 #7 0x00007ffff48bd91d in doActivate<false>(QObject*, int, void**) (sender=0x555556b3d680, signal_index=28, argv=0x7fffffff86c0) at kernel/qobject.cpp:3945 #8 0x00007fffeff96aca in QFileSystemModel::directoryLoaded(QString const&) (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qfilesystemmodel.cpp:272 #9 0x00007ffff48b0be0 in QObject::event(QEvent*) (this=this@entry=0x555556b3d680, e=e@entry=0x7fff0c004af0) at kernel/qobject.cpp:1347 #10 0x00007fffeff962ab in QFileSystemModel::event(QEvent*) (this=this@entry=0x555556b3d680, event=event@entry=0x7fff0c004af0) at dialogs/qfilesystemmodel.cpp:1748 #11 0x00007ffff070995c in sipQFileSystemModel::event(QEvent*) (this=0x555556b3d680, a0=0x7fff0c004af0) at /usr/src/debug/pyqt5/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQFileSystemModel.cpp:376 [...] #23 0x00007ffff4da94ce in meth_QCoreApplication_processEvents(PyObject*, PyObject*, PyObject*) (sipArgs=<optimized out>, sipKwds=0x0) at /usr/src/debug/pyqt5/PyQt5-5.15.7/build/QtCore/sipQtCoreQCoreApplication.cpp:590 [...] from pytest-qt in Python: Current thread 0x00007fb366207740 (most recent call first): File ".../pytestqt/plugin.py", line 209 in _process_events File ".../pytestqt/plugin.py", line 171 in pytest_runtest_setup [...] File ".../pytest/src/_pytest/runner.py", line 115 in pytest_runtest_protocol [...] File ".../pytest/src/_pytest/main.py", line 317 in pytest_cmdline_main [...] Introduced by this change in pytest, which now deletes the temporary directory after the test by default: https://github.com/pytest-dev/pytest/pull/10517 It sounds like something odd like the directory removal causing (Py)Qt to call the lambda, but the underlying Python object already being gone or something along those lines. With a proper Qt slot (@pyqtSlot), PyQt seems to do the right thing, so let's just use that instead...
2022-12-06bleeding tests: Downgrade broken mesaFlorian Bruhin
See https://archlinux.org/packages/extra/x86_64/mesa/download/
2022-12-05app/mainwindow: Delay .show() calls until after tabs are addedFlorian Bruhin
With Qt 6.4, QtWebEngine closes/reopens the main window to switch the RHI rendering mode when a QWebEngineView gets added: https://github.com/qt/qtbase/blob/v6.4.1/src/widgets/kernel/qwidget.cpp#L10706-L10709 To avoid this, we need to make sure we only call .show() *after* adding a tab, similarly to what Qt did too: https://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=d7e0fd5304ebdb12c6f809cdbcf8193b49b9ecd2 See #7504 ---- This commit handles changes around app.py/mainwindow.py, which was probably the most complex one of the whole set (and also involving the oldest code I bet...). This changes a couple of intertwined things: - app._process_args() now needs to take track of the window it opened (if any), so that it can call .show() on it *after* opening pages. * If a session was loaded instead, sessions.py takes care of showing it. * The setActiveWindow call was also moved for simplicitly. Before, it was called even with --nowindow given, but that doesn't really make much sense. * I'm not actually sure why the .setActiveWindow() call is there. Qt docs say "Warning: This function does not set the keyboard focus to the active widget. Call QWidget::activateWindow() instead.". It was added back in 2014: ae44aa01a6d7d6f2e2b2e97a48f49a579f342c9f ("Set initial focused window correctly."). It's possible it's not needed anymore, but that's for a separate commit. - app.process_pos_args() now gets a MainWindow (rather than win_id) from mainwindow.get_window(), and is responsible for calling .show() and .maybe_raise() on it when nothing else does (like open_url called from it). * To preserve existing behavior (and not fail tests), it also still calls .maybe_raise() when a command was given. Maybe we should get rid of this to fix #5094, but that's for a separate commit. * Note it does *not* call .show(). That's taken care of later in _process_args() already. - app.open_url() can directly show the window, because it already opens a URL. It now still returns the MainWindow object for consistency. Also gets rid of some questionable objreg usage just to access a tabbed browser, as a tiny step towards #640. - Similarly, app._open_startpage() could have stayed, but now also takes a MainWindow and uses objreg a bit less. - open_desktopservices_url also takes care of the show/raise (as this gets called isolated from Qt), and also avoids objreg stuff where an attribute access would have sufficed... - mainwindow.get_window() now doesn't show the window anymore, and returns the mainwindow object instead of a window ID. * However, this means it can't actually raise the window anymore (it needs to be shown first). - To keep the decision about whether to raise the window in a central place, MainWindow now has a new should_raise attribute and maybe_raise() method. mainwindow.get_window() sets should_raise accordingly, and the caller is responsible to call .maybe_raise() after showing.
2022-12-05mainwindow: Don't call qapp.alert on deleted windowsFlorian Bruhin
I got an exception there while running tests with the refactored code. I don't quite understand how/why it changed, but it seems sensible to skip this too if we skipped calling calling .activateWindow() due to it being deleted. See 2fd21bb16bdc1f0c3f719c572271cc730c02c7a6
2022-12-05Delay browser.commands .show() calls until after tabs are addedFlorian Bruhin
With Qt 6.4, QtWebEngine closes/reopens the main window to switch the RHI rendering mode when a QWebEngineView gets added: https://github.com/qt/qtbase/blob/v6.4.1/src/widgets/kernel/qwidget.cpp#L10706-L10709 To avoid this, we need to make sure we only call .show() *after* adding a tab, similarly to what Qt did too: https://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=d7e0fd5304ebdb12c6f809cdbcf8193b49b9ecd2 See #7504 ---- This commit handles browser.commands, in particular the "_new_tabbed_browser" convenience method (which is now, sadly, likely less convenient).
2022-12-05Delay various .show() calls until after tabs are addedFlorian Bruhin
With Qt 6.4, QtWebEngine closes/reopens the main window to switch the RHI rendering mode when a QWebEngineView gets added: https://github.com/qt/qtbase/blob/v6.4.1/src/widgets/kernel/qwidget.cpp#L10706-L10709 To avoid this, we need to make sure we only call .show() *after* adding a tab, similarly to what Qt did too: https://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=d7e0fd5304ebdb12c6f809cdbcf8193b49b9ecd2 See #7504 ---- This commit handles various simple and isolated cases. Things requiring a bit more refactoring are handled in a separate commit.
2022-12-05browser.command: Fix some type annotationsFlorian Bruhin
2022-12-05Merge pull request #7508 from qutebrowser/update-dependenciesFlorian Bruhin
Update dependencies
2022-12-05Update dependenciesqutebrowser bot
2022-12-01Fix minimum version for Array.at quirkFlorian Bruhin
2022-12-01tests: Use set comprehensionsFlorian Bruhin
2022-11-29ci: Deactivate Qt 6.4 for nowFlorian Bruhin
Still some stuff broken sadly, see #7314
2022-11-29Add missing setting entry for array-at quirkFlorian Bruhin
(cherry picked from commit 39e577c36eef9892165a6979c403e9b2d9bc239c)
2022-11-29Add missing setting entry for array-at quirkFlorian Bruhin
2022-11-29Add tests to make sure quirk files/declaration/settings matchFlorian Bruhin
2022-11-29qt 6: Remove old JS quirksFlorian Bruhin
We don't support Qt 5.12 anymore, so those can go.
2022-11-29Add a quirk for Array.atFlorian Bruhin
Trivial to polyfill, needed by various pages in the wild, and only natively available with Qt 6.2. Closes #7501 Also see #7237 and 726d5e614b1f80c339084eba7d1c240bf467fa9b (cherry picked from commit ce64e5d899666bd469bf07bd0fecbc75d4bfed3a)