File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525#mesondefine USE_GTK
2626#mesondefine USE_GTK3
2727#mesondefine USE_LIBARCHIVE
28+ #mesondefine USE_XWAYLAND
2829
2930#mesondefine GLIB_VERSION_MIN_REQUIRED
Original file line number Diff line number Diff line change @@ -176,6 +176,9 @@ endif
176176
177177if get_option (' qt' )
178178 conf.set10(' USE_QT' , true )
179+ if qt_dep.version().version_compare(' <= 6.7' )
180+ conf.set10(' USE_XWAYLAND' , true )
181+ endif
179182endif
180183
181184
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ static const char * const core_defaults[] = {
4343 " resume_playback_on_startup" , " TRUE" ,
4444 " show_interface" , " TRUE" ,
4545 " use_qt" , " TRUE" ,
46+ #ifdef USE_XWAYLAND
47+ " use_xwayland" , " TRUE" ,
48+ #else
49+ " use_xwayland" , " FALSE" ,
50+ #endif
4651
4752 /* equalizer */
4853 " eqpreset_default_file" , " " ,
Original file line number Diff line number Diff line change 1818 */
1919
2020#include < assert.h>
21- #include < stdlib.h>
2221
2322#include < libaudcore/audstrings.h>
2423#include < libaudcore/hook.h>
2524#include < libaudcore/playlist.h>
26- #include < libaudcore/plugins.h>
2725#include < libaudcore/runtime.h>
2826
2927#include " internal.h"
@@ -343,15 +341,9 @@ EXPORT void audgui_init ()
343341 return ;
344342
345343#if defined(GDK_WINDOWING_WAYLAND) && defined(GDK_WINDOWING_X11)
346- // Use X11/XWayland by default, but allow to overwrite it.
347- // Especially the Winamp interface is not usable yet on Wayland
348- // due to limitations regarding application-side window positioning.
349- auto backend = g_getenv (" GDK_BACKEND" );
350- if (! backend && g_getenv (" DISPLAY" ))
351- g_setenv (" GDK_BACKEND" , " x11" , false );
352- else if (g_strcmp0 (backend, " x11" ))
353- AUDWARN (" X11/XWayland was not detected. This is unsupported, "
354- " please do not report bugs.\n " );
344+ // Force Xwayland if requested and potentially available
345+ if (aud_get_bool (" use_xwayland" ) && g_getenv (" DISPLAY" ))
346+ g_setenv (" GDK_BACKEND" , " x11" , true );
355347#endif
356348
357349 static char app_name[] = " audacious" ;
Original file line number Diff line number Diff line change @@ -369,6 +369,10 @@ static const PreferencesWidget song_info_page_widgets[] = {
369369
370370static const PreferencesWidget advanced_page_widgets[] = {
371371 WidgetLabel (N_ (" <b>Compatibility</b>" )),
372+ #if defined(GDK_WINDOWING_WAYLAND) && defined(GDK_WINDOWING_X11)
373+ WidgetCheck (N_ (" Use Xwayland (requires a restart to take effect)" ),
374+ WidgetBool (0 , " use_xwayland" )),
375+ #endif
372376 WidgetCheck (N_ (" Interpret \\ (backward slash) as a folder delimiter" ),
373377 WidgetBool (0 , " convert_backslash" )),
374378 WidgetTable ({{chardet_elements}}),
Original file line number Diff line number Diff line change @@ -131,15 +131,9 @@ EXPORT void init()
131131#endif
132132
133133#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
134- // Use X11/XWayland by default, but allow to overwrite it.
135- // Especially the Winamp interface is not usable yet on Wayland
136- // due to limitations regarding application-side window positioning.
137- auto platform = qgetenv (" QT_QPA_PLATFORM" );
138- if (platform.isEmpty () && qEnvironmentVariableIsSet (" DISPLAY" ))
134+ // Force Xwayland if requested and potentially available
135+ if (aud_get_bool (" use_xwayland" ) && qEnvironmentVariableIsSet (" DISPLAY" ))
139136 qputenv (" QT_QPA_PLATFORM" , " xcb" );
140- else if (platform != " xcb" )
141- AUDWARN (" X11/XWayland was not detected. This is unsupported, "
142- " please do not report bugs.\n " );
143137#endif
144138
145139 static char app_name[] = " audacious" ;
Original file line number Diff line number Diff line change @@ -401,6 +401,10 @@ static const PreferencesWidget song_info_page_widgets[] = {
401401
402402static const PreferencesWidget advanced_page_widgets[] = {
403403 WidgetLabel (N_ (" <b>Compatibility</b>" )),
404+ #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
405+ WidgetCheck (N_ (" Use Xwayland (requires a restart to take effect)" ),
406+ WidgetBool (0 , " use_xwayland" )),
407+ #endif
404408 WidgetCheck (N_ (" Interpret \\ (backward slash) as a folder delimiter" ),
405409 WidgetBool (0 , " convert_backslash" )),
406410 WidgetTable ({{chardet_elements}}),
You can’t perform that action at this time.
0 commit comments