config: add <core><adaptiveSync>

This commit is contained in:
Johan Malm 2021-10-22 20:23:09 +01:00
parent d9253331cd
commit c48b9d44d1
6 changed files with 10 additions and 7 deletions

View 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]

View 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)

View file

@ -10,6 +10,7 @@
<core>
<decoration>server</decoration>
<gap>0</gap>
<adaptiveSync>no</adaptiveSync>
</core>
<!--

View 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;

View 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")) {

View 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);