Anki zooms out after awaking laptop from sleep

If I close the lid of my laptop when Anki is open, I find that the UI is sometimes zoomed out when I open the lid back. It is more likely to occur if I awake it after a longer period. Anki is still usable in this state, only the UI is small. To fix the issue, I have to restart Anki.



This issue is reproduced on both Anki 24.11 and Anki 25.01 beta. I tried different video drivers. The issue happens with Direct3D, OpenGL and Vulkan. It doesn’t happen with Software, but I noticed some performance regression while using Software.

Platform: Windows-11-10.0.26100-SP0

1 Like

I think just resizing the window is enough to solve it, at least for me.

On debian linux I can reproduce something like that very easily like this:

  1. Open anki.
  2. Press Ctrl+Shift+P to switch profile.
  3. Choose a profile and press open.
    Result:

Edit: If I use software instead of opengl I get the same behavior, except that the black part of the window gets transparent (so I can see the windows underneath anki).

Quite interesting. Switching profiles don’t reproduce the issue on my computer.
Also, I just discovered that pressing Ctrl + Shift + P or Ctrl + Shift + I doesn’t do anything on my computer. Maybe a 25.01 bug?

If I do it in a vm (debian sid) instead of debian oldstable then this issue doesn’t appear for me either. Here, the window will just resize to what I showed in the picture above, so that the window has the size of the displayed square without the black parts of it. I hope this explaination makes sense.

It works perfectly fine on my end (debian sid).

  1. If you look in the file menu, what shortcuts does it say there for you?
  2. Does it still not work if anki is in safemode?
  3. There have been issues for a long time with different keyboard layouts. Maybe you’re experiencing that? Although it would be weird if current stable works for you.

Forwarded this thread to Anki 25.01 Beta - #24 by NameLessGO

Please discuss there since it involves the beta version, this helps gathering bug reports on one post

Can’t replicate on mac 15.2, tried Software, OpenGL and Metal with the closing the lid and changing profile methods

1 Like

Since the main bug is not specific to the beta (I will confirm the keyboard shortcut issue), I don’t think that this needs to be reported there. Anyways, you have already reported.

1 Like

I confirmed that the Ctrl + Shift + P and Ctrl + Shift + I shortcuts don’t work for me on 24.11 either, even without add-ons. And the File menu mentions the same shortcuts.

1 Like

Try others shortcuts, seems like a Linux issue, are you using the anki version from the ankiweb/Github website, compiling from source, or alternative app stores such as flathub/snapcraft?

Edit: Oops my bad

@vaibhav is using windows. It works fine in linux.

I just remembered that I had remapped these shortcut keys using AutoHotKey for some other purpose. So, the keyboard shortcut issue is not an Anki issue per se. Sorry for the trouble.

2 Likes

I had no idea that they stay remapped even after booting to safemode. Very good to know!

Do you mean booting Windows in safe mode? I didn’t try that. That will most probably undo the remapping because AHK needs to be running in the background to remap the shortcuts. I just tried to launch Anki while holding Shift.

Yes, that’s ankis safemode that I was talking about. It just didn’t occur to me that the modified shortcut keys would work if the extension isn’t loaded.

AHK is an OS-level software, not an Anki add-on. It’s a very popular tool among power users on Windows, but since you are on Linux, I am not very surprised that you are not aware about it.

1 Like

Oh, I see. Thanks for clarification!

For me, resizing the window removes the black borders but the UI still remains zoomed out. Resetting zoom doesn’t help.

Interesting. I wonder why that happens though.

I don’t think it is a firmware or driver issue, since switching to software also causes issues. But is it an issue with anki or with qt? Or maybe something entirely different?

I’d like to do more testing on this but have no idea where to start. It’s also triggered inconsistently for the both of us:

  • I do not experience issues after waking up from sleep but you do.
  • For me resizing the window solves it, for you it doesn’t.
  • I can reproduce this easily on debian oldstable by switching profiles. You cannot reproduce it on windows and I cannot reproduce it in debian sid (which is much newer but also in a vm, maybe that interferes somehow).
1 Like

For me, the issue resolves when using Software but there is a performance regression. But, for you, using Software doesn’t solve the issue (as you mentioned earlier), which is yet another inconsistency.

1 Like

Another observation:
When the issue happens, closing and opening the lid again resolves the issue.

1 Like

As said above, I do not have this issue after waking up. I did produce something visually similar though (as described above) and tried if it disappears for me after closing and opening the lid – it doesn’t. Yet another inconsistency that I wish I knew how to debug.