Cage: implement output transform

This commit adds the command line switch -r, which rotates the output 90
degrees clockwise and can be specified up to three times.
This commit is contained in:
Tristan Daniel 2019-04-14 01:50:12 +02:00 committed by Jente Hidskes
parent 69872baead
commit 9e6a5ad44f
4 changed files with 20 additions and 6 deletions

11
cage.c
View file

@ -87,6 +87,7 @@ usage(FILE *file, const char *cage)
fprintf(file, "Usage: %s [OPTIONS] [--] APPLICATION\n"
"\n"
" -d\t Don't draw client side decorations, when possible\n"
" -r\t Rotate the output 90 degrees clockwise, specify up to three times\n"
#ifdef DEBUG
" -D\t Turn on damage tracking debugging\n"
#endif
@ -101,14 +102,20 @@ parse_args(struct cg_server *server, int argc, char *argv[])
{
int c;
#ifdef DEBUG
while ((c = getopt(argc, argv, "dDh")) != -1) {
while ((c = getopt(argc, argv, "drDh")) != -1) {
#else
while ((c = getopt(argc, argv, "dh")) != -1) {
while ((c = getopt(argc, argv, "drh")) != -1) {
#endif
switch (c) {
case 'd':
server->xdg_decoration = true;
break;
case 'r':
server->output_transform++;
if (server->output_transform > WL_OUTPUT_TRANSFORM_270) {
server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL;
}
break;
#ifdef DEBUG
case 'D':
server->debug_damage_tracking = true;