]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config: add <core><adaptiveSync>
authorJohan Malm <jgm323@gmail.com>
Fri, 22 Oct 2021 19:23:09 +0000 (20:23 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 22 Oct 2021 19:23:09 +0000 (20:23 +0100)
docs/labwc-config.5.scd
docs/labwc-environment.5.scd
docs/rc.xml.all
include/config/rcxml.h
src/config/rcxml.c
src/output.c

index 2027f81a2faaea2d32758a49a249056017774a77..57f34959ebc881dfa6ca44bbf1fde7ff49ad5082 100644 (file)
@@ -28,6 +28,9 @@ Configuration must be wrapped in a <labwc_config> root-node.
        The distance in pixels between views and output edges when using
        movement actions, for example MoveToEdge. Default is 0.
 
+*<core><adaptiveSync>* [yes|no]
+       Enable adaptive sync. Default is no.
+
 # FOCUS
 
 *<focus><followMouse>* [yes|no]
index b029d1890b5dcd3f89139066c39b7db3c935207a..89634e14877e26e725fd4835bc74e19fd8371eac 100644 (file)
@@ -23,11 +23,6 @@ For example, this sets keyboard layout to Swedish:
 XKB_DEFAULT_LAYOUT=se
 ```
 
-The following environment variables are supported by labwc:
-
-*LABWC_ADAPTIVE_SYNC*
-       Set to 1 enable adaptive sync
-
 # SEE ALSO
 
 labwc(1)
index 87a8b581a549222747f612d6243eaf2fbf097ec5..16e090324b85926b2b8a59855389aabe4c3b6b8b 100644 (file)
@@ -10,6 +10,7 @@
   <core>
     <decoration>server</decoration>
     <gap>0</gap>
+    <adaptiveSync>no</adaptiveSync>
   </core>
 
   <!--
index 2dbb2096b3f6d429a7ba81b78e5c988948986f65..0738e7306ebca10135bc80a7438bc781a99a2a96 100644 (file)
@@ -11,6 +11,7 @@
 struct rcxml {
        bool xdg_shell_server_side_deco;
        int gap;
+       bool adaptive_sync;
        bool focus_follow_mouse;
        bool raise_on_focus;
        char *theme_name;
index 0f74cdec2550d4f11ab71f6b10224d67f0734de3..9490ec0c50661b0dbe132197f914801e8d1e0832 100644 (file)
@@ -292,6 +292,8 @@ entry(xmlNode *node, char *nodename, char *content)
                }
        } else if (!strcmp(nodename, "gap.core")) {
                rc.gap = atoi(content);
+       } else if (!strcmp(nodename, "adaptiveSync.core")) {
+               rc.adaptive_sync = get_bool(content);
        } else if (!strcmp(nodename, "name.theme")) {
                rc.theme_name = strdup(content);
        } else if (!strcmp(nodename, "cornerradius.theme")) {
index 0e80fa6782513b38808bbbf9a2645400a441142c..c8a44f694dc42a2f10972608d5a16c4f804e78be 100644 (file)
@@ -994,8 +994,9 @@ new_output_notify(struct wl_listener *listener, void *data)
         * TODO: support configuration in run-time
         */
 
-       if (getenv("LABWC_ADAPTIVE_SYNC")) {
-               wlr_log(WLR_INFO, "enable adaptive sync on %s", wlr_output->name);
+       if (rc.adaptive_sync) {
+               wlr_log(WLR_INFO, "enable adaptive sync on %s",
+                       wlr_output->name);
                wlr_output_enable_adaptive_sync(wlr_output, true);
        }
        wlr_output_layout_add_auto(server->output_layout, wlr_output);