/[rdesktop]/sourceforge.net/trunk/rdesktop/xwin.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 580 by astrand, Fri Jan 23 08:35:52 2004 UTC revision 606 by stargo, Sat Feb 14 23:20:24 2004 UTC
# Line 23  Line 23 
23  #include <unistd.h>  #include <unistd.h>
24  #include <time.h>  #include <time.h>
25  #include <errno.h>  #include <errno.h>
26    #include <strings.h>
27  #include "rdesktop.h"  #include "rdesktop.h"
28  #include "xproto.h"  #include "xproto.h"
29    
# Line 63  static int g_red_shift_l, g_blue_shift_l Line 64  static int g_red_shift_l, g_blue_shift_l
64    
65  /* software backing store */  /* software backing store */
66  static BOOL g_ownbackstore;  static BOOL g_ownbackstore;
67  static Pixmap g_backstore = NULL;  static Pixmap g_backstore = 0;
68    
69  /* Moving in single app mode */  /* Moving in single app mode */
70  static BOOL g_moving_wnd;  static BOOL g_moving_wnd;
# Line 894  ui_create_window(void) Line 895  ui_create_window(void)
895          if (g_gc == NULL)          if (g_gc == NULL)
896                  g_gc = XCreateGC(g_display, g_wnd, 0, NULL);                  g_gc = XCreateGC(g_display, g_wnd, 0, NULL);
897    
898          if ((g_ownbackstore) && (g_backstore == NULL))          if ((g_ownbackstore) && (g_backstore == 0))
899          {          {
900                  g_backstore = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth);                  g_backstore = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth);
901    
# Line 1271  xwin_process_events(void) Line 1272  xwin_process_events(void)
1272  int  int
1273  ui_select(int rdp_socket)  ui_select(int rdp_socket)
1274  {  {
1275          int n = (rdp_socket > g_x_socket) ? rdp_socket + 1 : g_x_socket + 1;          int n;
1276          fd_set rfds, wfds;          fd_set rfds, wfds;
1277            struct timeval tv;
1278            BOOL s_timeout = False;
1279    
1280          while (True)          while (True)
1281          {          {
1282                    n = (rdp_socket > g_x_socket) ? rdp_socket : g_x_socket;
1283                  /* Process any events already waiting */                  /* Process any events already waiting */
1284                  if (!xwin_process_events())                  if (!xwin_process_events())
1285                          /* User quit */                          /* User quit */
# Line 1291  ui_select(int rdp_socket) Line 1295  ui_select(int rdp_socket)
1295                  if (g_dsp_busy)                  if (g_dsp_busy)
1296                  {                  {
1297                          FD_SET(g_dsp_fd, &wfds);                          FD_SET(g_dsp_fd, &wfds);
1298                          n = (g_dsp_fd + 1 > n) ? g_dsp_fd + 1 : n;                          n = (g_dsp_fd > n) ? g_dsp_fd : n;
1299                  }                  }
1300  #endif  #endif
1301                    /* default timeout */
1302                    tv.tv_sec = 60;
1303                    tv.tv_usec = 0;
1304    
1305                  switch (select(n, &rfds, &wfds, NULL, NULL))                  /* add redirection handles */
1306                    rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout);
1307    
1308                    n++;
1309    
1310                    switch (select(n, &rfds, &wfds, NULL, &tv))
1311                  {                  {
1312                          case -1:                          case -1:
1313                                  error("select: %s\n", strerror(errno));                                  error("select: %s\n", strerror(errno));
1314    
1315                          case 0:                          case 0:
1316                                    /* TODO: if tv.tv_sec just times out
1317                                     * we will segfault.
1318                                     * FIXME:
1319                                     */
1320                                    //s_timeout = True;
1321                                    //rdpdr_check_fds(&rfds, &wfds, (BOOL) True);
1322                                  continue;                                  continue;
1323                  }                  }
1324    
1325                    rdpdr_check_fds(&rfds, &wfds, (BOOL) False);
1326    
1327                  if (FD_ISSET(rdp_socket, &rfds))                  if (FD_ISSET(rdp_socket, &rfds))
1328                          return 1;                          return 1;
1329    

Legend:
Removed from v.580  
changed lines
  Added in v.606

  ViewVC Help
Powered by ViewVC 1.1.26