Qt: Better wayland detection to enforce xcb

In certain cases, the platform can be "wayland-egl", "wayland-xcomposite", and other values for which I haven't found a full list yet. Instead of matching only "wayland", we now look for "wayland" anywhere in the `QT_QPA_PLATFORM` string in a case-insensitive manner.

Acknowledgements:
`CaseInsensitiveContains`' implementation was heavily inspired by GNU's non-standard glibc `strcasestr` function, which can be found here licensed under GPLv2 or later: https://ftp.gnu.org/gnu/libc/
This commit is contained in:
Joshua Vandaële
2025-08-04 19:34:31 +02:00
parent 6ca486ffb2
commit f8b85edd0c
4 changed files with 51 additions and 2 deletions

View File

@ -311,6 +311,7 @@ std::string GetEscapedHtml(std::string html);
void ToLower(std::string* str);
void ToUpper(std::string* str);
bool CaseInsensitiveEquals(std::string_view a, std::string_view b);
bool CaseInsensitiveContains(std::string_view a, std::string_view b);
// 'std::less'-like comparison function object type for case-insensitive strings.
struct CaseInsensitiveLess