diff --git a/ChangeLog b/ChangeLog index d090a09..c6a3b7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ v.0.5dev (ongoing development) * Reset ccmode on screen clear for NoritakeVFD, tyan driver * All drivers: Refactor CGmode enum into lcd.h * hd44780: New (possible faster) screen update algorithm + + Add an option to start LCDd with screen rotation disabled (M. Zanetti) v0.5.4 * Update driver includes and LDFLAGS (fixed glk and bayrad binding error) @@ -187,7 +188,7 @@ v.0.5.1 * more options in lcdproc's config file lcdproc.conf: + time and date formats can be changed using strftime formats + Load screen's LowLoad & HighLoad thresholds - * revamped lcdexec's menu configuration + * revamped lcdexec's menu configuration * various little fixes v0.5.0 diff --git a/LCDd.conf b/LCDd.conf index ef490d1..d04114c 100644 --- a/LCDd.conf +++ b/LCDd.conf @@ -82,6 +82,12 @@ User=nobody # Sets the default time in seconds to displays a screen. WaitTime=5 +# If set to no, LCDd will start with screen rotation disabled. This has the +# same effect as if the ToggleRotateKey had been pressed. Rotation will start +# if the ToggleRotateKey is pressed. Note that this setting does not turn off +# priority sorting of screens. [default: on; legal: on, off] +#AutoRotate=no + # If yes, the the serverscreen will be rotated as a usual info screen. If no, # it will be a background screen, only visible when no other screens are # active. The special value 'blank' is similar to no, but only a blank screen diff --git a/docs/lcdproc-user/configuration.docbook b/docs/lcdproc-user/configuration.docbook index 55c5e48..7908daf 100644 --- a/docs/lcdproc-user/configuration.docbook +++ b/docs/lcdproc-user/configuration.docbook @@ -369,6 +369,29 @@ settings for the LCDproc server LCDd. + + + AutoRotate = ¶meters.yesdefno; + + + + If set to no, LCDd will start with screen rotation disabled. + This has the same effect as if the ToggleRotateKey had been pressed. + Rotation will start if the ToggleRotateKey is pressed. + + + + This setting does not turn off priority sorting of screens. Therefore + the client or LCDd may still show a different screen if it assigns it + a higher priority than any other screen. Due to the way priority + sorting works the screen shown when the first client connects may not + be that clients first screen. If the client sets up more than two + screens it will be the next to last one (this is not considered a bug). + + + + + ServerScreen = diff --git a/server/main.c b/server/main.c index 3774d1a..9683db5 100644 --- a/server/main.c +++ b/server/main.c @@ -88,10 +88,7 @@ #define DEFAULT_BACKLIGHT BACKLIGHT_OPEN #define DEFAULT_HEARTBEAT HEARTBEAT_OPEN #define DEFAULT_TITLESPEED TITLESPEED_MAX - -/* All variables are set to 'unset' values*/ -#define UNSET_INT -1 -#define UNSET_STR "\01" +#define DEFAULT_AUTOROTATE AUTOROTATE_ON /* Socket to bind to... @@ -444,6 +441,10 @@ process_configfile(char *configfile) heartbeat = config_get_tristate("Server", "Heartbeat", 0, "open", UNSET_INT); } + if (autorotate == UNSET_INT) { + autorotate = config_get_bool("Server", "AutoRotate", 0, DEFAULT_AUTOROTATE); + } + if (titlespeed == UNSET_INT) { int speed = config_get_int("Server", "TitleSpeed", 0, DEFAULT_TITLESPEED); diff --git a/server/screenlist.c b/server/screenlist.c index dd82f94..9c5d6e9 100644 --- a/server/screenlist.c +++ b/server/screenlist.c @@ -26,7 +26,7 @@ /* Local functions */ int compare_priority(void *one, void *two); -bool autorotate = 1; /* If on, INFO and FOREGROUND screens will rotate */ +bool autorotate = UNSET_INT; /* If on, INFO and FOREGROUND screens will rotate */ LinkedList *screenlist = NULL; Screen *current_screen = NULL; long int current_screen_start_time = 0; @@ -103,8 +103,7 @@ screenlist_process(void) if (!screenlist) return; - - /* Sort the list acfording to priority class */ + /* Sort the list according to priority class */ LL_Sort(screenlist, compare_priority); f = LL_GetFirst(screenlist); @@ -147,6 +146,7 @@ screenlist_process(void) * current one ? */ if (f->priority > s->priority) { /* Yes, switch to that screen, job done */ + report(RPT_DEBUG, "%s: High priority screen [%.40s] selected", __FUNCTION__, f->id); screenlist_switch(f); return; } diff --git a/server/screenlist.h b/server/screenlist.h index 0496b78..c02965d 100644 --- a/server/screenlist.h +++ b/server/screenlist.h @@ -15,15 +15,10 @@ #include "screen.h" -#define SCR_HOLD 1 -#define SCR_SKIP 2 -#define SCR_BACK 3 -#define RENDER_HOLD 11 -#define RENDER_SKIP 12 -#define RENDER_BACK 13 +#define AUTOROTATE_OFF 0 +#define AUTOROTATE_ON 1 -/*extern int screenlist_action;*/ -extern bool autorotate; +extern bool autorotate; /**< If enabled, screens will rotate */ int screenlist_init(void); /* Initializes the screenlist. */