mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	desktop: remove deprecated functions
- set_activated() - desktop_set_focus_view_only()
This commit is contained in:
		
							parent
							
								
									9a290feeea
								
							
						
					
					
						commit
						4d44659c08
					
				
					 3 changed files with 1 additions and 47 deletions
				
			
		| 
						 | 
					@ -353,7 +353,6 @@ void foreign_toplevel_handle_create(struct view *view);
 | 
				
			||||||
 *              or pointer focus, in this compositor are they called together.
 | 
					 *              or pointer focus, in this compositor are they called together.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void desktop_set_focus_view_only(struct seat *seat, struct view *view);
 | 
					 | 
				
			||||||
void desktop_raise_view(struct view *view);
 | 
					void desktop_raise_view(struct view *view);
 | 
				
			||||||
void desktop_focus_and_activate_view(struct seat *seat, struct view *view);
 | 
					void desktop_focus_and_activate_view(struct seat *seat, struct view *view);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -181,11 +181,9 @@ process_cursor_motion(struct server *server, uint32_t time)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (view && rc.focus_follow_mouse) {
 | 
						if (view && rc.focus_follow_mouse) {
 | 
				
			||||||
		if (rc.raise_on_focus) {
 | 
					 | 
				
			||||||
		desktop_focus_and_activate_view(&server->seat, view);
 | 
							desktop_focus_and_activate_view(&server->seat, view);
 | 
				
			||||||
 | 
							if (rc.raise_on_focus) {
 | 
				
			||||||
			desktop_raise_view(view);
 | 
								desktop_raise_view(view);
 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			desktop_set_focus_view_only(&server->seat, view);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -51,49 +51,6 @@ move_xwayland_sub_views_to_front(struct view *parent)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Activate/deactivate toplevel surface */
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
set_activated(struct wlr_surface *surface, bool activated)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	if (!surface) {
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (wlr_surface_is_xdg_surface(surface)) {
 | 
					 | 
				
			||||||
		struct wlr_xdg_surface *s;
 | 
					 | 
				
			||||||
		s = wlr_xdg_surface_from_wlr_surface(surface);
 | 
					 | 
				
			||||||
		wlr_xdg_toplevel_set_activated(s, activated);
 | 
					 | 
				
			||||||
#if HAVE_XWAYLAND
 | 
					 | 
				
			||||||
	} else if (wlr_surface_is_xwayland_surface(surface)) {
 | 
					 | 
				
			||||||
		struct wlr_xwayland_surface *s;
 | 
					 | 
				
			||||||
		s = wlr_xwayland_surface_from_wlr_surface(surface);
 | 
					 | 
				
			||||||
		wlr_xwayland_surface_activate(s, activated);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void
 | 
					 | 
				
			||||||
desktop_set_focus_view_only(struct seat *seat, struct view *view)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	if (!view || view->minimized || !view->mapped) {
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (input_inhibit_blocks_surface(seat, view->surface->resource)) {
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	struct wlr_surface *prev_surface;
 | 
					 | 
				
			||||||
	prev_surface = seat->seat->keyboard_state.focused_surface;
 | 
					 | 
				
			||||||
	if (prev_surface == view->surface) {
 | 
					 | 
				
			||||||
		/* Don't re-focus an already focused surface. */
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (prev_surface) {
 | 
					 | 
				
			||||||
		set_activated(prev_surface, false);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	set_activated(view->surface, true);
 | 
					 | 
				
			||||||
	seat_focus_surface(seat, view->surface);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
desktop_raise_view(struct view *view)
 | 
					desktop_raise_view(struct view *view)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue