mirror of
https://github.com/labwc/labwc.git
synced 2026-02-22 01:40:25 -05:00
define focused_view function and use it for keyboard actions
This commit is contained in:
parent
a15a56bfe1
commit
815cd4aa46
3 changed files with 26 additions and 6 deletions
|
|
@ -212,6 +212,25 @@ topmost_mapped_view(struct server *server)
|
|||
return view;
|
||||
}
|
||||
|
||||
struct view *
|
||||
focused_view(struct server *server)
|
||||
{
|
||||
struct seat *seat = &server->seat;
|
||||
struct wlr_surface *focused_surface;
|
||||
focused_surface = seat->seat->keyboard_state.focused_surface;
|
||||
if (!focused_surface) {
|
||||
return NULL;
|
||||
}
|
||||
struct view *view;
|
||||
wl_list_for_each (view, &server->views, link) {
|
||||
if (view->surface == focused_surface) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
desktop_focus_topmost_mapped_view(struct server *server)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue