--- sourceforge.net/trunk/rdesktop/xwin.c 2003/10/19 11:59:41 504 +++ sourceforge.net/trunk/rdesktop/xwin.c 2003/10/28 03:40:26 519 @@ -49,6 +49,7 @@ static XIC g_IC; static XModifierKeymap *g_mod_map; static Cursor g_current_cursor; +static HCURSOR g_null_cursor; static Atom g_protocol_atom, g_kill_atom; static BOOL g_focused; static BOOL g_mouse_in_wnd; @@ -704,7 +705,11 @@ return False; } - if (g_owncolmap != True) + /* private colour map code only works for 8 bpp */ + if (g_owncolmap && (g_bpp > 8)) + g_owncolmap = False; + + if (!g_owncolmap) { g_xcolmap = DefaultColormapOfScreen(g_screen); if (g_depth <= 8) @@ -775,8 +780,7 @@ xclip_init(); - /* todo take this out when high colour is done */ - printf("server bpp %d client bpp %d depth %d\n", g_server_bpp, g_bpp, g_depth); + DEBUG_RDP5(("server bpp %d client bpp %d depth %d\n", g_server_bpp, g_bpp, g_depth)); return True; } @@ -797,6 +801,9 @@ g_display = NULL; } +#define NULL_POINTER_MASK "\x80" +#define NULL_POINTER_DATA "\x0\x0\x0" + BOOL ui_create_window(void) { @@ -881,12 +888,17 @@ g_kill_atom = XInternAtom(g_display, "WM_DELETE_WINDOW", True); XSetWMProtocols(g_display, g_wnd, &g_kill_atom, 1); + /* create invisible 1x1 cursor to be used as null cursor */ + g_null_cursor = ui_create_cursor(0, 0, 1, 1, NULL_POINTER_MASK, NULL_POINTER_DATA); + return True; } void ui_destroy_window(void) { + ui_destroy_cursor(g_null_cursor); + if (g_IC != NULL) XDestroyIC(g_IC); @@ -1402,6 +1414,12 @@ XFreeCursor(g_display, (Cursor) cursor); } +void +ui_set_null_cursor(void) +{ + ui_set_cursor(g_null_cursor); +} + #define MAKE_XCOLOR(xc,c) \ (xc)->red = ((c)->red << 8) | (c)->red; \ (xc)->green = ((c)->green << 8) | (c)->green; \