migaku-official / Migaku-Anki-Addon

GNU General Public License v3.0
13 stars 1 forks source link

Migaku Dictionary Search Hotkey Crashes Anki with 2.1.65 Qt6 #56

Closed MinmoTech closed 1 year ago

MinmoTech commented 1 year ago

Description

User RetKhan reports an issue when using the Migaku Dictionary search hotkey. The bug persists even after installing the latest update. It seems to cause Anki to crash, but the search is still performed correctly in the Migaku dictionary.

Steps to Reproduce

  1. Launch Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0 on Windows-10-10.0.19045
  2. Select text
  3. Use the global hotkey for quick search in the Migaku dictionary (ctrl+alt+meta(windows key)+D by default)

image image

Anki Debug Info

Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
    Platform: Windows-10-10.0.19045
    Flags: frz=True ao=True sv=2
    Add-ons, last update check: 2023-06-13 18:22:08

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Migaku Anki Add-on ['1846879528', 2023-06-14T01:08, 'None', mod]
    Migaku Kanji GOD ['1872210448', 2023-06-14T01:12, 'None', mod]
    Speed Focus Mode auto-alert auto-reveal auto-answer ['1046608507', 2022-12-16T06:24, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    1046608507 1846879528 1872210448

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Review Heatmap ['review_heatmap', 2020-04-30T09:23, 'None', '']

Reference:

MinmoTech commented 1 year ago

@hgiesel

This seems to be the fix: https://discord.com/channels/752293144917180496/944336185029971978/1118602366825017494

can you stop anki, exec "echo angle > %appdata%\Anki2\gldriver6" in a command prompt, start anki and try again?

or: https://discord.com/channels/752293144917180496/944336185029971978/1118642695448055850

running "echo software > %APPDATA%\Anki2\gldriver6" in cmd seems to have fixed the issue, ty lads

hgiesel commented 1 year ago

It seems like Angle is no longer supported in Qt6

ANGLE is no longer shipped with Qt in Qt 6. quoted from:

https://doc.qt.io/qt-6/windows-graphics.html#details

Pasting "angle" into that file in Qt6 versions leads to Anki using software rendering instead of OpenGL rendering

As by this logic: https://github.com/ankitects/anki/blob/main/qt/aqt/profiles.py#L54-L55

Interestingly, Anki seems to have noticed these display issues as well, as they are documented here: https://docs.ankiweb.net/platform/windows/display-issues.html#qt6

Therefore, I'm not sure it's really our job to address this. Anki seems to have made the decision to go with OpenGL rendering by default, and it probably has its reasons for it. We can probably highlight the Anki information somewhere prominently?