Add tearing support (#1390)

Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
This commit is contained in:
Ph42oN 2024-01-08 22:58:58 +02:00 committed by GitHub
parent 72f3ce6b41
commit bce0c6ce56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 111 additions and 1 deletions

View file

@ -102,6 +102,7 @@ enum action_type {
ACTION_TYPE_VIRTUAL_OUTPUT_ADD,
ACTION_TYPE_VIRTUAL_OUTPUT_REMOVE,
ACTION_TYPE_AUTO_PLACE,
ACTION_TYPE_TOGGLE_TEARING,
};
const char *action_names[] = {
@ -149,6 +150,7 @@ const char *action_names[] = {
"VirtualOutputAdd",
"VirtualOutputRemove",
"AutoPlace",
"ToggleTearing",
NULL
};
@ -951,6 +953,13 @@ actions_run(struct view *activator, struct server *server,
}
}
break;
case ACTION_TYPE_TOGGLE_TEARING:
if (view) {
view->tearing_hint = !view->tearing_hint;
wlr_log(WLR_DEBUG, "tearing %sabled",
view->tearing_hint ? "en" : "dis");
}
break;
case ACTION_TYPE_INVALID:
wlr_log(WLR_ERROR, "Not executing unknown action");
break;