Added password status.
This commit is contained in:
1 parent
408338bff3
commit
60258cb82b
2 files changed
+9
-4
No files matched your search
@@ -56,7 +56,8 @@ ifeq ($(OS),OS_MACOS)
|
|||||||
LIBS =
|
LIBS =
|
||||||
FRAMEWORKS =
|
FRAMEWORKS =
|
||||||
else ifeq ($(OS),OS_LINUX)
|
else ifeq ($(OS),OS_LINUX)
|
||||||
FLAGS = -O3 # -ggdb -DDEBUG=1 -DINTERNAL=1
|
# FLAGS = -ggdb -DDEBUG=1 -DINTERNAL=1
|
||||||
|
FLAGS = -O3
|
||||||
INCLUDE = -I/usr/include -I/usr/X11R6/include \
|
INCLUDE = -I/usr/include -I/usr/X11R6/include \
|
||||||
-I./libs/include/freetype2
|
-I./libs/include/freetype2
|
||||||
LIBS = -lc -lcrypt -lX11 -lXext -lXrandr \
|
LIBS = -lc -lcrypt -lX11 -lXext -lXrandr \
|
||||||
|
|||||||
@@ -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)
|
unsigned int pass_len, int failure)
|
||||||
{
|
{
|
||||||
XWindowAttributes attrs;
|
XWindowAttributes attrs;
|
||||||
if(XGetWindowAttributes(dpy, locks[0]->win, &attrs)) {
|
if(XGetWindowAttributes(dpy, locks[0]->win, &attrs)) {
|
||||||
@@ -532,7 +532,10 @@ render_screen(struct arena *arena,
|
|||||||
|
|
||||||
message_str_len = 32;
|
message_str_len = 32;
|
||||||
message_str = (char *)arena_alloc(&temp_arena, message_str_len);
|
message_str = (char *)arena_alloc(&temp_arena, message_str_len);
|
||||||
memset(message_str, 0, message_str_len);
|
if(failure)
|
||||||
|
memcpy(message_str, "wrong password", 15);
|
||||||
|
else
|
||||||
|
memcpy(message_str, "locked", 7);
|
||||||
if(pass_len > 0) {
|
if(pass_len > 0) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
@@ -753,6 +756,7 @@ readpw(struct arena *arena,
|
|||||||
case XK_Escape:
|
case XK_Escape:
|
||||||
explicit_bzero(&passwd, sizeof(passwd));
|
explicit_bzero(&passwd, sizeof(passwd));
|
||||||
len = 0;
|
len = 0;
|
||||||
|
failure = 0;
|
||||||
break;
|
break;
|
||||||
case XK_BackSpace:
|
case XK_BackSpace:
|
||||||
if (len)
|
if (len)
|
||||||
@@ -803,7 +807,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);
|
len, failure);
|
||||||
|
|
||||||
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