mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	seat: remove seat_focused_surface()
This commit is contained in:
		
							parent
							
								
									7eb33334d2
								
							
						
					
					
						commit
						8e2b3ea89a
					
				
					 5 changed files with 6 additions and 12 deletions
				
			
		| 
						 | 
					@ -241,7 +241,6 @@ void keyboard_init(struct seat *seat);
 | 
				
			||||||
void seat_init(struct server *server);
 | 
					void seat_init(struct server *server);
 | 
				
			||||||
void seat_finish(struct server *server);
 | 
					void seat_finish(struct server *server);
 | 
				
			||||||
void seat_focus_surface(struct wlr_seat *seat, struct wlr_surface *surface);
 | 
					void seat_focus_surface(struct wlr_seat *seat, struct wlr_surface *surface);
 | 
				
			||||||
struct wlr_surface *seat_focused_surface(void);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
void interactive_begin(struct view *view, enum cursor_mode mode,
 | 
					void interactive_begin(struct view *view, enum cursor_mode mode,
 | 
				
			||||||
		       uint32_t edges);
 | 
							       uint32_t edges);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -76,7 +76,7 @@ focus_view(struct view *view)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (prev_surface) {
 | 
						if (prev_surface) {
 | 
				
			||||||
		set_activated(wlr_seat->keyboard_state.focused_surface, false);
 | 
							set_activated(prev_surface, false);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	move_to_front(view);
 | 
						move_to_front(view);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -134,7 +134,8 @@ render_decorations(struct wlr_output *output, struct view *view)
 | 
				
			||||||
	draw_rect(&ddata, deco_box(view, LAB_DECO_PART_LEFT));
 | 
						draw_rect(&ddata, deco_box(view, LAB_DECO_PART_LEFT));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* title */
 | 
						/* title */
 | 
				
			||||||
	if (view->surface == seat_focused_surface())
 | 
						struct wlr_seat *seat = view->server->seat.seat;
 | 
				
			||||||
 | 
						if (view->surface == seat->keyboard_state.focused_surface)
 | 
				
			||||||
		ddata.rgba = theme.window_active_title_bg_color;
 | 
							ddata.rgba = theme.window_active_title_bg_color;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		ddata.rgba = theme.window_inactive_title_bg_color;
 | 
							ddata.rgba = theme.window_inactive_title_bg_color;
 | 
				
			||||||
| 
						 | 
					@ -152,7 +153,7 @@ render_decorations(struct wlr_output *output, struct view *view)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* buttons */
 | 
						/* buttons */
 | 
				
			||||||
	if (view->surface == seat_focused_surface()) {
 | 
						if (view->surface == seat->keyboard_state.focused_surface) {
 | 
				
			||||||
		render_icon(&ddata, deco_box(view, LAB_DECO_BUTTON_CLOSE),
 | 
							render_icon(&ddata, deco_box(view, LAB_DECO_BUTTON_CLOSE),
 | 
				
			||||||
			    theme.xbm_close_active_unpressed);
 | 
								    theme.xbm_close_active_unpressed);
 | 
				
			||||||
		render_icon(&ddata, deco_box(view, LAB_DECO_BUTTON_MAXIMIZE),
 | 
							render_icon(&ddata, deco_box(view, LAB_DECO_BUTTON_MAXIMIZE),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -128,9 +128,3 @@ seat_focus_surface(struct wlr_seat *seat, struct wlr_surface *surface)
 | 
				
			||||||
	wlr_seat_keyboard_notify_enter(seat, surface, kb->keycodes,
 | 
						wlr_seat_keyboard_notify_enter(seat, surface, kb->keycodes,
 | 
				
			||||||
		kb->num_keycodes, &kb->modifiers);
 | 
							kb->num_keycodes, &kb->modifiers);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
struct wlr_surface *
 | 
					 | 
				
			||||||
seat_focused_surface(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	return current_seat->seat->keyboard_state.focused_surface;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,7 +52,8 @@ unmanaged_handle_unmap(struct wl_listener *listener, void *data)
 | 
				
			||||||
	wl_list_remove(&unmanaged->link);
 | 
						wl_list_remove(&unmanaged->link);
 | 
				
			||||||
	wl_list_remove(&unmanaged->commit.link);
 | 
						wl_list_remove(&unmanaged->commit.link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (seat_focused_surface() == xsurface->surface) {
 | 
						struct wlr_seat *seat = unmanaged->server->seat.seat;
 | 
				
			||||||
 | 
						if (seat->keyboard_state.focused_surface == xsurface->surface) {
 | 
				
			||||||
		struct xwayland_unmanaged *u;
 | 
							struct xwayland_unmanaged *u;
 | 
				
			||||||
		struct wl_list *list = &unmanaged->server->unmanaged_surfaces;
 | 
							struct wl_list *list = &unmanaged->server->unmanaged_surfaces;
 | 
				
			||||||
		wl_list_for_each (u, list, link) {
 | 
							wl_list_for_each (u, list, link) {
 | 
				
			||||||
| 
						 | 
					@ -60,7 +61,6 @@ unmanaged_handle_unmap(struct wl_listener *listener, void *data)
 | 
				
			||||||
			if (!wlr_xwayland_or_surface_wants_focus(prev)) {
 | 
								if (!wlr_xwayland_or_surface_wants_focus(prev)) {
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			struct wlr_seat *seat = unmanaged->server->seat.seat;
 | 
					 | 
				
			||||||
			seat_focus_surface(seat, prev->surface);
 | 
								seat_focus_surface(seat, prev->surface);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue