MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / focus_next

Method focus_next

plugins/single_plugins/switcher.cpp:509–519  ·  view source on GitHub ↗

Change the current focus to the next or the previous view */

Source from the content-addressed store, hash-verified

507
508 /* Change the current focus to the next or the previous view */
509 void focus_next(int dir)
510 {
511 auto ws_views = get_workspace_views();
512 /* Change the focused view and rearrange views so that focused is on top */
513 int size = ws_views.size();
514
515 // calculate focus index & focus it
516 int focused_view_index = (size + dir) % size;
517 auto focused_view = ws_views[focused_view_index];
518 wf::view_bring_to_front(focused_view);
519 }
520
521 /* Create the initial arrangement on the screen
522 * Also changes the focus to the next or the last view, depending on dir */

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected