Small improvement to status message.
This commit is contained in:
1 parent
60258cb82b
commit
8650a737e1
1 file changed
+7
-4
@@ -486,7 +486,7 @@ static void
|
|||||||
render_screen(struct arena *arena,
|
render_screen(struct arena *arena,
|
||||||
Display *dpy, struct lock **locks,
|
Display *dpy, struct lock **locks,
|
||||||
FT_Face main_font_face, FT_Face secondary_font_face,
|
FT_Face main_font_face, FT_Face secondary_font_face,
|
||||||
unsigned int pass_len, int failure)
|
unsigned int pass_len, int failure, int locked)
|
||||||
{
|
{
|
||||||
XWindowAttributes attrs;
|
XWindowAttributes attrs;
|
||||||
if(XGetWindowAttributes(dpy, locks[0]->win, &attrs)) {
|
if(XGetWindowAttributes(dpy, locks[0]->win, &attrs)) {
|
||||||
@@ -534,7 +534,7 @@ render_screen(struct arena *arena,
|
|||||||
message_str = (char *)arena_alloc(&temp_arena, message_str_len);
|
message_str = (char *)arena_alloc(&temp_arena, message_str_len);
|
||||||
if(failure)
|
if(failure)
|
||||||
memcpy(message_str, "wrong password", 15);
|
memcpy(message_str, "wrong password", 15);
|
||||||
else
|
else if(locked)
|
||||||
memcpy(message_str, "locked", 7);
|
memcpy(message_str, "locked", 7);
|
||||||
if(pass_len > 0) {
|
if(pass_len > 0) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -626,7 +626,7 @@ readpw(struct arena *arena,
|
|||||||
{
|
{
|
||||||
XRRScreenChangeNotifyEvent *rre;
|
XRRScreenChangeNotifyEvent *rre;
|
||||||
char buf[32], passwd[256], *inputhash;
|
char buf[32], passwd[256], *inputhash;
|
||||||
int num, screen, running, failure, oldc, i, passing, dson, tfd, xfd;
|
int num, screen, running, failure, locked, oldc, i, passing, dson, tfd, xfd;
|
||||||
unsigned int len, color;
|
unsigned int len, color;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
KeySym ksym;
|
KeySym ksym;
|
||||||
@@ -641,6 +641,7 @@ readpw(struct arena *arena,
|
|||||||
len = 0;
|
len = 0;
|
||||||
running = 1;
|
running = 1;
|
||||||
failure = 0;
|
failure = 0;
|
||||||
|
locked = 1;
|
||||||
oldc = INIT;
|
oldc = INIT;
|
||||||
dson = 1;
|
dson = 1;
|
||||||
|
|
||||||
@@ -749,6 +750,8 @@ readpw(struct arena *arena,
|
|||||||
if (running) {
|
if (running) {
|
||||||
XBell(dpy, 100);
|
XBell(dpy, 100);
|
||||||
failure = 1;
|
failure = 1;
|
||||||
|
} else {
|
||||||
|
locked = 0;
|
||||||
}
|
}
|
||||||
explicit_bzero(&passwd, sizeof(passwd));
|
explicit_bzero(&passwd, sizeof(passwd));
|
||||||
len = 0;
|
len = 0;
|
||||||
@@ -807,7 +810,7 @@ readpw(struct arena *arena,
|
|||||||
render_screen(arena,
|
render_screen(arena,
|
||||||
dpy, locks,
|
dpy, locks,
|
||||||
fonts.main_face, fonts.secondary_face,
|
fonts.main_face, fonts.secondary_face,
|
||||||
len, failure);
|
len, failure, locked);
|
||||||
|
|
||||||
if(millis() - rendering_timeout_millis >= 500) {
|
if(millis() - rendering_timeout_millis >= 500) {
|
||||||
needs_rendering = 0;
|
needs_rendering = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user