mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-29 23:10:06 +00:00
Merge pull request #485 from dpaulat/revert-479-no-wayland-on-nvidia
Revert "Disable Wayland platform plugin on Nvidia"
This commit is contained in:
commit
7200acc382
1 changed files with 0 additions and 34 deletions
|
|
@ -19,8 +19,6 @@
|
|||
#include <scwx/util/logger.hpp>
|
||||
#include <scwx/util/threads.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -45,7 +43,6 @@ static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
|||
static void ConfigureTheme(const std::vector<std::string>& args);
|
||||
static void InitializeOpenGL();
|
||||
static void OverrideDefaultStyle(const std::vector<std::string>& args);
|
||||
static void OverridePlatform();
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -56,8 +53,6 @@ int main(int argc, char* argv[])
|
|||
args.push_back(argv[i]);
|
||||
}
|
||||
|
||||
OverridePlatform();
|
||||
|
||||
// Initialize logger
|
||||
auto& logManager = scwx::qt::manager::LogManager::Instance();
|
||||
logManager.Initialize();
|
||||
|
|
@ -281,32 +276,3 @@ OverrideDefaultStyle([[maybe_unused]] const std::vector<std::string>& args)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void OverridePlatform()
|
||||
{
|
||||
#if defined(__linux__)
|
||||
static const std::string NVIDIA_ID = "0x10de";
|
||||
namespace fs = std::filesystem;
|
||||
for (const auto& entry : fs::directory_iterator("/sys/class/drm"))
|
||||
{
|
||||
if (!entry.is_directory() ||
|
||||
!entry.path().filename().string().starts_with("card"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
auto vendorPath = entry.path() / "device" / "vendor";
|
||||
std::ifstream vendorFile(vendorPath);
|
||||
std::string vendor;
|
||||
if (vendorFile && std::getline(vendorFile, vendor))
|
||||
{
|
||||
if (vendor == NVIDIA_ID)
|
||||
{
|
||||
// Force xcb on NVIDIA
|
||||
setenv("QT_QPA_PLATFORM", "xcb", 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue