From c1490b632d579fb9e8c0ff6483e330d32310a6f6 Mon Sep 17 00:00:00 2001 From: Flrian <4444593+Flrian@users.noreply.github.com> Date: Wed, 24 Aug 2022 20:27:08 +0200 Subject: [PATCH] Add config option to disable preview outlines --- docs/labwc-config.5.scd | 4 ++++ docs/rc.xml.all | 1 + include/config/rcxml.h | 1 + src/config/rcxml.c | 3 +++ src/osd.c | 4 +++- 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 08a6f87a..845da4a9 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -71,6 +71,10 @@ The rest of this man page describes configuration options. Preview the contents of the selected window when cycling between windows. Default is no. +** [yes|no] + Draw an outline around the selected window when cycling between windows. + Default is yes. + ## RESISTANCE ** diff --git a/docs/rc.xml.all b/docs/rc.xml.all index 18ed01ed..390599f8 100644 --- a/docs/rc.xml.all +++ b/docs/rc.xml.all @@ -12,6 +12,7 @@ 0 no no + yes diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 5827f51a..3f6b248d 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -55,6 +55,7 @@ struct rcxml { /* cycle view (alt+tab) */ bool cycle_preview_contents; + bool cycle_preview_outlines; struct { int popuptime; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index ece59763..2065c580 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -388,6 +388,8 @@ entry(xmlNode *node, char *nodename, char *content) rc.snap_top_maximize = get_bool(content); } else if (!strcasecmp(nodename, "cycleViewPreview.core")) { rc.cycle_preview_contents = get_bool(content); + } else if (!strcasecmp(nodename, "cycleViewOutlines.core")) { + rc.cycle_preview_outlines = get_bool(content); } else if (!strcasecmp(nodename, "name.names.desktops")) { struct workspace *workspace = calloc(1, sizeof(struct workspace)); workspace->name = strdup(content); @@ -493,6 +495,7 @@ rcxml_init() rc.snap_edge_range = 1; rc.snap_top_maximize = true; rc.cycle_preview_contents = false; + rc.cycle_preview_outlines = true; rc.workspace_config.popuptime = INT_MIN; wl_list_init(&rc.workspace_config.workspaces); } diff --git a/src/osd.c b/src/osd.c index 7bbd8ad4..7de869be 100644 --- a/src/osd.c +++ b/src/osd.c @@ -193,7 +193,9 @@ osd_update(struct server *server) cairo_rectangle(cairo, OSD_BORDER_WIDTH, y, OSD_ITEM_WIDTH, OSD_ITEM_HEIGHT); cairo_stroke(cairo); - osd_update_preview_outlines(view); + if (rc.cycle_preview_outlines) { + osd_update_preview_outlines(view); + } break; } y += OSD_ITEM_HEIGHT;