Record whether the width or height were set manually, and refrain from changing a manually set value when the terminal size changes.

This commit is contained in:
Andrew Wood
2023-08-28 22:03:14 +01:00
parent 9e5bdeb3a4
commit b7eb3c9e90
11 changed files with 56 additions and 18 deletions
+2
View File
@@ -53,6 +53,8 @@ struct opts_s { /* structure describing run-time options */
unsigned int average_rate_window; /* time window in seconds for average rate calculations */
unsigned int width; /* screen width */
unsigned int height; /* screen height */
bool width_set_manually; /* width was set manually, not detected */
bool height_set_manually; /* height was set manually, not detected */
/*@keep@*/ /*@null@*/ char *name; /* display name, if any */
/*@keep@*/ /*@null@*/ char *format; /* output format, if any */
/*@keep@*/ /*@null@*/ char *pidfile; /* PID file, if any */
+2
View File
@@ -107,6 +107,8 @@ struct pvstate_s {
int watch_fd; /* fd to watch */
unsigned int width; /* screen width */
unsigned int height; /* screen height */
bool width_set_manually; /* width was set manually, not detected */
bool height_set_manually; /* height was set manually, not detected */
/*@null@*/ char *name; /* display name */
char default_format[PV_SIZEOF_DEFAULT_FORMAT]; /* default format string */
char *format_string; /* output format string */
+2 -2
View File
@@ -119,8 +119,8 @@ extern void pv_state_no_splice_set(pvstate_t, bool);
extern void pv_state_discard_input_set(pvstate_t, bool);
extern void pv_state_size_set(pvstate_t, unsigned long long);
extern void pv_state_interval_set(pvstate_t, double);
extern void pv_state_width_set(pvstate_t, unsigned int);
extern void pv_state_height_set(pvstate_t, unsigned int);
extern void pv_state_width_set(pvstate_t, unsigned int, bool);
extern void pv_state_height_set(pvstate_t, unsigned int, bool);
extern void pv_state_name_set(pvstate_t, /*@null@*/ const char *);
extern void pv_state_format_string_set(pvstate_t, /*@null@*/ const char *);
extern void pv_state_watch_pid_set(pvstate_t, unsigned int);