New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vo_gpu: d3d11: add support for exclusive fullscreen #6329
Conversation
dfd79b3
to
f071e57
Compare
It seems to work, but the code still requires some stabs as f.ex. the fullscreen→!fullscreen transition happens without calling that function at all. |
0d9a2ac
to
a9c8b73
Compare
OK, now things mostly work if we leave out the capability of switching (within full-screen mode) between exclusive and non-exclusive. Also the logging could be lessened by querying the exclusive full-screen mode in the setting function, but I decided to not do that for now. The main thing that I'd like to get done before pushing this upstream is to make |
Alright, initial |
grep "VOCTR" $(git grep --files-with-matches "ra_ctx_fns")
video/out/d3d11/context.c: if (request == VOCTRL_FULLSCREEN ||
video/out/opengl/context_drm_egl.c: case VOCTRL_GET_DISPLAY_FPS: {
video/out/opengl/context_rpi.c: case VOCTRL_SCREENSHOT_WIN:
video/out/opengl/context_rpi.c: case VOCTRL_FULLSCREEN:
video/out/opengl/context_rpi.c: case VOCTRL_CHECK_EVENTS:
video/out/opengl/context_rpi.c: case VOCTRL_GET_DISPLAY_FPS: These are the similar files that poke ┐(´д`)┌ I think I will remove the VOCTRL now since the first commit should always send an event to us in case fullscreen state gets switched. edit |
Alright, only listening to the event given out by the w32 common code now, and it still works just as well. Noticed that going out of full screen has some weirdness in there compared to non-exclusive mode, probably there's some funkiness happening. Not a major bugbear though... |
Sudden DPI resize? |
Nah, that was just generic logging as far as I can tell. Just the previous width/height coming up due to an additional resize event. Non-exclusive osc init to osc init
Exclusive osc init to osc init
|
OK, so after leaving exclusive FS you get WM_MOVE and WM_SIZE with what the fullscreen size was - or what the fitting size for it would be on the screen. |
Alright, so what I didn't mention here is that I think I figured what was happening. If you are going into exclusive FS then Windows will attempt to do the resize back to original size for you (instead of you doing it). Thus what was happening was:
Thus what's left is:
|
@jeeb same thing as the HDR PR I guess. |
Well, you could also do what the original code did by entering fullscreen after vo_w32_control() and leaving fullscreen before vo_w32_control(). Lines 199 to 211 in a134537
The code is kind of ugly, but it has the advantage of making w32_common.c responsible for positioning the window, which should allow the --fs-screen option to work correctly, moving mpv to the correct screen when entering fullscreen and moving it back to the screen it was on when leaving. |
Will there be an option to disable this? |
As implemented, it's off by default (as it should). |
Good to know, thanks. I have that problem with opengl and vulkan. I can't disable exclusivity, and I have a use case in which that causes a problem, and stops me from using them. |
Ye,s it's known that OpenGL drivers on Windows typically enable exclusive fullscreen, but this has nothing to do with this PR, and the player has no control over them. I don't know about Vulkan, but since it's gamer idiocy and outside of the winapi graphics ecosystem, I wouldn't be surprised if the drivers behaved exactly like OpenGL in this aspect. |
Thanks for the explanation. I very much appreciate all the work that you guys do. |
Yes, there is no borderless mode with AMD and Vulkan on Windows. With Nvidia, it always uses DWM direct mode instead. Edit: The Nvidia part is not true anymore. |
4e13ce8
to
85b1d86
Compare
Updated to work with the switch from events to config cache (finally). This brings us to the state that we were working with before. Now back to the finishing this up:
Basically, if d3d11 fullscreen is utilized, |
Does it really do that? Or does it just leave the window alone and use the screen for the d3d surface? Is there a conflict if we resize the window etc. ourselves?
Not sure what that means. |
The difference between the two behaviors. "resize window: XxY" is when the window receives a resize message from the OS (both ours and the OS's). Exclusive FS:
Normal FS:
|
i was looking forward for this option |
b73255a
to
869484a
Compare
Lets the application fully control the rendering onto the screen instead of the compositor.
Update the cache whenever we utilize p->opts, as recommended by wm4.
Alright, after discussions with @wm4 this seems to be in a good enough state and with the hacky timing of things going back from full screen actually works now. I think we all agree that while imperfect, we can now take this in. |
Picked up from @rossy's box o' nifty features.
Lets the application fully control the rendering onto the screen
instead of the compositor.
Test build here.