Ephyr: Find the right host screen when embedded
When Xephyr is embedded into another application (e.g. in xoo), the input events may come from the parent Window instead of our own. So make sure we find the host screen in that case as well instead of crashing. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
		
							parent
							
								
									ac1a60e7b6
								
							
						
					
					
						commit
						cf05db8dde
					
				| 
						 | 
					@ -881,7 +881,9 @@ host_screen_from_window(Window w)
 | 
				
			||||||
    struct EphyrHostScreen *result = NULL;
 | 
					    struct EphyrHostScreen *result = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (index = 0; index < HostX.n_screens; index++) {
 | 
					    for (index = 0; index < HostX.n_screens; index++) {
 | 
				
			||||||
        if (HostX.screens[index].win == w || HostX.screens[index].peer_win == w) {
 | 
					        if (HostX.screens[index].win == w
 | 
				
			||||||
 | 
					            || HostX.screens[index].peer_win == w
 | 
				
			||||||
 | 
					            || HostX.screens[index].win_pre_existing == w) {
 | 
				
			||||||
            result = &HostX.screens[index];
 | 
					            result = &HostX.screens[index];
 | 
				
			||||||
            goto out;
 | 
					            goto out;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue