cursor: Add struct cursor_context and clean up code

v2:
 - Add surface to cursor_context, rename c -> ctx
 - Factor out determine_resize_edges()
This commit is contained in:
John Lindgren 2022-09-12 04:54:00 -04:00 committed by Consolatis
parent 89890b6be9
commit 429c388333
4 changed files with 125 additions and 185 deletions

View file

@ -275,7 +275,7 @@ actions_run(struct view *activator, struct server *server,
}
break;
case ACTION_TYPE_FOCUS:
view = desktop_view_at_cursor(server);
view = get_cursor_context(server).view;
if (view) {
desktop_focus_and_activate_view(&server->seat, view);
}
@ -286,7 +286,7 @@ actions_run(struct view *activator, struct server *server,
}
break;
case ACTION_TYPE_MOVE:
view = desktop_view_at_cursor(server);
view = get_cursor_context(server).view;
if (view) {
interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
}
@ -297,7 +297,7 @@ actions_run(struct view *activator, struct server *server,
}
break;
case ACTION_TYPE_RESIZE:
view = desktop_view_at_cursor(server);
view = get_cursor_context(server).view;
if (view) {
interactive_begin(view, LAB_INPUT_STATE_RESIZE,
resize_edges);