34 |
extern char g_title[]; |
extern char g_title[]; |
35 |
extern int g_server_bpp; |
extern int g_server_bpp; |
36 |
extern int g_win_button_size; |
extern int g_win_button_size; |
|
BOOL g_enable_compose = False; |
|
|
BOOL g_focused; |
|
|
BOOL g_mouse_in_wnd; |
|
37 |
|
|
38 |
Display *g_display; |
Display *g_display; |
39 |
Time g_last_gesturetime; |
Time g_last_gesturetime; |
40 |
static int g_x_socket; |
static int g_x_socket; |
41 |
static Screen *g_screen; |
static Screen *g_screen; |
42 |
Window g_wnd; |
Window g_wnd; |
43 |
|
BOOL g_enable_compose = False; |
44 |
static GC g_gc; |
static GC g_gc; |
45 |
static Visual *g_visual; |
static Visual *g_visual; |
46 |
static int g_depth; |
static int g_depth; |
50 |
static XModifierKeymap *g_mod_map; |
static XModifierKeymap *g_mod_map; |
51 |
static Cursor g_current_cursor; |
static Cursor g_current_cursor; |
52 |
static Atom g_protocol_atom, g_kill_atom; |
static Atom g_protocol_atom, g_kill_atom; |
53 |
|
static BOOL g_focused; |
54 |
|
static BOOL g_mouse_in_wnd; |
55 |
|
|
56 |
/* endianness */ |
/* endianness */ |
57 |
static BOOL g_host_be; |
static BOOL g_host_be; |
66 |
static int g_move_x_offset = 0; |
static int g_move_x_offset = 0; |
67 |
static int g_move_y_offset = 0; |
static int g_move_y_offset = 0; |
68 |
|
|
69 |
|
#ifdef WITH_RDPSND |
70 |
|
extern int g_dsp_fd; |
71 |
|
extern BOOL g_dsp_busy; |
72 |
|
#endif |
73 |
|
|
74 |
/* MWM decorations */ |
/* MWM decorations */ |
75 |
#define MWM_HINTS_DECORATIONS (1L << 1) |
#define MWM_HINTS_DECORATIONS (1L << 1) |
76 |
#define PROP_MOTIF_WM_HINTS_ELEMENTS 5 |
#define PROP_MOTIF_WM_HINTS_ELEMENTS 5 |
1083 |
ui_select(int rdp_socket) |
ui_select(int rdp_socket) |
1084 |
{ |
{ |
1085 |
int n = (rdp_socket > g_x_socket) ? rdp_socket + 1 : g_x_socket + 1; |
int n = (rdp_socket > g_x_socket) ? rdp_socket + 1 : g_x_socket + 1; |
1086 |
fd_set rfds; |
fd_set rfds, wfds; |
|
|
|
|
FD_ZERO(&rfds); |
|
1087 |
|
|
1088 |
while (True) |
while (True) |
1089 |
{ |
{ |
1093 |
return 0; |
return 0; |
1094 |
|
|
1095 |
FD_ZERO(&rfds); |
FD_ZERO(&rfds); |
1096 |
|
FD_ZERO(&wfds); |
1097 |
FD_SET(rdp_socket, &rfds); |
FD_SET(rdp_socket, &rfds); |
1098 |
FD_SET(g_x_socket, &rfds); |
FD_SET(g_x_socket, &rfds); |
1099 |
|
|
1100 |
switch (select(n, &rfds, NULL, NULL, NULL)) |
#ifdef WITH_RDPSND |
1101 |
|
/* FIXME: there should be an API for registering fds */ |
1102 |
|
if (g_dsp_busy) |
1103 |
|
{ |
1104 |
|
FD_SET(g_dsp_fd, &wfds); |
1105 |
|
n = (g_dsp_fd + 1 > n) ? g_dsp_fd + 1 : n; |
1106 |
|
} |
1107 |
|
#endif |
1108 |
|
|
1109 |
|
switch (select(n, &rfds, &wfds, NULL, NULL)) |
1110 |
{ |
{ |
1111 |
case -1: |
case -1: |
1112 |
error("select: %s\n", strerror(errno)); |
error("select: %s\n", strerror(errno)); |
1117 |
|
|
1118 |
if (FD_ISSET(rdp_socket, &rfds)) |
if (FD_ISSET(rdp_socket, &rfds)) |
1119 |
return 1; |
return 1; |
1120 |
|
|
1121 |
|
#ifdef WITH_RDPSND |
1122 |
|
if (g_dsp_busy && FD_ISSET(g_dsp_fd, &wfds)) |
1123 |
|
wave_out_play(); |
1124 |
|
#endif |
1125 |
} |
} |
1126 |
} |
} |
1127 |
|
|