forked from quickshell/quickshell
		
	launch: ignore QT_STYLE_OVERRIDE and QT_QUICK_CONTROLS_STYLE
QT_STYLE_OVERRIDE often results in unexpected QML dependencies that don't exist being required. QT_QUICK_CONTROLS_STYLE can vary across systems and produce unexpected results.
This commit is contained in:
		
							parent
							
								
									4dad447570
								
							
						
					
					
						commit
						dfededc901
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -73,6 +73,7 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
 | 
				
			||||||
		bool useQApplication = false;
 | 
							bool useQApplication = false;
 | 
				
			||||||
		bool nativeTextRendering = false;
 | 
							bool nativeTextRendering = false;
 | 
				
			||||||
		bool desktopSettingsAware = true;
 | 
							bool desktopSettingsAware = true;
 | 
				
			||||||
 | 
							bool useSystemStyle = false;
 | 
				
			||||||
		QString iconTheme = qEnvironmentVariable("QS_ICON_THEME");
 | 
							QString iconTheme = qEnvironmentVariable("QS_ICON_THEME");
 | 
				
			||||||
		QHash<QString, QString> envOverrides;
 | 
							QHash<QString, QString> envOverrides;
 | 
				
			||||||
		QString dataDir;
 | 
							QString dataDir;
 | 
				
			||||||
| 
						 | 
					@ -88,6 +89,7 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
 | 
				
			||||||
			if (pragma == "UseQApplication") pragmas.useQApplication = true;
 | 
								if (pragma == "UseQApplication") pragmas.useQApplication = true;
 | 
				
			||||||
			else if (pragma == "NativeTextRendering") pragmas.nativeTextRendering = true;
 | 
								else if (pragma == "NativeTextRendering") pragmas.nativeTextRendering = true;
 | 
				
			||||||
			else if (pragma == "IgnoreSystemSettings") pragmas.desktopSettingsAware = false;
 | 
								else if (pragma == "IgnoreSystemSettings") pragmas.desktopSettingsAware = false;
 | 
				
			||||||
 | 
								else if (pragma == "RespectSystemStyle") pragmas.useSystemStyle = true;
 | 
				
			||||||
			else if (pragma.startsWith("IconTheme ")) pragmas.iconTheme = pragma.sliced(10);
 | 
								else if (pragma.startsWith("IconTheme ")) pragmas.iconTheme = pragma.sliced(10);
 | 
				
			||||||
			else if (pragma.startsWith("Env ")) {
 | 
								else if (pragma.startsWith("Env ")) {
 | 
				
			||||||
				auto envPragma = pragma.sliced(4);
 | 
									auto envPragma = pragma.sliced(4);
 | 
				
			||||||
| 
						 | 
					@ -155,6 +157,11 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Common::INITIAL_ENVIRONMENT = QProcessEnvironment::systemEnvironment();
 | 
						Common::INITIAL_ENVIRONMENT = QProcessEnvironment::systemEnvironment();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!pragmas.useSystemStyle) {
 | 
				
			||||||
 | 
							qunsetenv("QT_STYLE_OVERRIDE");
 | 
				
			||||||
 | 
							qputenv("QT_QUICK_CONTROLS_STYLE", "Fusion");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (auto [var, val]: pragmas.envOverrides.asKeyValueRange()) {
 | 
						for (auto [var, val]: pragmas.envOverrides.asKeyValueRange()) {
 | 
				
			||||||
		qputenv(var.toUtf8(), val.toUtf8());
 | 
							qputenv(var.toUtf8(), val.toUtf8());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue