]> git.mdlowis.com Git - proto/labwc.git/commitdiff
output: Add option to preview the contents of the current cycle_view
authorLiam Middlebrook <lmiddlebrook@nvidia.com>
Thu, 20 Jan 2022 19:38:23 +0000 (11:38 -0800)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 23 Jan 2022 16:02:54 +0000 (16:02 +0000)
Add the 'cycleViewPreview.core' option to rc.xml to enable previews of
the selected view when cycling between windows. Default this option to
be disabled to match current behavior.

docs/labwc-config.5.scd
docs/rc.xml.all
include/config/rcxml.h
src/config/rcxml.c
src/output.c

index a27261ae9a43366b2bcf6f2ba0086b49eb6ea223..8f352ac3329386d592d7c77f5883c3959861a6d5 100644 (file)
@@ -31,6 +31,10 @@ Configuration must be wrapped in a <labwc_config> root-node.
 *<core><adaptiveSync>* [yes|no]
        Enable adaptive sync. Default is no.
 
+*<core><cycleViewPreview>* [yes|no]
+       Preview the contents of the selected window when cycling between windows.
+       Default is no.
+
 # FOCUS
 
 *<focus><followMouse>* [yes|no]
index 0f724dfde8a04a676583f211316c22ede2b38e21..f3e29eeabfa3d6cf3351052f71579c075af092fa 100644 (file)
@@ -11,6 +11,7 @@
     <decoration>server</decoration>
     <gap>0</gap>
     <adaptiveSync>no</adaptiveSync>
+    <cycleViewPreview>no</cycleViewPreview>
   </core>
 
   <!--
index 42d662836d6fd77506de67b213335b30fe3a8c88..934f742fbb9907a281fda2757e967f4ce6187aae 100644 (file)
@@ -48,6 +48,9 @@ struct rcxml {
        /* window snapping */
        int snap_edge_range;
        bool snap_top_maximize;
+
+       /* cycle view (alt+tab) */
+       bool cycle_preview_contents;
 };
 
 extern struct rcxml rc;
index 104211f09778c9ac98cacce7d79c76db5680369b..588f8cdb79a71c4f5b599e5fa43b5939b04462e1 100644 (file)
@@ -384,6 +384,8 @@ entry(xmlNode *node, char *nodename, char *content)
                rc.snap_edge_range = atoi(content);
        } else if (!strcasecmp(nodename, "topMaximize.snapping")) {
                rc.snap_top_maximize = get_bool(content);
+       } else if (!strcasecmp(nodename, "cycleViewPreview.core")) {
+               rc.cycle_preview_contents = get_bool(content);
        }
 }
 
@@ -482,6 +484,7 @@ rcxml_init()
        rc.screen_edge_strength = 20;
        rc.snap_edge_range = 1;
        rc.snap_top_maximize = true;
+       rc.cycle_preview_contents = false;
 }
 
 static struct {
index 5be2203827d989587f5976bcfd286d9001b97251..bccfb12c6c208e5192f011d68aaf817e92dfbdd0 100644 (file)
@@ -802,6 +802,16 @@ output_render(struct output *output, pixman_region32_t *damage)
 
        /* 'alt-tab' border */
        if (output->server->cycle_view) {
+               /* If the 'cycle_preview_contents' option is set in
+                * rc.xml, render the contents of the cycle_view over
+                * all other views (except for the OSD)
+                */
+               if (rc.cycle_preview_contents) {
+                       render_deco(output->server->cycle_view, output, damage);
+                       render_view_toplevels(output->server->cycle_view, output, damage);
+                       render_view_popups(output->server->cycle_view, output, damage);
+               }
+
                render_cycle_box(output, damage, output->server->cycle_view);
                render_osd(output, damage, output->server);
        }