CreateDevice with Windowed=false fails on enterFullscreenMode with wayland
Playing C&C Generals Zero Hour on Ubuntu 25.10 fails to start in full screen with the following error:
info: D3D9DeviceEx::ResetSwapChain:
info: Requested Presentation Parameters
info: - Width: 1600
info: - Height: 900
info: - Format: D3D9Format::X8R8G8B8
info: - Auto Depth Stencil: true
info: ^ Format: D3D9Format::D16
info: - Windowed: false
info: - Swap effect: 1
err: SDL3 WSI: enterFullscreenMode: SDL_SetWindowPosition: wayland cannot position non-popup windows
err: D3D9: EnterFullscreenMode: Failed to enter fullscreen mode
err: D3D9: Failed to set initial fullscreen state
Tracing it down with a custom build of dxvk it seems disabling the call to set window position (only doing if not switching modes) here makes every thing work, though no idea what else that breaks.
https://github.com/doitsujin/dxvk/blob/36f23aa729036d51a093c9dbc724135c5c794f5c/src/wsi/sdl3/wsi_window_sdl3.cpp#L96
if (!ModeSwitch && !SDL_SetWindowPosition(window, bounds.x, bounds.y)) {
Logger::err(str::format("SDL3 WSI: enterFullscreenMode: SDL_SetWindowPosition: ", SDL_GetError()));
return false;
}
Software information
C&C Generals Zero Hour (Linux native build) https://github.com/Fighter19/CnC_Generals_Zero_Hour
System information
- GPU: NVIDIA 2070 Ti
- Driver: 580 proprietary
- Wine version: None (native build)
- DXVK version: 20600
Hm, yeah, if the game is trying to start in full-screen mode with a non-default resolution, then there's going to be a problem since we can't do mode switches on wayland, but DXVK is also not in any position to "emulate" arbitrary resolutions.
I guess one thing to explore is whether or not only reporting the current display mode to the app fixes the problem, but that creates even more fun issues since we don't really know if we're on Wayland or not, and games may not necessarily be happy with whatever display mode you're running either.
Is the idea of this logic to make the window the same size as the screen and pin it to the top corner?
Seems on wayland that moving the window is disallowed and might need to check the error code if that is the case and just resize the window instead.
Ive also notice this same issue when steam launches the windows version of the same game using wine.