summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xrdp/xrdp_bitmap.c24
-rw-r--r--xrdp/xrdp_types.h1
-rw-r--r--xrdp/xrdp_wm.c1
3 files changed, 21 insertions, 5 deletions
diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c
index 8988e30a..3b076c2d 100644
--- a/xrdp/xrdp_bitmap.c
+++ b/xrdp/xrdp_bitmap.c
@@ -365,8 +365,8 @@ int xrdp_bitmap_draw_focus_box(struct xrdp_bitmap* self,
painter->brush.x_orgin = x;
painter->brush.x_orgin = x;
painter->brush.style = 3;
- painter->bg_color = self->wm->black;
- painter->fg_color = self->wm->white;
+ painter->fg_color = self->wm->black;
+ painter->bg_color = self->parent->bg_color;
/* top */
xrdp_painter_fill_rect2(painter, self, x, y, cx, 1);
/* bottom */
@@ -576,13 +576,27 @@ int xrdp_bitmap_invalidate(struct xrdp_bitmap* self, struct xrdp_rect* rect)
xrdp_painter_fill_rect(painter, self, 1, 1, self->width - 2, 1);
/* draw text */
painter->fg_color = self->wm->black;
- xrdp_painter_draw_text(painter, self, 4, 2, self->caption);
- /* draw xor box */
+ if (self->password_char != 0)
+ {
+ i = g_strlen(self->caption);
+ g_memset(text, self->password_char, i);
+ text[i] = 0;
+ xrdp_painter_draw_text(painter, self, 4, 2, text);
+ }
+ else
+ xrdp_painter_draw_text(painter, self, 4, 2, self->caption);
+ /* draw xor box(cursor) */
if (self->parent != 0)
{
if (self->parent->focused_control == self)
{
- g_strncpy(text, self->caption, self->edit_pos);
+ if (self->password_char != 0)
+ {
+ g_memset(text, self->password_char, self->edit_pos);
+ text[self->edit_pos] = 0;
+ }
+ else
+ g_strncpy(text, self->caption, self->edit_pos);
w = xrdp_painter_text_width(painter, text);
painter->fg_color = self->wm->black;
painter->rop = 0x5a;
diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h
index 9fac5d78..0428684a 100644
--- a/xrdp/xrdp_types.h
+++ b/xrdp/xrdp_types.h
@@ -399,6 +399,7 @@ struct xrdp_bitmap
struct xrdp_list* child_list;
/* for edit */
int edit_pos;
+ int password_char;
/* for button */
int state; /* for button 0 = normal 1 = down */
};
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 4c394f84..d4514c3b 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -547,6 +547,7 @@ int xrdp_wm_init(struct xrdp_wm* self)
but->id = 5;
but->cursor = 1;
but->tab_stop = 1;
+ but->password_char = '*';
/* button */
but = xrdp_bitmap_create(60, 25, self->screen->bpp, WND_TYPE_BUTTON);