mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	input-method: unmap popup surfaces on deactivate
Fixes743da5c0ae(cherry picked from commitf464213447)
This commit is contained in:
		
							parent
							
								
									388af6a62b
								
							
						
					
					
						commit
						0dc1e0ed2a
					
				
					 1 changed files with 10 additions and 7 deletions
				
			
		| 
						 | 
					@ -145,10 +145,13 @@ void wlr_input_popup_surface_v2_send_text_input_rectangle(
 | 
				
			||||||
		popup_surface->resource, sbox->x, sbox->y, sbox->width, sbox->height);
 | 
							popup_surface->resource, sbox->x, sbox->y, sbox->width, sbox->height);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void popup_surface_consider_map(struct wlr_input_popup_surface_v2 *popup_surface) {
 | 
					static void popup_surface_update_mapped(struct wlr_input_popup_surface_v2 *popup_surface) {
 | 
				
			||||||
	if (wlr_surface_has_buffer(popup_surface->surface) &&
 | 
						if (popup_surface->input_method->client_active) {
 | 
				
			||||||
			popup_surface->input_method->client_active) {
 | 
							if (wlr_surface_has_buffer(popup_surface->surface)) {
 | 
				
			||||||
		wlr_surface_map(popup_surface->surface);
 | 
								wlr_surface_map(popup_surface->surface);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							wlr_surface_unmap(popup_surface->surface);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,7 +162,7 @@ static void popup_surface_surface_role_commit(struct wlr_surface *surface) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	popup_surface_consider_map(popup_surface);
 | 
						popup_surface_update_mapped(popup_surface);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void popup_surface_surface_role_destroy(struct wlr_surface *surface) {
 | 
					static void popup_surface_surface_role_destroy(struct wlr_surface *surface) {
 | 
				
			||||||
| 
						 | 
					@ -245,7 +248,7 @@ static void im_get_input_popup_surface(struct wl_client *client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wl_signal_init(&popup_surface->events.destroy);
 | 
						wl_signal_init(&popup_surface->events.destroy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	popup_surface_consider_map(popup_surface);
 | 
						popup_surface_update_mapped(popup_surface);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wl_list_insert(&input_method->popup_surfaces, &popup_surface->link);
 | 
						wl_list_insert(&input_method->popup_surfaces, &popup_surface->link);
 | 
				
			||||||
	wl_signal_emit_mutable(&input_method->events.new_popup_surface, popup_surface);
 | 
						wl_signal_emit_mutable(&input_method->events.new_popup_surface, popup_surface);
 | 
				
			||||||
| 
						 | 
					@ -489,7 +492,7 @@ void wlr_input_method_v2_send_done(struct wlr_input_method_v2 *input_method) {
 | 
				
			||||||
	input_method->current_serial++;
 | 
						input_method->current_serial++;
 | 
				
			||||||
	struct wlr_input_popup_surface_v2 *popup_surface;
 | 
						struct wlr_input_popup_surface_v2 *popup_surface;
 | 
				
			||||||
	wl_list_for_each(popup_surface, &input_method->popup_surfaces, link) {
 | 
						wl_list_for_each(popup_surface, &input_method->popup_surfaces, link) {
 | 
				
			||||||
		popup_surface_consider_map(popup_surface);
 | 
							popup_surface_update_mapped(popup_surface);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue