Implement blink on fancy status
and fix a bug with condition labels on the TTY status
This commit is contained in:
committed by
Pasi Kallinen
parent
24d9c19378
commit
3398d250aa
@@ -112,6 +112,9 @@ static void X11_error_handler(String) __attribute__((noreturn));
|
||||
ATTRNORETURN static XtErrorHandler X11_error_handler(String);
|
||||
#endif
|
||||
|
||||
boolean X11_blink;
|
||||
static unsigned blink_interval = 500; /* milliseconds */
|
||||
|
||||
static int X11_io_error_handler(Display *);
|
||||
|
||||
static int (*old_error_handler)(Display *, XErrorEvent *);
|
||||
@@ -200,6 +203,7 @@ static void release_yn_widgets(void);
|
||||
static int input_event(int);
|
||||
static void win_visible(Widget, XtPointer, XEvent *, Boolean *);
|
||||
static void init_standard_windows(void);
|
||||
static void blink_callback(XtPointer client_data, XtIntervalId *timer);
|
||||
|
||||
/*
|
||||
* Local variables.
|
||||
@@ -1611,6 +1615,7 @@ X11_init_nhwindows(int *argcp, char **argv)
|
||||
(ArgList) args, num_args);
|
||||
XtOverrideTranslations(toplevel,
|
||||
XtParseTranslationTable("<Message>WM_PROTOCOLS: X11_hangup()"));
|
||||
XtAppAddTimeOut(app_context, blink_interval, blink_callback, NULL);
|
||||
|
||||
/* We don't need to realize the top level widget. */
|
||||
|
||||
@@ -1667,6 +1672,20 @@ X11_init_nhwindows(int *argcp, char **argv)
|
||||
X11_putstr(WIN_MESSAGE, 0, copyright_banner_line(i));
|
||||
}
|
||||
|
||||
static void
|
||||
blink_callback(XtPointer client_data, XtIntervalId *timer)
|
||||
{
|
||||
nhUse(timer);
|
||||
#ifdef STATUS_HILITES
|
||||
X11_tty_status_blink();
|
||||
#endif
|
||||
X11_blink_labels();
|
||||
|
||||
X11_blink = !X11_blink;
|
||||
/* Do it again */
|
||||
XtAppAddTimeOut(app_context, blink_interval, blink_callback, client_data);
|
||||
}
|
||||
|
||||
/*
|
||||
* All done.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user