/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/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/branches/seamlessrdp-branch/rdesktop/xwin.c

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

revision 576 by stargo, Thu Jan 22 20:31:59 2004 UTC revision 594 by n-ki, Tue Feb 3 13:55:12 2004 UTC
# Line 731  ui_init(void) Line 731  ui_init(void)
731                  TrueColorVisual = True;                  TrueColorVisual = True;
732          }          }
733    
734          if ((g_server_bpp == 8) && ((! TrueColorVisual) || (g_depth <= 8)))          if ((g_server_bpp == 8) && ((!TrueColorVisual) || (g_depth <= 8)))
735          {          {
736                  /* we use a colourmap, so the default visual should do */                  /* we use a colourmap, so the default visual should do */
737                  g_visual = DefaultVisualOfScreen(g_screen);                  g_visual = DefaultVisualOfScreen(g_screen);
# Line 783  ui_init(void) Line 783  ui_init(void)
783    
784          if (!g_owncolmap)          if (!g_owncolmap)
785          {          {
786                  g_xcolmap = XCreateColormap(g_display,RootWindowOfScreen(g_screen),g_visual,AllocNone);                  g_xcolmap =
787                            XCreateColormap(g_display, RootWindowOfScreen(g_screen), g_visual,
788                                            AllocNone);
789                  if (g_depth <= 8)                  if (g_depth <= 8)
790                          warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n");                          warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n");
791          }          }
# Line 849  ui_deinit(void) Line 851  ui_deinit(void)
851  {  {
852          if (g_IM != NULL)          if (g_IM != NULL)
853                  XCloseIM(g_IM);                  XCloseIM(g_IM);
854            
855          if (g_null_cursor != NULL)          if (g_null_cursor != NULL)
856                  ui_destroy_cursor(g_null_cursor);                  ui_destroy_cursor(g_null_cursor);
857    
# Line 894  ui_create_window(void) Line 896  ui_create_window(void)
896    
897          if ((g_ownbackstore) && (g_backstore == NULL))          if ((g_ownbackstore) && (g_backstore == NULL))
898          {          {
899                  g_backstore =                  g_backstore = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth);
                         XCreatePixmap(g_display, g_wnd, g_width, g_height,  
                                       g_depth);  
900    
901                  /* clear to prevent rubbish being exposed at startup */                  /* clear to prevent rubbish being exposed at startup */
902                  XSetForeground(g_display, g_gc, BlackPixelOfScreen(g_screen));                  XSetForeground(g_display, g_gc, BlackPixelOfScreen(g_screen));
# Line 1271  xwin_process_events(void) Line 1271  xwin_process_events(void)
1271  int  int
1272  ui_select(int rdp_socket)  ui_select(int rdp_socket)
1273  {  {
1274          int n = (rdp_socket > g_x_socket) ? rdp_socket + 1 : g_x_socket + 1;          int n = (rdp_socket > g_x_socket) ? rdp_socket : g_x_socket;
1275          fd_set rfds, wfds;          fd_set rfds, wfds;
1276            struct timeval tv;
1277            BOOL s_timeout = False;
1278    
1279          while (True)          while (True)
1280          {          {
# Line 1291  ui_select(int rdp_socket) Line 1293  ui_select(int rdp_socket)
1293                  if (g_dsp_busy)                  if (g_dsp_busy)
1294                  {                  {
1295                          FD_SET(g_dsp_fd, &wfds);                          FD_SET(g_dsp_fd, &wfds);
1296                          n = (g_dsp_fd + 1 > n) ? g_dsp_fd + 1 : n;                          n = (g_dsp_fd > n) ? g_dsp_fd : n;
1297                  }                  }
1298  #endif  #endif
1299                    /* default timeout */
1300                    tv.tv_sec = 60;
1301                    tv.tv_usec = 0;
1302    
1303                    /* add redirection handles */
1304                    rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout);
1305    
1306                  switch (select(n, &rfds, &wfds, NULL, NULL))                  n++;
1307    
1308                    switch (select(n, &rfds, &wfds, NULL, &tv))
1309                  {                  {
1310                          case -1:                          case -1:
1311                                  error("select: %s\n", strerror(errno));                                  error("select: %s\n", strerror(errno));
1312    
1313                          case 0:                          case 0:
1314                                    /* TODO: if tv.tv_sec just times out
1315                                     * we will segfault.
1316                                     * FIXME:
1317                                     */
1318                                    //s_timeout = True;
1319                                    //rdpdr_check_fds(&rfds, &wfds, (BOOL) True);
1320                                  continue;                                  continue;
1321                  }                  }
1322    
1323                    rdpdr_check_fds(&rfds, &wfds, (BOOL) False);
1324    
1325                  if (FD_ISSET(rdp_socket, &rfds))                  if (FD_ISSET(rdp_socket, &rfds))
1326                          return 1;                          return 1;
1327    

Legend:
Removed from v.576  
changed lines
  Added in v.594

  ViewVC Help
Powered by ViewVC 1.1.26