mirror of
https://github.com/labwc/labwc.git
synced 2026-02-28 01:40:29 -05:00
seat: use focus_change event to update focused/active view
- Connect to wlr_seat_keyboard_state's focus_change event. - Add view_from_wlr_surface(), which does what the name says. - Use focus_change event along with view_from_wlr_surface() to update server->focused_view and set SSD states via view_set_activated(). - Eliminate desktop_focused_view() since server->focused_view should be reliably up-to-date now. - Eliminate view_focus/defocus() since we can now just call seat_focus_surface() directly.
This commit is contained in:
parent
bb5d272dc9
commit
4028a9482f
9 changed files with 77 additions and 100 deletions
|
|
@ -167,6 +167,7 @@ struct seat {
|
|||
struct wl_client *active_client_while_inhibited;
|
||||
struct wl_list inputs;
|
||||
struct wl_listener new_input;
|
||||
struct wl_listener focus_change;
|
||||
|
||||
struct wl_listener cursor_motion;
|
||||
struct wl_listener cursor_motion_absolute;
|
||||
|
|
@ -247,11 +248,8 @@ struct server {
|
|||
|
||||
/* SSD state */
|
||||
/*
|
||||
* Currently focused view (cached value). This pointer is used
|
||||
* primarily to track which view is being drawn with "active"
|
||||
* SSD coloring. We consider it a bug if this gets out of sync
|
||||
* with the actual keyboard focus (according to wlroots). See
|
||||
* also desktop_focused_view().
|
||||
* Currently focused view. Updated with each "focus change"
|
||||
* event. This view is drawn with "active" SSD coloring.
|
||||
*/
|
||||
struct view *focused_view;
|
||||
struct ssd_hover_state *ssd_hover_state;
|
||||
|
|
@ -395,14 +393,6 @@ enum lab_cycle_dir {
|
|||
*/
|
||||
struct view *desktop_cycle_view(struct server *server, struct view *start_view,
|
||||
enum lab_cycle_dir dir);
|
||||
/**
|
||||
* desktop_focused_view - return the view that is currently focused
|
||||
* (determined on-the-fly from the wlroots keyboard focus). The return
|
||||
* value should ideally match server->focused_view (we consider it a
|
||||
* bug otherwise) but is guaranteed to be up-to-date even if
|
||||
* server->focused_view gets out of sync.
|
||||
*/
|
||||
struct view *desktop_focused_view(struct server *server);
|
||||
void desktop_focus_topmost_mapped_view(struct server *server);
|
||||
|
||||
void keyboard_cancel_keybind_repeat(struct keyboard *keyboard);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue