]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config: move cycle_* bools to window_switcher struct
authorJohan Malm <jgm323@gmail.com>
Thu, 20 Apr 2023 21:31:26 +0000 (22:31 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 21 Apr 2023 15:05:48 +0000 (16:05 +0100)
include/config/rcxml.h
src/config/rcxml.c
src/osd.c

index cdc01df835e95dadce12b0c6ea629520ac3b7219..4679239782eacfa957bf94103378dcf37d3f5d27 100644 (file)
@@ -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;
 };
index 564943283029009760ad39dd9c54d3c1b6d2309b..d64807d33529b763deb4dfe6e3a4e5663cb61eda 100644 (file)
@@ -482,11 +482,11 @@ entry(xmlNode *node, char *nodename, char *content)
 
        /* <windowSwitcher show="" preview="" outlines="" /> */
        } 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, "<cycleViewOSD> is deprecated."
                        " Use <windowSwitcher show=\"\" />");
        } else if (!strcasecmp(nodename, "cycleViewPreview.core")) {
-               rc.cycle_preview_contents = get_bool(content);
+               rc.window_switcher.preview = get_bool(content);
                wlr_log(WLR_ERROR, "<cycleViewPreview> is deprecated."
                        " Use <windowSwitcher preview=\"\" />");
        } else if (!strcasecmp(nodename, "cycleViewOutlines.core")) {
-               rc.cycle_preview_outlines = get_bool(content);
+               rc.window_switcher.outlines = get_bool(content);
                wlr_log(WLR_ERROR, "<cycleViewOutlines> is deprecated."
                        " Use <windowSwitcher outlines=\"\" />");
 
@@ -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;
 }
 
index d2f5a56774b25e97200aa8911577201018173722..4459d7dcbbebfd1198db003427d1401abc8fa0d6 100644 (file)
--- 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);
        }
 }