mirror of
https://github.com/labwc/labwc.git
synced 2026-05-07 12:06:30 -04:00
cycle.c: put common code in get_view_criteria()
This commit is contained in:
parent
ff2f243eb1
commit
949e9ffe42
1 changed files with 18 additions and 15 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "common/mem.h"
|
||||
#include "common/scene-helpers.h"
|
||||
#include "config/rcxml.h"
|
||||
#include "config/types.h"
|
||||
#include "labwc.h"
|
||||
#include "node.h"
|
||||
#include "output.h"
|
||||
|
|
@ -322,6 +323,18 @@ handle_osd_tree_destroy(struct wl_listener *listener, void *data)
|
|||
free(osd_output);
|
||||
}
|
||||
|
||||
static enum lab_view_criteria
|
||||
get_view_criteria(struct cycle_filter *filter)
|
||||
{
|
||||
enum lab_view_criteria criteria =
|
||||
LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER
|
||||
| LAB_VIEW_CRITERIA_NO_DIALOG;
|
||||
if (filter->workspace == CYCLE_WORKSPACE_CURRENT) {
|
||||
criteria |= LAB_VIEW_CRITERIA_CURRENT_WORKSPACE;
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
static struct wl_list *prev(struct wl_list *elm) { return elm->prev; }
|
||||
static struct wl_list *next(struct wl_list *elm) { return elm->next; }
|
||||
|
||||
|
|
@ -331,13 +344,10 @@ cycle_immediate(enum lab_cycle_dir direction, struct cycle_filter filter)
|
|||
if (wl_list_empty(&server.views)) {
|
||||
return;
|
||||
}
|
||||
enum lab_view_criteria criteria =
|
||||
LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER
|
||||
| LAB_VIEW_CRITERIA_NO_DIALOG;
|
||||
if (filter.workspace == CYCLE_WORKSPACE_CURRENT) {
|
||||
criteria |= LAB_VIEW_CRITERIA_CURRENT_WORKSPACE;
|
||||
}
|
||||
|
||||
enum lab_view_criteria criteria = get_view_criteria(&filter);
|
||||
uint64_t cycle_outputs = get_outputs_by_filter(filter.output);
|
||||
|
||||
const char *cycle_app_id = NULL;
|
||||
if (filter.app_id == CYCLE_APP_ID_CURRENT && server.active_view) {
|
||||
cycle_app_id = server.active_view->app_id;
|
||||
|
|
@ -381,15 +391,8 @@ cycle_immediate(enum lab_cycle_dir direction, struct cycle_filter filter)
|
|||
static bool
|
||||
init_cycle(struct cycle_filter filter)
|
||||
{
|
||||
enum lab_view_criteria criteria =
|
||||
LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER
|
||||
| LAB_VIEW_CRITERIA_NO_DIALOG;
|
||||
if (filter.workspace == CYCLE_WORKSPACE_CURRENT) {
|
||||
criteria |= LAB_VIEW_CRITERIA_CURRENT_WORKSPACE;
|
||||
}
|
||||
|
||||
uint64_t cycle_outputs =
|
||||
get_outputs_by_filter(filter.output);
|
||||
enum lab_view_criteria criteria = get_view_criteria(&filter);
|
||||
uint64_t cycle_outputs = get_outputs_by_filter(filter.output);
|
||||
|
||||
const char *cycle_app_id = NULL;
|
||||
if (filter.app_id == CYCLE_APP_ID_CURRENT && server.active_view) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue