Task switcher: keep sort order constant after switching windows

Hi all! First time poster here!

After returning to Linux I decided to give KDE a try, so far I really like the environment, but I have one major gripe, which I also had in cinnamon a few years ago.

Current situation

Lets say I have four windows open [A, b, c, d] with window A being the active one and b, c and d being inactive. When I alt tab and make window c active, the ordering of the windows in the task switcher turns into [C, a, b, d] and when I then go to d the order becomes [D, c, a, b].

What I am looking for

I would like the order of the windows in the task switcher list to stay the same before and after shifting focus, i.e. with the list [A, b, c, d] I shift my focus to C and get [a, b, C, d]. I then alt tab once and end up with D as the active window and the list looking like [a, b, c, D].

What I have tried

Changing the sort order in the GUI doesn’t do what I want, as the active window still shifts to the start of the list.

I found a this a thread on stack overflow: How do I stop KDE from changing the alt-tab order of minimized windows? (I cannot link it since I am a new user and have some very reasonable limits on what I can do).

Anyway, the stack overflow it lead me to install the kdesrc-build tool as described on the KDE Develper site and building kwin from scratch once to make sure all dependencies were setup correctly. I then tried editing the kde/src/kwin/src/focuschain.cpp file, but after two separate attempts I still can’t figure it out. My background with C++ is however limited to one (bad) class in college 4 years ago so I am not surprised. The changes are mirrored here on github under Herandom/kwin/blob/master/src/focuschain.cpp

The command I used for building was kdesrc-build --no-src --no-include-dependencies kwin.

Final section

Am I completely on the wrong track here? Is there anyone that can give me a pointer in the right direction, or spot any error I made? As I mentioned, C++ is not my strongest language and I mostly just threw some things at the wall, sadly nothing stuck.

As a final note, if anyone is able to help me and we figure this out, I am open to the idea of trying to get this into KDE as an option for all users, though I assume it might be quite an undertaking.

Any help or comments would be greatly appreciated.