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; |
1087 |
|
|
1088 |
FD_ZERO(&rfds); |
FD_ZERO(&rfds); |
1089 |
|
|
1095 |
return 0; |
return 0; |
1096 |
|
|
1097 |
FD_ZERO(&rfds); |
FD_ZERO(&rfds); |
1098 |
|
FD_ZERO(&wfds); |
1099 |
FD_SET(rdp_socket, &rfds); |
FD_SET(rdp_socket, &rfds); |
1100 |
FD_SET(g_x_socket, &rfds); |
FD_SET(g_x_socket, &rfds); |
1101 |
|
|
1102 |
switch (select(n, &rfds, NULL, NULL, NULL)) |
#ifdef WITH_RDPSND |
1103 |
|
/* FIXME: there should be an API for registering fds */ |
1104 |
|
if (g_dsp_busy) |
1105 |
|
{ |
1106 |
|
FD_SET(g_dsp_fd, &wfds); |
1107 |
|
n = (g_dsp_fd + 1 > n) ? g_dsp_fd + 1 : n; |
1108 |
|
} |
1109 |
|
#endif |
1110 |
|
|
1111 |
|
switch (select(n, &rfds, &wfds, NULL, NULL)) |
1112 |
{ |
{ |
1113 |
case -1: |
case -1: |
1114 |
error("select: %s\n", strerror(errno)); |
error("select: %s\n", strerror(errno)); |
1119 |
|
|
1120 |
if (FD_ISSET(rdp_socket, &rfds)) |
if (FD_ISSET(rdp_socket, &rfds)) |
1121 |
return 1; |
return 1; |
1122 |
|
|
1123 |
|
#ifdef WITH_RDPSND |
1124 |
|
if (FD_ISSET(g_dsp_fd, &wfds)) |
1125 |
|
wave_out_play(); |
1126 |
|
#endif |
1127 |
} |
} |
1128 |
} |
} |
1129 |
|
|