refactor: cleanup + improve focus
This commit is contained in:
parent
f03edb1db7
commit
8945f8b345
9
cursor.c
9
cursor.c
@ -13,6 +13,7 @@ void diyac_cursor_focus(struct diyac_server *server)
|
||||
struct diyac_node_descriptor *desc = diyac_node_at(server,
|
||||
server->seat.cursor->x, server->seat.cursor->y, &surface, &sx, &sy);
|
||||
struct diyac_layer_surface * layer;
|
||||
struct diyac_view * root = NULL;
|
||||
if(!desc)
|
||||
{
|
||||
return;
|
||||
@ -21,7 +22,15 @@ void diyac_cursor_focus(struct diyac_server *server)
|
||||
switch (desc->type)
|
||||
{
|
||||
case DIYAC_NODE_VIEW:
|
||||
root = diyac_get_root_view(desc->data);
|
||||
if(root)
|
||||
{
|
||||
diyac_focus_view(root, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
diyac_focus_view(desc->data, true);
|
||||
}
|
||||
break;
|
||||
case DIYAC_NODE_LAYER_SURFACE:
|
||||
layer = desc->data;
|
||||
|
Loading…
Reference in New Issue
Block a user