Open BiggestGoos opened 4 weeks ago
Regarding your last error I have implemented a fix that should fix it. I'll release it soon.
Regarding the viewport size, I suspect that is an Anki upstream bug. Does it happen in this cases?
Same question for the 'Show all windows' buttons not working, can you try out with the two conditions above?
Same question for the 'Show all windows' buttons not working, can you try out with the two conditions above?
I'm not really sure how I would test the 'Show all windows' button when "all addons [are] disabled" or the "minimize to tray addon [is] disabled"?
Regarding the viewport size, I am only experiencing it when 'Minimize to tray' is enabled and other addons don't seem to affect it.
I just now realized that all of these problems only seem to occur when an Anki window is maximized (I don't know how I didn't notice sooner). When any Anki window (including things like the browse window it seems) are maximized then, whenever Anki is currently minimized to tray and the monitor changes in some way (e.g. resolution is changed or goes into sleeping mode), the maximized windows reappear without me prompting them to, and they (sometimes, sometimes not,) become a bit weird with a black bar at the bottom. After they have reappeared, those windows don't work like normally anymore.
I also tried to see if the windows being minimized had any effect but it seems to work completely as expected when that is the case.
I also just now realized that if I press the tray icon after a window has reappeared like I described, the window is fixed and returns to normal. This only seems to work if the X button isn't pressed first. If the X button is pressed before doing so it seems that the window can't be returned to normal and the only solution I have found is to restart Anki.
These two last points were tested with only the 'Minimize to tray' addon enabled. All the problems only seemed to occur, as described, when a window was maximized.
I also managed to produce another error that seems similar to the last one I posted:
'Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.19045
Traceback (most recent call last): File "C:\Users\user\AppData\Roaming\Anki2\addons21\85158043__init.py", line 53, in onActivated self.showAll() File "C:\Users\user\AppData\Roaming\Anki2\addons21\85158043__init__.py", line 71, in showAll self._showWindows(self.explicitlyHiddenWindows) File "C:\Users\user\AppData\Roaming\Anki2\addons21\85158043\init__.py", line 88, in _showWindows if w.isMinimized() == Qt.WindowState.WindowMinimized: RuntimeError: wrapped C/C++ object of type Browser has been deleted
===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Minimize to tray ['85158043', 2023-11-26T20:18, 'None', '']'
I find that the way to produce this specific error is to have the browse window maximized (it seems that it doesn't matter if the main window is maximized or not), then I close the main window so that anki is minimized to tray, then I update a monitor setting and after the browse window has reappeared (like how I have described earlier) I close the browse window. After that I then click the Anki tray icon and this error occurs.
For now, a simple solution for me seems to be to not have Anki maximized when I minimize it to tray.
This happens on Windows 10 with Anki
Whenever my monitor turns off (goes into sleep mode) or I change any sort of setting such as resolution or scale while Anki is minimized using this plugin, the main Anki window reappears (only the main window it seems). After this, both the X button on the window as well as the 'Show all windows' button on the tray icon popup stops working. The main window also seems to stop updating the viewport size which means that when the window is resized, all buttons and text becomes offset like this: (The offset buttons also stop working when this happens.)
I realized that if you change the scale of the monitor to make this happen and then change it back to the old one then the buttons start working again but they still become offset when the window is resized. The button selection still doesn't work either.
I also managed to produce this error: (only once though and I'm not sure how to reproduce, I was just messing around with the tray icon after I hade changed my monitor settings)
'Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.19045
Traceback (most recent call last): File "C:\Users\user\AppData\Roaming\Anki2\addons21\85158043__init__.py", line 71, in showAll self._showWindows(self.explicitlyHiddenWindows) File "C:\Users\user\AppData\Roaming\Anki2\addons21\85158043__init__.py", line 88, in _showWindows if w.isMinimized() == Qt.WindowState.WindowMinimized: RuntimeError: wrapped C/C++ object of type CustomLabel has been deleted'
Also here are my active addons incase they might be part of the issue. (It might be worth testing this without any other addons active.)
'Anki Preview Reloader ['571150035', 2023-11-20T20:15, '1.0.1', ''] AnkiConnect ['2055492159', 2024-07-26T06:55, 'None', mod] AnkiWebView Inspector ['31746032', 2023-06-27T21:26, 'None', ''] Contanki - Controller Support for Anki beta ['1898790263', 2024-03-01T02:22, 'v1.0.2', ''] Deck duplication ['1779572689', 2022-06-11T16:24, 'None', ''] FSRS Helper Postpone Advance Load Balance Easy Days Disperse Siblings ['759844606', 2024-10-10T04:36, 'None', mod] HyperTTS - Add speech to your flashcards ['111623432', 2024-10-04T04:54, 'None', mod] Local Audio Server for Yomichan ['1045800357', 2023-06-19T05:57, 'None', ''] Minimize to tray ['85158043', 2023-11-26T20:18, 'None', ''] OpenInExternalEditorRenameDuplicate for ImageAudioVideo WinLinux ['1560623518', 2023-03-19T18:33, 'None', ''] Review Heatmap ['1771074083', 2022-06-30T03:43, 'None', '']'