1
0
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:
jfreegman
2020-11-29 23:26:51 -05:00
parent 61740bda85
commit 1e985c1456
17 changed files with 519 additions and 272 deletions

View File

@ -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");
}
}
}