X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmain.C;h=6e0b6d5e7422a3027b107139ef71e8dd52bf692c;hb=6ff8b339d215bb1c2cef589fd7959aa2e1834105;hp=6833425d0b7d1d30aafc08c945f3e25fbb3475d1;hpb=dcdf2f77cc47ca7c543f27ddb03c4814015d974b;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/main.C b/cinelerra-5.1/cinelerra/main.C index 6833425d..6e0b6d5e 100644 --- a/cinelerra-5.1/cinelerra/main.C +++ b/cinelerra-5.1/cinelerra/main.C @@ -121,6 +121,25 @@ public: long cin_timezone; +static float get_layout_scale() +{ + char config_path[BCTEXTLEN]; + sprintf(config_path,"%s/%s", File::get_config_path(), CONFIG_FILE); + FILE *fp = fopen(config_path,"r"); + if( !fp ) return 0; + float scale = 0; + char line[BCTEXTLEN]; + line[BCTEXTLEN-1] = 0; + while( fgets(line, BCTEXTLEN-1, fp) ) { + if( !strncmp(line, "LAYOUT_SCALE ",12+1) ) { + scale = atof(line+12); + break; + } + } + fclose(fp); + return scale; +} + int main(int argc, char *argv[]) { // handle command line arguments first @@ -258,7 +277,10 @@ int main(int argc, char *argv[]) } } - + float scale = operation == DO_GUI ? + get_layout_scale() : 1; + // runs XInitThreads + BC_WindowBase::init_resources(scale); if( operation == DO_GUI || operation == DO_DEAMON || operation == DO_DEAMON_FG || @@ -401,6 +423,7 @@ DISABLE_BUFFER filenames.remove_all_objects(); Units::finit(); + BC_WindowBase::finit_resources(); time_t et; time(&et); long dt = et - st;