Kodi Community Forum
WIP Windows DirectX 11 upgrade test thread - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
--- Thread: WIP Windows DirectX 11 upgrade test thread (/showthread.php?tid=218274)



RE: Windows DirectX 11 upgrade test thread - Shine - 2015-06-18

WOW, I just noticed - this patch also fixes Kodi minimizing as soon as it loses focus. This has been annoying me for YEARS and now I "accidentally" fixed it! I'm so happy now, I can't believe it!!


RE: Windows DirectX 11 upgrade test thread - afedchin - 2015-06-19

@Shine
Thank you for patch and link to original. But I think I've found a little better solution. Please try it https://github.com/afedchin/xbmc/commit/869b2a08db51031679173f469870a921f5090fc7

P.S. If you want know why this a little better I can explain in PM Smile


RE: Windows DirectX 11 upgrade test thread - Shine - 2015-06-19

From a brief test, it works. And yes, yours is better, since hijacking other threads isn't really good coding style and should be avoided if possible :-) I will keep testing yours and report back.

Yours doesn't have the side effect, though, that Kodi won't minimize anymore when losing focus. I've been trying to figure out what exactly causes this side effect in my patch, but so far, haven't succeeded.


RE: Windows DirectX 11 upgrade test thread - afedchin - 2015-06-19

It's strange because on my systems Kodi minimized successfully on killfocus.


RE: Windows DirectX 11 upgrade test thread - Shine - 2015-06-19

I mean the other way round. If Kodi is in True Full Screen and you focus any other window, Kodi will immediately minimize, not just lose focus. That's not what I want, since I want to be able to work normally on screen #0 while Kodi is playing stuff on screen #1. Kodi shouldn't minimize when losing focus, it should only minimize when I actually minimize it. This works in fake full screen mode, but not in true full screen. I accepted this behavior as an unchangeable shortcoming of D3D Full Screen mode during the past years. It worked in XBMC DSCodec (not to be confused with DSPlayer) because DSCodec was using EVR Presenter, not D3DFS, iirc.

So - I was (pleasantly) surprised when I noticed that my dirty hack from yesterday caused this annoying behavior to stop, while still using true full screen. I think I will analyze this a little more when I have some time.


RE: Windows DirectX 11 upgrade test thread - afedchin - 2015-06-19

If you was able to work on screen #0 while Kodi in full screen on screen #1 then Kodi is not in fullscreen actually. Kodi "thinks" what it stays in full screen but OS (DXGI actually) switch it silently to windowed mode. There is not possible ways to stay in true fullscreen if window is not foreground. Currently Kodi handles this and continue works.


RE: Windows DirectX 11 upgrade test thread - Shine - 2015-06-19

Then I guess this "silently going back to windowed mode" would be most desirable - since it performs like true full screen (no flicker, no stutter, no DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) but behaves like windowed mode (no auto-minimize). If I find a way to achieve this reliably, I'll let you know. Edit: see next post.

Hoping for your DX11 PR to get merged asap :-)


RE: Windows DirectX 11 upgrade test thread - afedchin - 2015-06-19

Something else causes flicker GUI, not windowed mode. I not be able to reproduce this.


RE: Windows DirectX 11 upgrade test thread - tungmeister - 2015-06-20

With the latest build the shadertoy screensaver isn't rendering correctly, it's stuttering and looks rather pixelated. The frame rate is being maintained correctly and there's no issues in a debug log but it's defiantly broken.


RE: Windows DirectX 11 upgrade test thread - Shine - 2015-06-20

(2015-06-19, 10:17)afedchin Wrote: If you was able to work on screen #0 while Kodi in full screen on screen #1 then Kodi is not in fullscreen actually. Kodi "thinks" what it stays in full screen but OS (DXGI actually) switch it silently to windowed mode. There is not possible ways to stay in true fullscreen if window is not foreground. Currently Kodi handles this and continue works.

Figured it out.

With my patch (if also using the test batch), Kodi can set topmost and full screen state, but somehow it ends up in WA_INACTIVE state. So neither a WM_KILLFOCUS nor a WM_ACTIVATE message will reach it when I focus another window, because it wasn't active in the first place. Therefore, it keeps running just like I want it to. With your patch, Kodi starts focussed/active, therefore all WMs will reach it and it behaves "as designed".

So if I remove all the WM_SETFOCUS/WM_KILLFOCUS and WA_INACTIVE handling, I get it to behave like I want it to, ie. I can work on display #0 while Kodi is in true full screen on display #1.

Is there a reason why you replicated the DX9 behavior "minimize-on-losing-focus" in the DX11 version, although not necessary?

Have a look at this patch: http://pastebin.com/HsTKWPzM
First commit could likely remove even more obsolete code, but I tried to remove as little as possible (for now).
As for the second commit, there might be a more elegant way to do it, but I don't really know anything about DirectX coding...


RE: Windows DirectX 11 upgrade test thread - bluechris - 2015-06-21

(2015-06-18, 21:52)Shine Wrote: WOW, I just noticed - this patch also fixes Kodi minimizing as soon as it loses focus. This has been annoying me for YEARS and now I "accidentally" fixed it! I'm so happy now, I can't believe it!!


Can someone help me to witch version to download? i want the exact effect as @Shine has atm. So far if i dont choose Fullscreen window when i touch anything in 2nd monitor KODI in 1st monitor minimizes... but if i Choose Fullscreen window i got paning and tearing etc... so which version i can download not to have that? Honestly i dont get it why this is happening... mpc-hc with madvr in exclusive mode permits me to do anything i want in 2nd monitor

Atm i am with KodiSetup-20150614-7bce580-dx11

Thx


RE: Windows DirectX 11 upgrade test thread - Shine - 2015-06-21

@bluechris: You will have to compile it yourself using afedchin's repo and apply the patch I posted above. Mind you, it's untested and might create other problems!


RE: Windows DirectX 11 upgrade test thread - NEOhidra - 2015-06-21

Kodi cannot start using KodiSetup-20150614-7bce580-dx11 (Jun 14)

Hardware: Windows 7 64bit, NVIDIA GT540M, driver-version 353.06
Debug Log: http://xbmclogs.com/pgemtay4a
Crashlog: https://www.dropbox.com/sh/6pfxckgepotgmv1/AACn9v4ywSIPvwHdqHuMUjy0a?dl=0
Description: Kodi wont start because of: "ERROR: Unable to create GUI. Exiting."


RE: Windows DirectX 11 upgrade test thread - Martijn - 2015-06-21

@afedchin
i left my test rig playing videos for couple of days. Just checked and it stopped working.
Could be that's an older build but who knows the dumps may be still of some use
https://dl.dropboxusercontent.com/u/7435592/crashdumps.zip

Care to rebase so i could build a new version and try?


RE: Windows DirectX 11 upgrade test thread - bluechris - 2015-06-21

(2015-06-21, 13:45)Shine Wrote: @bluechris: You will have to compile it yourself using afedchin's repo and apply the patch I posted above. Mind you, it's untested and might create other problems!

Oh i havent ever compiled... can you upload it somewhere m8?