ulab-original
jsorg71 17 years ago
parent d1d5aac19c
commit f4024fc926

@ -75,14 +75,15 @@ xrdp_font_create(struct xrdp_wm* wm)
int datasize; int datasize;
struct xrdp_font_char* f; struct xrdp_font_char* f;
DEBUG(("in xrdp_font_create"));
self = (struct xrdp_font*)g_malloc(sizeof(struct xrdp_font), 1); self = (struct xrdp_font*)g_malloc(sizeof(struct xrdp_font), 1);
self->wm = wm; self->wm = wm;
make_stream(s); make_stream(s);
init_stream(s, 1024 * 64); init_stream(s, 1024 * 256);
fd = g_file_open("sans-10.fv1"); fd = g_file_open("sans-10.fv1");
if (fd != -1) if (fd != -1)
{ {
b = g_file_read(fd, s->data, 1024 * 64); b = g_file_read(fd, s->data, 1024 * 256);
g_file_close(fd); g_file_close(fd);
if (b > 0) if (b > 0)
{ {
@ -138,6 +139,7 @@ xrdp_font_create(struct xrdp_wm* wm)
self->font_items[0].data = g_malloc(3 * 16, 0); self->font_items[0].data = g_malloc(3 * 16, 0);
g_memcpy(self->font_items[0].data, w_char, 3 * 16); g_memcpy(self->font_items[0].data, w_char, 3 * 16);
*/ */
DEBUG(("out xrdp_font_create"));
return self; return self;
} }
@ -152,7 +154,7 @@ xrdp_font_delete(struct xrdp_font* self)
{ {
return; return;
} }
for (i = 0; i < 256; i++) for (i = 0; i < NUM_FONTS; i++)
{ {
g_free(self->font_items[i].data); g_free(self->font_items[i].data);
} }

@ -288,7 +288,7 @@ xrdp_wm_show_edits(struct xrdp_wm* self, struct xrdp_bitmap* combo)
b->tab_stop = 1; b->tab_stop = 1;
b->caption1 = (char*)g_malloc(256, 1); b->caption1 = (char*)g_malloc(256, 1);
g_strncpy(b->caption1, value + 3, 255); g_strncpy(b->caption1, value + 3, 255);
b->edit_pos = g_strlen(b->caption1); b->edit_pos = g_mbstowcs(0, b->caption1, 0);
if (self->login_window->focused_control == 0) if (self->login_window->focused_control == 0)
{ {
self->login_window->focused_control = b; self->login_window->focused_control = b;
@ -296,8 +296,8 @@ xrdp_wm_show_edits(struct xrdp_wm* self, struct xrdp_bitmap* combo)
if (g_strncmp(name, "username", 255) == 0) if (g_strncmp(name, "username", 255) == 0)
{ {
g_strncpy(b->caption1, self->session->client_info->username, 255); g_strncpy(b->caption1, self->session->client_info->username, 255);
b->edit_pos = g_strlen(b->caption1); b->edit_pos = g_mbstowcs(0, b->caption1, 0);
if (g_strlen(b->caption1) > 0) if (b->edit_pos > 0)
{ {
username_set = 1; username_set = 1;
} }

Loading…
Cancel
Save