File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -381,9 +381,15 @@ endif
381381
382382have_xwayland_initfd = false
383383if have_wayland
384+ xwayland_dep = dependency (' xwayland' , required : false )
385+
384386 xwayland_path = get_option (' xwayland_path' )
385387 if xwayland_path == ''
386- xwayland_path = find_program (' Xwayland' ).path()
388+ if xwayland_dep.found()
389+ xwayland_path = xwayland_dep.get_pkgconfig_variable(' xwayland' )
390+ else
391+ xwayland_path = find_program (' Xwayland' ).path()
392+ endif
387393 endif
388394 cdata.set_quoted(' XWAYLAND_PATH' , xwayland_path)
389395
@@ -398,9 +404,15 @@ if have_wayland
398404
399405 # For Xwayland -initfd usage
400406 use_initfd = get_option (' xwayland_initfd' )
407+ if xwayland_dep.found()
408+ xwayland_supports_initfd = xwayland_dep.get_pkgconfig_variable(' have_initfd' ) == ' true'
409+ else
410+ xwayland_options = run_command (xwayland_path, ' -help' )
411+ xwayland_supports_initfd = xwayland_options.stderr().contains(' -initfd' )
412+ endif
413+
401414 if use_initfd.auto()
402- xwayland_options = run_command ([xwayland_path, ' -help' ], check : true )
403- have_xwayland_initfd = xwayland_options.stderr().contains(' -initfd' )
415+ have_xwayland_initfd = xwayland_supports_initfd
404416 else
405417 have_xwayland_initfd = use_initfd.enabled()
406418 endif
You can’t perform that action at this time.
0 commit comments