Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ option('avif_screenshots', type: 'feature', description: 'Support for
option('input_emulation' , type: 'feature', description: 'Support for XTest/Input Emulation with libei')
option('enable_gamescope', type : 'boolean', value : true, description: 'Build Gamescope executable')
option('enable_gamescope_wsi_layer', type : 'boolean', value : true, description: 'Build Gamescope layer')
option('enable_gamescope_scripting', type : 'boolean', value : true, description: 'Gamescope Lua scripting support')
option('enable_openvr_support', type : 'boolean', value : true, description: 'OpenVR Integrations')
option('benchmark', type: 'feature', description: 'Benchmark tools')
2 changes: 2 additions & 0 deletions src/Backends/DRMBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2242,6 +2242,7 @@ namespace gamescope
m_Mutable.ValidDynamicRefreshRates.clear();
m_Mutable.fnDynamicModeGenerator = nullptr;
{
#if HAVE_SCRIPTING
CScriptScopedLock script;

auto oKnownDisplay = script.Manager().Gamescope().Config.LookupDisplay( script, m_Mutable.szMakePNP, pProduct->product, m_Mutable.szModel, m_Mutable.szDataString );
Expand Down Expand Up @@ -2341,6 +2342,7 @@ namespace gamescope
}
}
else
#endif
{
// Unknown display, see if there are any other refresh rates in the EDID we can get.
if ( GetScreenType() == GAMESCOPE_SCREEN_TYPE_INTERNAL || cv_drm_allow_dynamic_modes_for_external_display )
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,12 @@ int main(int argc, char **argv)
fprintf( stderr, "Tracing is enabled\n");
}

#if HAVE_SCRIPTING
{
gamescope::CScriptScopedLock script;
script.Manager().RunDefaultScripts();
}
#endif

XInitThreads();
g_mainThread = pthread_self();
Expand Down
7 changes: 5 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ src = [
'Utils/TempFiles.cpp',
'Utils/Version.cpp',
'Utils/Process.cpp',
'Script/Script.cpp',
'BufferMemo.cpp',
'steamcompmgr.cpp',
'convar.cpp',
Expand Down Expand Up @@ -150,7 +149,11 @@ gamescope_cpp_args += '-DHAVE_AVIF=@0@'.format(avif_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_LIBCAP=@0@'.format(cap_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_LIBEIS=@0@'.format(eis_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_LIBSYSTEMD=@0@'.format(libsystemd_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_SCRIPTING=1'

if get_option('enable_gamescope_scripting')
gamescope_cpp_args += '-DHAVE_SCRIPTING=1'
src += ['Script/Script.cpp']
endif

src += spirv_shaders
src += protocols_server_src
Expand Down
3 changes: 2 additions & 1 deletion src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8605,11 +8605,12 @@ steamcompmgr_main(int argc, char **argv)
hasRepaint = false;
hasRepaintNonBasePlane = false;
nIgnoredOverlayRepaints = 0;

#if HAVE_SCRIPTING
{
gamescope::CScriptScopedLock script;
script.Manager().CallHook( "OnPostPaint" );
}
#endif
}

if ( bIsVBlankFromTimer )
Expand Down