Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commits (1)
  • Deucе's avatar
    Add a "fake mode" for output drivers that can't change screen size · cd16d7c1
    Deucе authored
    Previously, the height was left the same, and the width was set to
    the next-lowest "standard" size.  Now the cterm window is set to
    the size of the requested mode and both top/bottom and side bars
    are added to make the virtual screen the same as the requested one.
    
    Using the "current" mode still retains the old behaviour.
    
    Closes SF request 11
    cd16d7c1
......@@ -112,6 +112,7 @@ int safe_mode=0;
FILE* log_fp;
extern ini_style_t ini_style;
BOOL quitting=FALSE;
int fake_mode = -1;
#ifdef _WINSOCKAPI_
......@@ -1685,6 +1686,8 @@ int main(int argc, char **argv)
gettextinfo(&txtinfo); /* Current mode may have changed while in show_bbslist() */
FREE_AND_NULL(last_bbs);
uifcbail();
if (bbs->screen_mode != SCREEN_MODE_CURRENT)
fake_mode = screen_to_ciolib(bbs->screen_mode);
textmode(screen_to_ciolib(bbs->screen_mode));
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
......@@ -1694,6 +1697,7 @@ int main(int argc, char **argv)
load_font_files();
uifcbail();
textmode(txtinfo.currmode);
fake_mode = -1;
init_uifc(TRUE, TRUE);
settitle("SyncTERM");
} else {
......@@ -1734,6 +1738,7 @@ int main(int argc, char **argv)
if(doterm(bbs))
quitting=TRUE;
fake_mode = -1;
setvideoflags(0);
if(log_fp!=NULL) {
......
......@@ -84,6 +84,7 @@ extern char *output_types[];
extern int output_map[];
extern char *output_descrs[];
extern char *output_enum[];
extern int fake_mode;
void parse_url(char *url, struct bbslist *bbs, int dflt_conn_type, int force_defaults);
char *get_syncterm_filename(char *fn, int fnlen, int type, int shared);
......
......@@ -2,6 +2,7 @@
#include <gen_defs.h>
#include <ciolib.h>
#include <vidmodes.h>
#include "uifcinit.h"
#include "term.h"
#include "syncterm.h"
......@@ -10,18 +11,28 @@ void
get_term_win_size(int *width, int *height, int *nostatus)
{
struct text_info txtinfo;
int vmode = find_vmode(fake_mode);
gettextinfo(&txtinfo);
if(txtinfo.screenwidth < 80)
*width=40;
if (vmode != -1 && txtinfo.screenwidth >= vparams[vmode].cols) {
*width = vparams[vmode].cols;
}
else {
if(txtinfo.screenwidth <132)
*width=80;
else
*width=132;
if(txtinfo.screenwidth < 80)
*width=40;
else {
if(txtinfo.screenwidth <132)
*width=80;
else
*width=132;
}
}
*height=txtinfo.screenheight;
if (vmode != -1) {
if (txtinfo.screenheight >= vparams[vmode].rows)
*height = vparams[vmode].rows;
}
if(!*nostatus)
(*height)--;
if(*height<24) {
......