More flags for compositor; don't run again unless nested

This commit is contained in:
K. Lange 2018-03-20 20:38:08 +09:00 committed by Kevin Lange
parent 528360486a
commit f6bbb8b2cb
1 changed files with 24 additions and 0 deletions

View File

@ -103,10 +103,29 @@ static int parse_args(int argc, char * argv[], int * out) {
case 'n':
yutani_options.nested = 1;
break;
case 'g':
{
char * c = strstr(argv[i+1], "x");
if (c) {
*c = '\0';
c++;
yutani_options.nest_width = atoi(argv[i+1]);
yutani_options.nest_height = atoi(c);
}
i += 2;
goto _next;
}
case 'h':
return usage(argv);
default:
fprintf(stderr, "Unrecognized option: %c\n", c);
break;
}
c++;
}
}
_next:
;
}
#if 0
static struct option long_opts[] = {
@ -1822,6 +1841,11 @@ int main(int argc, char * argv[]) {
yg->backend_ctx = init_graphics_yutani_double_buffer(yg->host_window);
yg->stride = yg->backend_ctx->width * 4;
} else {
char * d = getenv("DISPLAY");
if (d && *d) {
fprintf(stderr, "DISPLAY is already set but not running nested. This is probably wrong.\n");
return 1;
}
_static_yg = yg;
signal(SIGWINEVENT, yutani_display_resize_handle);
yg->backend_ctx = init_graphics_fullscreen_double_buffer();