Fix monitor setting overriding follow_mode
Ignore the monitor setting if it's set to a non-zero value and the follow mode isn't none. Fixes #755
This commit is contained in:
		
							parent
							
								
									ca6ce6868e
								
							
						
					
					
						commit
						e59d203256
					
				@ -304,21 +304,22 @@ struct screen_info *get_active_screen(void)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
        int ret = 0;
 | 
					        int ret = 0;
 | 
				
			||||||
        bool force_follow_mouse = false;
 | 
					        bool force_follow_mouse = false;
 | 
				
			||||||
        if (settings.monitor > 0 && settings.monitor < screens_len) {
 | 
					 | 
				
			||||||
                ret = settings.monitor;
 | 
					 | 
				
			||||||
                goto sc_cleanup;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        x_follow_setup_error_handler();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (settings.f_mode == FOLLOW_NONE) {
 | 
					        if (settings.f_mode == FOLLOW_NONE) {
 | 
				
			||||||
                ret = XDefaultScreen(xctx.dpy);
 | 
					                if (settings.monitor >= 0 && settings.monitor < screens_len) {
 | 
				
			||||||
                goto sc_cleanup;
 | 
					                        ret = settings.monitor;
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                        ret = XDefaultScreen(xctx.dpy);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                goto sc_cleanup;
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
                int x, y;
 | 
					                int x, y;
 | 
				
			||||||
                assert(settings.f_mode == FOLLOW_MOUSE
 | 
					                assert(settings.f_mode == FOLLOW_MOUSE
 | 
				
			||||||
                                || settings.f_mode == FOLLOW_KEYBOARD);
 | 
					                                || settings.f_mode == FOLLOW_KEYBOARD);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                x_follow_setup_error_handler();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                Window root =
 | 
					                Window root =
 | 
				
			||||||
                        RootWindow(xctx.dpy, DefaultScreen(xctx.dpy));
 | 
					                        RootWindow(xctx.dpy, DefaultScreen(xctx.dpy));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user