mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:40:05 +00:00 
			
		
		
		
	Revert "Disable Wayland platform plugin on Nvidia"
This commit is contained in:
		
							parent
							
								
									51806d1742
								
							
						
					
					
						commit
						5c9e90d805
					
				
					 1 changed files with 0 additions and 34 deletions
				
			
		|  | @ -19,8 +19,6 @@ | ||||||
| #include <scwx/util/logger.hpp> | #include <scwx/util/logger.hpp> | ||||||
| #include <scwx/util/threads.hpp> | #include <scwx/util/threads.hpp> | ||||||
| 
 | 
 | ||||||
| #include <filesystem> |  | ||||||
| #include <fstream> |  | ||||||
| #include <string> | #include <string> | ||||||
| #include <vector> | #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 ConfigureTheme(const std::vector<std::string>& args); | ||||||
| static void InitializeOpenGL(); | static void InitializeOpenGL(); | ||||||
| static void OverrideDefaultStyle(const std::vector<std::string>& args); | static void OverrideDefaultStyle(const std::vector<std::string>& args); | ||||||
| static void OverridePlatform(); |  | ||||||
| 
 | 
 | ||||||
| int main(int argc, char* argv[]) | int main(int argc, char* argv[]) | ||||||
| { | { | ||||||
|  | @ -56,8 +53,6 @@ int main(int argc, char* argv[]) | ||||||
|       args.push_back(argv[i]); |       args.push_back(argv[i]); | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|    OverridePlatform(); |  | ||||||
| 
 |  | ||||||
|    // Initialize logger
 |    // Initialize logger
 | ||||||
|    auto& logManager = scwx::qt::manager::LogManager::Instance(); |    auto& logManager = scwx::qt::manager::LogManager::Instance(); | ||||||
|    logManager.Initialize(); |    logManager.Initialize(); | ||||||
|  | @ -281,32 +276,3 @@ OverrideDefaultStyle([[maybe_unused]] const std::vector<std::string>& args) | ||||||
|    } |    } | ||||||
| #endif | #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
	
	 Dan Paulat
						Dan Paulat