mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-04-08 08:21:12 -04:00
Add scale parameter
This commit is contained in:
parent
3321daef98
commit
a13c18b761
3 changed files with 13 additions and 1 deletions
10
cage.c
10
cage.c
|
|
@ -193,6 +193,7 @@ usage(FILE *file, const char *cage)
|
||||||
" -m extend Extend the display across all connected outputs (default)\n"
|
" -m extend Extend the display across all connected outputs (default)\n"
|
||||||
" -m last Use only the last connected output\n"
|
" -m last Use only the last connected output\n"
|
||||||
" -r\t Rotate the output 90 degrees clockwise, specify up to three times\n"
|
" -r\t Rotate the output 90 degrees clockwise, specify up to three times\n"
|
||||||
|
" -l scale Set the output scale (e.g. for HiDPI displays)\n"
|
||||||
" -s\t Allow VT switching\n"
|
" -s\t Allow VT switching\n"
|
||||||
" -v\t Show the version number and exit\n"
|
" -v\t Show the version number and exit\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
@ -204,7 +205,7 @@ static bool
|
||||||
parse_args(struct cg_server *server, int argc, char *argv[])
|
parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "dhm:rsv")) != -1) {
|
while ((c = getopt(argc, argv, "dhm:rl:sv")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'd':
|
case 'd':
|
||||||
server->xdg_decoration = true;
|
server->xdg_decoration = true;
|
||||||
|
|
@ -225,6 +226,12 @@ parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
server->scale = atof(optarg);
|
||||||
|
if (server->scale < 0.1) {
|
||||||
|
server->scale = 1.0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
server->allow_vt_switch = true;
|
server->allow_vt_switch = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -271,6 +278,7 @@ main(int argc, char *argv[])
|
||||||
pid_t pid = 0;
|
pid_t pid = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
server.scale = 1.0;
|
||||||
if (!parse_args(&server, argc, argv)) {
|
if (!parse_args(&server, argc, argv)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
output.c
2
output.c
|
|
@ -187,6 +187,8 @@ handle_new_output(struct wl_listener *listener, void *data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wlr_output_set_scale(wlr_output, server->scale);
|
||||||
|
|
||||||
output->wlr_output = wlr_output;
|
output->wlr_output = wlr_output;
|
||||||
output->server = server;
|
output->server = server;
|
||||||
|
|
||||||
|
|
|
||||||
2
server.h
2
server.h
|
|
@ -51,6 +51,8 @@ struct cg_server {
|
||||||
bool xdg_decoration;
|
bool xdg_decoration;
|
||||||
bool allow_vt_switch;
|
bool allow_vt_switch;
|
||||||
enum wl_output_transform output_transform;
|
enum wl_output_transform output_transform;
|
||||||
|
|
||||||
|
float scale;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue