use share path when loading files

ulab-original
jsorg71 17 years ago
parent ef69b94717
commit 71f58fad8b

@ -75,9 +75,11 @@ xrdp_font_create(struct xrdp_wm* wm)
int datasize; int datasize;
int file_size; int file_size;
struct xrdp_font_char* f; struct xrdp_font_char* f;
char file_path[256];
DEBUG(("in xrdp_font_create")); DEBUG(("in xrdp_font_create"));
file_size = g_file_get_size(DEFAULT_FONT_NAME); g_snprintf(file_path, 255, "%s/%s", XRDP_SHARE_PATH, DEFAULT_FONT_NAME);
file_size = g_file_get_size(file_path);
if (file_size < 1) if (file_size < 1)
{ {
return 0; return 0;
@ -86,7 +88,7 @@ xrdp_font_create(struct xrdp_wm* wm)
self->wm = wm; self->wm = wm;
make_stream(s); make_stream(s);
init_stream(s, file_size + 1024); init_stream(s, file_size + 1024);
fd = g_file_open(DEFAULT_FONT_NAME); fd = g_file_open(file_path);
if (fd != -1) if (fd != -1)
{ {
b = g_file_read(fd, s->data, file_size + 1024); b = g_file_read(fd, s->data, file_size + 1024);

@ -444,6 +444,7 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
{ {
struct xrdp_bitmap* but; struct xrdp_bitmap* but;
struct xrdp_bitmap* combo; struct xrdp_bitmap* combo;
char file_path[256];
/* draw login window */ /* draw login window */
self->login_window = xrdp_bitmap_create(400, 200, self->screen->bpp, self->login_window = xrdp_bitmap_create(400, 200, self->screen->bpp,
@ -461,7 +462,8 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
/* image */ /* image */
but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self); but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self);
xrdp_bitmap_load(but, "xrdp256.bmp", self->palette); g_snprintf(file_path, 255, "%s/xrdp256.bmp", XRDP_SHARE_PATH);
xrdp_bitmap_load(but, file_path, self->palette);
but->parent = self->screen; but->parent = self->screen;
but->owner = self->screen; but->owner = self->screen;
but->left = self->screen->width - but->width; but->left = self->screen->width - but->width;
@ -470,7 +472,8 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
/* image */ /* image */
but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self); but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self);
xrdp_bitmap_load(but, "ad256.bmp", self->palette); g_snprintf(file_path, 255, "%s/ad256.bmp", XRDP_SHARE_PATH);
xrdp_bitmap_load(but, file_path, self->palette);
but->parent = self->login_window; but->parent = self->login_window;
but->owner = self->login_window; but->owner = self->login_window;
but->left = 10; but->left = 10;

@ -333,13 +333,16 @@ int APP_CC
xrdp_wm_load_static_pointers(struct xrdp_wm* self) xrdp_wm_load_static_pointers(struct xrdp_wm* self)
{ {
struct xrdp_pointer_item pointer_item; struct xrdp_pointer_item pointer_item;
char file_path[256];
DEBUG(("sending cursor")); DEBUG(("sending cursor"));
xrdp_wm_load_pointer(self, "cursor1.cur", pointer_item.data, g_snprintf(file_path, 255, "%s/cursor1.cur", XRDP_SHARE_PATH);
xrdp_wm_load_pointer(self, file_path, pointer_item.data,
pointer_item.mask, &pointer_item.x, &pointer_item.y); pointer_item.mask, &pointer_item.x, &pointer_item.y);
xrdp_cache_add_pointer_static(self->cache, &pointer_item, 1); xrdp_cache_add_pointer_static(self->cache, &pointer_item, 1);
DEBUG(("sending cursor")); DEBUG(("sending cursor"));
xrdp_wm_load_pointer(self, "cursor0.cur", pointer_item.data, g_snprintf(file_path, 255, "%s/cursor0.cur", XRDP_SHARE_PATH);
xrdp_wm_load_pointer(self, file_path, pointer_item.data,
pointer_item.mask, &pointer_item.x, &pointer_item.y); pointer_item.mask, &pointer_item.x, &pointer_item.y);
xrdp_cache_add_pointer_static(self->cache, &pointer_item, 0); xrdp_cache_add_pointer_static(self->cache, &pointer_item, 0);
return 0; return 0;

Loading…
Cancel
Save