From 693c5bd937edbf746f940fc4bcb67b3911833fd0 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Thu, 20 Apr 2023 22:31:26 +0100 Subject: [PATCH] config: move cycle_* bools to window_switcher struct --- include/config/rcxml.h | 8 +++----- src/config/rcxml.c | 26 ++++++++++++++------------ src/osd.c | 6 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/config/rcxml.h b/include/config/rcxml.h index cdc01df8..46792397 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -66,11 +66,6 @@ struct rcxml { int snap_edge_range; bool snap_top_maximize; - /* cycle view (alt+tab) */ - bool cycle_view_osd; - bool cycle_preview_contents; - bool cycle_preview_outlines; - struct { int popuptime; struct wl_list workspaces; /* struct workspace.link */ @@ -80,6 +75,9 @@ struct rcxml { struct wl_list regions; /* struct region.link */ struct { + bool show; + bool preview; + bool outlines; struct wl_list fields; /* struct window_switcher_field.link */ } window_switcher; }; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 56494328..d64807d3 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -482,11 +482,11 @@ entry(xmlNode *node, char *nodename, char *content) /* */ } else if (!strcasecmp(nodename, "show.windowSwitcher")) { - rc.cycle_view_osd = get_bool(content); + rc.window_switcher.show = get_bool(content); } else if (!strcasecmp(nodename, "preview.windowSwitcher")) { - rc.cycle_preview_contents = get_bool(content); + rc.window_switcher.preview = get_bool(content); } else if (!strcasecmp(nodename, "outlines.windowSwitcher")) { - rc.cycle_preview_outlines = get_bool(content); + rc.window_switcher.outlines = get_bool(content); /* Remove this long term - just a friendly warning for now */ } else if (strstr(nodename, "windowswitcher.core")) { @@ -494,23 +494,23 @@ entry(xmlNode *node, char *nodename, char *content) /* The following three are for backward compatibility only */ } else if (!strcasecmp(nodename, "show.windowSwitcher.core")) { - rc.cycle_view_osd = get_bool(content); + rc.window_switcher.show = get_bool(content); } else if (!strcasecmp(nodename, "preview.windowSwitcher.core")) { - rc.cycle_preview_contents = get_bool(content); + rc.window_switcher.preview = get_bool(content); } else if (!strcasecmp(nodename, "outlines.windowSwitcher.core")) { - rc.cycle_preview_outlines = get_bool(content); + rc.window_switcher.outlines = get_bool(content); /* The following three are for backward compatibility only */ } else if (!strcasecmp(nodename, "cycleViewOSD.core")) { - rc.cycle_view_osd = get_bool(content); + rc.window_switcher.show = get_bool(content); wlr_log(WLR_ERROR, " is deprecated." " Use "); } else if (!strcasecmp(nodename, "cycleViewPreview.core")) { - rc.cycle_preview_contents = get_bool(content); + rc.window_switcher.preview = get_bool(content); wlr_log(WLR_ERROR, " is deprecated." " Use "); } else if (!strcasecmp(nodename, "cycleViewOutlines.core")) { - rc.cycle_preview_outlines = get_bool(content); + rc.window_switcher.outlines = get_bool(content); wlr_log(WLR_ERROR, " is deprecated." " Use "); @@ -644,9 +644,11 @@ rcxml_init(void) rc.screen_edge_strength = 20; rc.snap_edge_range = 1; rc.snap_top_maximize = true; - rc.cycle_view_osd = true; - rc.cycle_preview_contents = true; - rc.cycle_preview_outlines = true; + + rc.window_switcher.show = true; + rc.window_switcher.preview = true; + rc.window_switcher.outlines = true; + rc.workspace_config.popuptime = INT_MIN; } diff --git a/src/osd.c b/src/osd.c index d2f5a567..4459d7dc 100644 --- a/src/osd.c +++ b/src/osd.c @@ -444,7 +444,7 @@ osd_update(struct server *server) return; } - if (rc.cycle_view_osd) { + if (rc.window_switcher.show) { /* Display the actual OSD */ struct output *output; wl_list_for_each(output, &server->outputs, link) { @@ -456,13 +456,13 @@ osd_update(struct server *server) } /* Outline current window */ - if (rc.cycle_preview_outlines) { + if (rc.window_switcher.outlines) { if (isfocusable(server->osd_state.cycle_view)) { osd_update_preview_outlines(server->osd_state.cycle_view); } } - if (rc.cycle_preview_contents) { + if (rc.window_switcher.preview) { preview_cycled_view(server->osd_state.cycle_view); } }