mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #271 from sce/move_wlc_init
sway/main: Move wlc init to after args are handled.
This commit is contained in:
		
						commit
						01617131f1
					
				
					 1 changed files with 12 additions and 14 deletions
				
			
		
							
								
								
									
										26
									
								
								sway/main.c
									
										
									
									
									
								
							
							
						
						
									
										26
									
								
								sway/main.c
									
										
									
									
									
								
							| 
						 | 
					@ -64,21 +64,7 @@ int main(int argc, char **argv) {
 | 
				
			||||||
		{0, 0, 0, 0}
 | 
							{0, 0, 0, 0}
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setenv("WLC_DIM", "0", 0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	wlc_log_set_handler(wlc_log_handler);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	detect_nvidia();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Changing code earlier than this point requires detailed review */
 | 
					 | 
				
			||||||
	if (!wlc_init(&interface, argc, argv)) {
 | 
					 | 
				
			||||||
		return 1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	register_extensions();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	char *config_path = NULL;
 | 
						char *config_path = NULL;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	int c;
 | 
						int c;
 | 
				
			||||||
	while (1) {
 | 
						while (1) {
 | 
				
			||||||
		int option_index = 0;
 | 
							int option_index = 0;
 | 
				
			||||||
| 
						 | 
					@ -121,6 +107,18 @@ int main(int argc, char **argv) {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						setenv("WLC_DIM", "0", 0);
 | 
				
			||||||
 | 
						wlc_log_set_handler(wlc_log_handler);
 | 
				
			||||||
 | 
						detect_nvidia();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Changing code earlier than this point requires detailed review */
 | 
				
			||||||
 | 
						/* (That code runs as root on systems without logind, and wlc_init drops to
 | 
				
			||||||
 | 
						 * another user.) */
 | 
				
			||||||
 | 
						if (!wlc_init(&interface, argc, argv)) {
 | 
				
			||||||
 | 
							return 1;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						register_extensions();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (debug) {
 | 
						if (debug) {
 | 
				
			||||||
		init_log(L_DEBUG);
 | 
							init_log(L_DEBUG);
 | 
				
			||||||
	} else if (verbose || validate) {
 | 
						} else if (verbose || validate) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue