qt: Cannot create window: no screens available

gaul's Avatar

gaul

26 May, 2020 12:41 AM

When running Anki for several days I notice that it unexpectedly exits. I ran it under pdb and found:

$ python3 -m pdb /bin/anki
> /bin/anki(3)<module>()
-> import sys
(Pdb) run
Restarting /bin/anki with arguments:
        /bin/anki
> /bin/anki(3)<module>()
-> import sys
(Pdb) c
qt: QSocketNotifier: Can only be used with threads started with QThread
mpv not found, reverting to mplayer
qt: Wayland does not support QWindow::requestActivate()
qt: Wayland does not support QWindow::requestActivate()
qt: Wayland does not support QWindow::requestActivate()
qt: Wayland does not support QWindow::requestActivate()
qt: Wayland does not support QWindow::requestActivate()
qt: Wayland does not support QWindow::requestActivate()
qt: QPaintDevice::metrics: Device has no metric information
qt: QQuickWidget: Cannot render due to failing makeCurrent()
qt: QPaintDevice::metrics: Device has no metric information
qt: QQuickWidget: Cannot render due to failing makeCurrent()
qt: QPaintDevice::metrics: Device has no metric information
qt: QQuickWidget: Cannot render due to failing makeCurrent()
qt: QPaintDevice::metrics: Device has no metric information
qt: QPaintDevice::metrics: Device has no metric information
qt: QQuickWidget: Cannot render due to failing makeCurrent()
qt: QQuickWidget: Cannot render due to failing makeCurrent()
Caught exception:
  File "/usr/share/anki/aqt/progress.py", line 72, in handler
    func()
  File "/usr/share/anki/aqt/main.py", line 1009, in onRefreshTimer
    self.deckBrowser.refresh()
  File "/usr/share/anki/aqt/deckbrowser.py", line 31, in refresh
    self._renderPage()
  File "/usr/share/anki/aqt/deckbrowser.py", line 88, in _renderPage
    self.__renderPage(None)
  File "/usr/share/anki/aqt/deckbrowser.py", line 95, in __renderPage
    self.web.stdHtml(self._body%dict(
  File "/usr/share/anki/aqt/webview.py", line 295, in stdHtml
    </html>""".format(self.title, self.zoomFactor(), self._getWindowColor().name(),
  File "/usr/share/anki/aqt/webview.py", line 198, in zoomFactor
    dpi = screen.logicalDpiX()
<class 'AttributeError'>: 'NoneType' object has no attribute 'logicalDpiX'
qt: Cannot create window: no screens available
Aborted (core dumped)

I run Version 2.1.15 (442df9d6) using Qt 5.13.2 PyQt 5.13.2 on Fedora 32.

  1. Support Staff 1 Posted by Damien Elmes on 26 May, 2020 09:55 AM

    Damien Elmes's Avatar

    Looks like a Qt bug I'm afraid. If you can reproduce it in a different Qt app, you could report it to the Qt developers.

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac