# \[Bug\] Note Types window moves down every time it is opened

**URL:** <https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248>\
**Category:** Help\
**Created:** [January 11, 2025, 6:07pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248 "2025-01-11T18:07:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankilover](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@ankilover](https://forums.ankiweb.net/u/ankilover)\
**Post date:** [January 11, 2025, 6:07pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/1 "2025-01-11T18:07:43Z")

</div>

Every time the Note Types window (Tools \> Manage Note Types) is opened, it moves exactly 31 pixels down (on a 1080p monitor at least) in comparison to the previous instance until it eventually reaches the bottom of the screen and cannot go any further.

 ![Open #1](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/0/c0cf940957f2196b38fa82eb296e0d6f71c54127.png)

 ![Open #2](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/3/5/35ec06a6516b6b6c9a178e70cd37bd7d589fc421.png)

 ![Open #3](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/e/6/e6ee6f60ff385ce3d48d8a76949016977aee65bb.png)

 ![Open #?](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/7/c7b0e505c2d72987c212a7a2938ecad5d7140bc3.png)

Tested using Anki 24.11 on Windows 11.

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [January 11, 2025, 6:10pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/2 "2025-01-11T18:10:32Z")

</div>

Can confirm on debian linux (oldstable).

Funny bug you found!

---

<div class="post-metadata">

**Author:** ![rossgb](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rossgb/32/23908_2.png) [@rossgb](https://forums.ankiweb.net/u/rossgb)\
**Post date:** [January 11, 2025, 6:58pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/3 "2025-01-11T18:58:46Z")

</div>

That suspiciously seems to be the exact height of of the window title bar.

I wonder if when Anki shows the window it is using the wrong property / doing some incorrect maths which does not include the title bar.

---

<div class="post-metadata">

**Author:** ![rossgb](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rossgb/32/23908_2.png) [@rossgb](https://forums.ankiweb.net/u/rossgb)\
**Post date:** [January 11, 2025, 7:58pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/4 "2025-01-11T19:58:33Z")

</div>

I made a fix:

> <https://github.com/ankitects/anki/pull/3718>
>
> Fixes this bug:
> 
> https://forums.ankiweb.net/t/bug-note-types-window-moves-down…-every-time-it-is-opened/54248
> 
> Setting window flags seems to make the window move down by the title bar height, so you have to restore geometry after setting them.
> 
> N.B. There may be similar bugs elsewhere, I have not checked all dialogs.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [January 11, 2025, 8:25pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/5 "2025-01-11T20:25:44Z")

</div>

Thanks for taking quick action!

I haven’t looked at your code – but were you able to identify some change in 24.11 (or 24.06.3) that would have caused this – for this one window or for many? It seems like if it’s not happening in earlier versions [e.g. I can’t reproduce it in 24.06.2] – it would be good to identify the root of the issue.

---

<div class="post-metadata">

**Author:** ![rossgb](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rossgb/32/23908_2.png) [@rossgb](https://forums.ankiweb.net/u/rossgb)\
**Post date:** [January 11, 2025, 8:37pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/6 "2025-01-11T20:37:02Z")

</div>

This specific bug seems to have been caused in this commit (on 2024-08-05):

> <https://github.com/ankitects/anki/commit/b1bf1c3141863585989d5d541a73edb0265f866a>
>
> Co-authored-by: Christian Donat \<cdonat@tu-berlin.de\>

Setting window flags seems to make the window move down by the title bar height, so you have to restore geometry after setting them.

There may be similar bugs elsewhere, I have not checked all dialogs.

From a quick search there does not seem to be any other calls to `setWindowFlags(...)` in a dialog’s constructor, but modifying the window in other ways after restoring geometry might cause a similar bug.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [January 11, 2025, 9:25pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/7 "2025-01-11T21:25:30Z")

</div>

Great! That puts definitely as new in 24.11.

If I understand things in GitHub correctly (which is usually about 50/50 😅), it looks like that change was meant to give maximize buttons to a certain set of windows. If that same set of windows has this moving-down problem, your fix should probably fix it for them too, right?

> [@Add maximize buttons to Note Types editor](https://forums.ankiweb.net/t/add-maximize-buttons-to-note-types-editor/43803):
>
> Some things do not fit, so the window needs to be resized, but there is no maximize button. Examples of what does not fit: Tools → Manage Note Types: horizontally and vertically Fields vertically Options the default texts fit

---

<div class="post-metadata">

**Author:** ![rossgb](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rossgb/32/23908_2.png) [@rossgb](https://forums.ankiweb.net/u/rossgb)\
**Post date:** [January 11, 2025, 9:37pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/8 "2025-01-11T21:37:20Z")

</div>

That change only affected (and introduced the bug in) the “Note Types” window.

It is possible that other dialogs/windows have similar bugs, but with slightly different causes. The main ones (Add/Browse/Stats) seem fine, but I haven’t bothered to check every dialog.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [January 11, 2025, 9:40pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/9 "2025-01-11T21:40:03Z")

</div>

Thanks for helping me close the loop on that!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [February 10, 2025, 9:40pm UTC](https://forums.ankiweb.net/t/bug-note-types-window-moves-down-every-time-it-is-opened/54248/10 "2025-02-10T21:40:12Z")

</div>

Closed on February 10, 2025, 9:40pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
