Open HanabishiRecca opened 1 month ago
I tackled the code and looks like it is pretty much impossible to disable libdrm
as Wayland backend really depends on it.
So it is easier to just drop drm_backend
option at this point. I.e. partially revert 67984a89c5092c4164baef3c1d27fb5d5f1e9fb3 and make it a hard dependency again.
As for sdl2_backend
, seems easy to fix:
diff --git a/src/main.cpp b/src/main.cpp
index 01dd8ca..3aa0ffc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -834,8 +834,10 @@ int main(int argc, char **argv)
case gamescope::GamescopeBackend::Wayland:
gamescope::IBackend::Set<gamescope::CWaylandBackend>();
+#if HAVE_SDL2
if ( !GetBackend() )
gamescope::IBackend::Set<gamescope::CSDLBackend>();
+#endif
break;
default:
abort();
diff --git a/src/wayland_backend.cpp b/src/wayland_backend.cpp
index c5b33cf..745cb35 100644
--- a/src/wayland_backend.cpp
+++ b/src/wayland_backend.cpp
@@ -1247,8 +1247,10 @@ namespace gamescope
return false;
}
+#if HAVE_SDL2
m_pDefaultCursorInfo = GetX11HostCursor();
m_pDefaultCursorSurface = CursorInfoToSurface( m_pDefaultCursorInfo );
+#endif
if ( g_bForceRelativeMouse )
this->SetRelativeMouseMode( true );
There's another backend for platforms not using libdrm that I haven't pushed up yet.
I think GetX11HostCursor should be moved into its own file, then that can be a proper fix for upstream
This seems to work. I'm not a C++ guy though, so I maybe did it wrong.
Edit: actually its easier to review it as a PR: #1350.
And another bit of improvement: #1351
drm_backend
andsdl2_backend
meson options are effectively useless right now as you can't disable them.When trying to build with
drm_backend=disabled
:When trying to build with
sdl2_backend=disabled
: