mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-06 09:26:44 +02:00
Interface improvements and bump to v0.10.0
- Give window tab and statusbar a make over - Place window tab above input field - Reduce input field to one square in height - Refactor window tab so that it's now a subwin of its parent ToxWindow - Fix bug causing notification counter to sometimes increment by 2 - No longer scroll on output when output is not at bottom of screen - Show a small indicator on far left of window tab when output is not at bottom of screen - Reduce ncurses/UI thread sleep time by half - Handle nanosleep errors better
This commit is contained in:
@ -71,16 +71,19 @@ int timed_out(time_t timestamp, time_t timeout)
|
||||
return timestamp + timeout <= get_unix_time();
|
||||
}
|
||||
|
||||
/* Sleeps the caller's thread for `usec` microseconds */
|
||||
/* Attempts to sleep the caller's thread for `usec` microseconds */
|
||||
void sleep_thread(long int usec)
|
||||
{
|
||||
struct timespec req;
|
||||
struct timespec rem;
|
||||
|
||||
req.tv_sec = 0;
|
||||
req.tv_nsec = usec * 1000L;
|
||||
|
||||
if (nanosleep(&req, NULL) == -1) {
|
||||
fprintf(stderr, "nanosleep() returned -1\n");
|
||||
if (nanosleep(&req, &rem) == -1) {
|
||||
if (nanosleep(&rem, NULL) == -1) {
|
||||
fprintf(stderr, "nanosleep() returned -1\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user