49 |
static XIC g_IC; |
static XIC g_IC; |
50 |
static XModifierKeymap *g_mod_map; |
static XModifierKeymap *g_mod_map; |
51 |
static Cursor g_current_cursor; |
static Cursor g_current_cursor; |
52 |
|
static HCURSOR g_null_cursor; |
53 |
static Atom g_protocol_atom, g_kill_atom; |
static Atom g_protocol_atom, g_kill_atom; |
54 |
static BOOL g_focused; |
static BOOL g_focused; |
55 |
static BOOL g_mouse_in_wnd; |
static BOOL g_mouse_in_wnd; |
70 |
#ifdef WITH_RDPSND |
#ifdef WITH_RDPSND |
71 |
extern int g_dsp_fd; |
extern int g_dsp_fd; |
72 |
extern BOOL g_dsp_busy; |
extern BOOL g_dsp_busy; |
73 |
|
extern BOOL g_rdpsnd; |
74 |
#endif |
#endif |
75 |
|
|
76 |
/* MWM decorations */ |
/* MWM decorations */ |
705 |
return False; |
return False; |
706 |
} |
} |
707 |
|
|
708 |
if (g_owncolmap != True) |
/* private colour map code only works for 8 bpp */ |
709 |
|
if (g_owncolmap && (g_bpp > 8)) |
710 |
|
g_owncolmap = False; |
711 |
|
|
712 |
|
if (!g_owncolmap) |
713 |
{ |
{ |
714 |
g_xcolmap = DefaultColormapOfScreen(g_screen); |
g_xcolmap = DefaultColormapOfScreen(g_screen); |
715 |
if (g_depth <= 8) |
if (g_depth <= 8) |
725 |
g_host_be = !(BOOL) (*(uint8 *) (&test)); |
g_host_be = !(BOOL) (*(uint8 *) (&test)); |
726 |
g_xserver_be = (ImageByteOrder(g_display) == MSBFirst); |
g_xserver_be = (ImageByteOrder(g_display) == MSBFirst); |
727 |
|
|
728 |
if ((g_width == 0) || (g_height == 0)) |
/* |
729 |
|
* Determine desktop size |
730 |
|
*/ |
731 |
|
if (g_width < 0) |
732 |
|
{ |
733 |
|
/* Percent of screen */ |
734 |
|
g_height = HeightOfScreen(g_screen) * (-g_width) / 100; |
735 |
|
g_width = WidthOfScreen(g_screen) * (-g_width) / 100; |
736 |
|
} |
737 |
|
else if (g_width == 0) |
738 |
{ |
{ |
739 |
/* Fetch geometry from _NET_WORKAREA */ |
/* Fetch geometry from _NET_WORKAREA */ |
740 |
uint32 x, y, cx, cy; |
uint32 x, y, cx, cy; |
751 |
g_height = 600; |
g_height = 600; |
752 |
} |
} |
753 |
} |
} |
754 |
|
else if (g_fullscreen) |
|
if (g_fullscreen) |
|
755 |
{ |
{ |
756 |
g_width = WidthOfScreen(g_screen); |
g_width = WidthOfScreen(g_screen); |
757 |
g_height = HeightOfScreen(g_screen); |
g_height = HeightOfScreen(g_screen); |
780 |
|
|
781 |
xclip_init(); |
xclip_init(); |
782 |
|
|
783 |
/* todo take this out when high colour is done */ |
DEBUG_RDP5(("server bpp %d client bpp %d depth %d\n", g_server_bpp, g_bpp, g_depth)); |
|
printf("server bpp %d client bpp %d depth %d\n", g_server_bpp, g_bpp, g_depth); |
|
784 |
|
|
785 |
return True; |
return True; |
786 |
} |
} |
801 |
g_display = NULL; |
g_display = NULL; |
802 |
} |
} |
803 |
|
|
804 |
|
#define NULL_POINTER_MASK "\x80" |
805 |
|
#define NULL_POINTER_DATA "\x0\x0\x0" |
806 |
|
|
807 |
BOOL |
BOOL |
808 |
ui_create_window(void) |
ui_create_window(void) |
809 |
{ |
{ |
888 |
g_kill_atom = XInternAtom(g_display, "WM_DELETE_WINDOW", True); |
g_kill_atom = XInternAtom(g_display, "WM_DELETE_WINDOW", True); |
889 |
XSetWMProtocols(g_display, g_wnd, &g_kill_atom, 1); |
XSetWMProtocols(g_display, g_wnd, &g_kill_atom, 1); |
890 |
|
|
891 |
|
/* create invisible 1x1 cursor to be used as null cursor */ |
892 |
|
g_null_cursor = ui_create_cursor(0, 0, 1, 1, NULL_POINTER_MASK, NULL_POINTER_DATA); |
893 |
|
|
894 |
return True; |
return True; |
895 |
} |
} |
896 |
|
|
897 |
void |
void |
898 |
ui_destroy_window(void) |
ui_destroy_window(void) |
899 |
{ |
{ |
900 |
|
ui_destroy_cursor(g_null_cursor); |
901 |
|
|
902 |
if (g_IC != NULL) |
if (g_IC != NULL) |
903 |
XDestroyIC(g_IC); |
XDestroyIC(g_IC); |
904 |
|
|
1414 |
XFreeCursor(g_display, (Cursor) cursor); |
XFreeCursor(g_display, (Cursor) cursor); |
1415 |
} |
} |
1416 |
|
|
1417 |
|
void |
1418 |
|
ui_set_null_cursor(void) |
1419 |
|
{ |
1420 |
|
ui_set_cursor(g_null_cursor); |
1421 |
|
} |
1422 |
|
|
1423 |
#define MAKE_XCOLOR(xc,c) \ |
#define MAKE_XCOLOR(xc,c) \ |
1424 |
(xc)->red = ((c)->red << 8) | (c)->red; \ |
(xc)->red = ((c)->red << 8) | (c)->red; \ |
1425 |
(xc)->green = ((c)->green << 8) | (c)->green; \ |
(xc)->green = ((c)->green << 8) | (c)->green; \ |