Enable Wayland tricks by default when configured with KICAD_WAYLAND=1.

This commit is contained in:
Alex Shvartzkop 2023-09-15 00:30:54 +03:00
parent 89cb35dc22
commit 8db400500d
1 changed files with 10 additions and 1 deletions

View File

@ -39,8 +39,17 @@ void KIPLATFORM::ENV::Init()
wxString gdkBackend; wxString gdkBackend;
wxGetEnv( wxT( "GDK_BACKEND" ), &gdkBackend ); wxGetEnv( wxT( "GDK_BACKEND" ), &gdkBackend );
// Set KICAD_WAYLAND_TRICKS to develop for native Wayland. #ifdef KICAD_WAYLAND
bool waylandTricks = true;
#else
bool waylandTricks = false;
#endif
if( wxGetEnv( wxT( "KICAD_WAYLAND_TRICKS" ), nullptr ) ) if( wxGetEnv( wxT( "KICAD_WAYLAND_TRICKS" ), nullptr ) )
waylandTricks = true;
// Set KICAD_WAYLAND_TRICKS to develop for native Wayland.
if( waylandTricks )
{ {
wxSetEnv( wxT( "GDK_BACKEND" ), wxT( "wayland" ) ); wxSetEnv( wxT( "GDK_BACKEND" ), wxT( "wayland" ) );
gdk_set_allowed_backends( "wayland" ); gdk_set_allowed_backends( "wayland" );