when starting a HDR movie kodi.exe loses focus



hi everyone,

I am running windows desktop in 4k, 120hz, no hdr.

Using a LG OLED TV and a Denon AVR.

When I start Kodi and then start a HDR movie something seems to be amiss.

Kodi does not successfully switch the refresh rate of the display from 120hz to the movie matching refresh rate of 23.98hz.

I have only 2 explanations:

explanation 1: Kodi seems to lose the focus when switching HDR on. I have to Alt-Tab from Kodi away to Kodi to make the correct switch. Seen here:

Code:
17812:C:\Users\x\AppData\Local\Temp\7zO097C5E92\focus.exe | Wed May 29 21:13:23 2024
21344:C:\Program Files\Kodi\kodi.exe | Wed May 29 21:13:33 2024 <<<<<<< playback starts
8268:C:\Windows\explorer.exe | Wed May 29 21:14:24 2024
21344:C:\Program Files\Kodi\kodi.exe | Wed May 29 21:14:28 2024 <<<<<<< manual alt-tab-shift-tab-release
17812:C:\Users\x\AppData\Local\Temp\7zO097C5E92\focus.exe | Wed May 29 21:14:43 2024

explanation 2:
Kodi correctly switches the refresh rate from 120hz to 23.97hz but AFTER that switches SDR->HDR which reverts the refresh rate back to 120hz desktop setting. That would also explain why the TV needs like 25secs to show a picture…

Code:
2024-05-29 21:13:48.393 T:6260    debug <general>: CWinSystemWin32::SetFullScreen: (true fullscreen) with size 3840x2160, refresh 23.976023
2024-05-29 21:13:48.395 T:6260    debug <general>: DX:Big GrineviceResources::SetFullScreen: changing display mode to [email protected]

2024-05-29 21:13:53.946 T:6260     info <general>: CWIN32Util::ToggleWindowsHDR: Toggle Windows HDR On (OFF => ON).
2024-05-29 21:13:54.922 T:25552 warning <general>: CRenderManager::Configure - timeout waiting for configure
2024-05-29 21:13:54.935 T:6260    debug <general>: CWIN32Util::ToggleWindowsHDR: Previous graphics mode restored OK
2024-05-29 21:13:54.935 T:6260    debug <general>: DX:Big GrineviceResources::ToggleHDR: Re-create swapchain due HDR <-> SDR switch

2024-05-29 21:13:55.370 T:6260    debug <general>: CWinSystemWin32DX::FixRefreshRateIfNecessary: refreshRate: 120.0000, desired: 23.9760, deviation: 0.80020, fixRequired: no, 1

full log here: https://paste2.org/zDNFVenn