/[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 1199 by astrand, Mon Mar 27 08:17:34 2006 UTC revision 1250 by astrand, Mon Aug 7 11:46:28 2006 UTC
# Line 242  seamless_XDrawLines(Drawable d, XPoint * Line 242  seamless_XDrawLines(Drawable d, XPoint *
242                          break; \                          break; \
243                  case 1: /* Filled */ \                  case 1: /* Filled */ \
244                          XFillArc(g_display, g_wnd, g_gc, x, y, cx, cy, 0, 360*64); \                          XFillArc(g_display, g_wnd, g_gc, x, y, cx, cy, 0, 360*64); \
245                          ON_ALL_SEAMLESS_WINDOWS(XCopyArea, (g_display, g_ownbackstore ? g_backstore : g_wnd, sw->wnd, g_gc, \                          ON_ALL_SEAMLESS_WINDOWS(XFillArc, (g_display, sw->wnd, g_gc, x-sw->xoffset, y-sw->yoffset, cx, cy, 0, 360*64)); \
                                                             x, y, cx, cy, x-sw->xoffset, y-sw->yoffset)); \  
246                          if (g_ownbackstore) \                          if (g_ownbackstore) \
247                                  XFillArc(g_display, g_backstore, g_gc, x, y, cx, cy, 0, 360*64); \                                  XFillArc(g_display, g_backstore, g_gc, x, y, cx, cy, 0, 360*64); \
248                          break; \                          break; \
# Line 1314  calculate_mask_weight(uint32 mask) Line 1313  calculate_mask_weight(uint32 mask)
1313  }  }
1314    
1315  static BOOL  static BOOL
1316  select_visual()  select_visual(int screen_num)
1317  {  {
1318          XPixmapFormatValues *pfm;          XPixmapFormatValues *pfm;
1319          int pixmap_formats_count, visuals_count;          int pixmap_formats_count, visuals_count;
# Line 1325  select_visual() Line 1324  select_visual()
1324    
1325          red_weight = blue_weight = green_weight = 0;          red_weight = blue_weight = green_weight = 0;
1326    
1327            if (g_server_depth == -1)
1328            {
1329                    g_server_depth = DisplayPlanes(g_display, DefaultScreen(g_display));
1330            }
1331    
1332          pfm = XListPixmapFormats(g_display, &pixmap_formats_count);          pfm = XListPixmapFormats(g_display, &pixmap_formats_count);
1333          if (pfm == NULL)          if (pfm == NULL)
1334          {          {
# Line 1335  select_visual() Line 1339  select_visual()
1339    
1340          /* Search for best TrueColor visual */          /* Search for best TrueColor visual */
1341          template.class = TrueColor;          template.class = TrueColor;
1342          vmatches = XGetVisualInfo(g_display, VisualClassMask, &template, &visuals_count);          template.screen = screen_num;
1343            vmatches =
1344                    XGetVisualInfo(g_display, VisualClassMask | VisualScreenMask, &template,
1345                                   &visuals_count);
1346          g_visual = NULL;          g_visual = NULL;
1347          g_no_translate_image = False;          g_no_translate_image = False;
1348          g_compatible_arch = False;          g_compatible_arch = False;
# Line 1344  select_visual() Line 1351  select_visual()
1351                  for (i = 0; i < visuals_count; ++i)                  for (i = 0; i < visuals_count; ++i)
1352                  {                  {
1353                          XVisualInfo *visual_info = &vmatches[i];                          XVisualInfo *visual_info = &vmatches[i];
1354                            BOOL can_translate_to_bpp = False;
1355                            int j;
1356    
1357                          /* Try to find a no-translation visual that'll                          /* Try to find a no-translation visual that'll
1358                             allow us to use RDP bitmaps directly as ZPixmaps. */                             allow us to use RDP bitmaps directly as ZPixmaps. */
# Line 1387  select_visual() Line 1396  select_visual()
1396    
1397                          /* Only care for visuals, for whose BPPs (not depths!)                          /* Only care for visuals, for whose BPPs (not depths!)
1398                             we have a translateXtoY function. */                             we have a translateXtoY function. */
                         BOOL can_translate_to_bpp = False;  
                         int j;  
1399                          for (j = 0; j < pixmap_formats_count; ++j)                          for (j = 0; j < pixmap_formats_count; ++j)
1400                          {                          {
1401                                  if (pfm[j].depth == visual_info->depth)                                  if (pfm[j].depth == visual_info->depth)
# Line 1540  ui_init(void) Line 1547  ui_init(void)
1547          g_screen = ScreenOfDisplay(g_display, screen_num);          g_screen = ScreenOfDisplay(g_display, screen_num);
1548          g_depth = DefaultDepthOfScreen(g_screen);          g_depth = DefaultDepthOfScreen(g_screen);
1549    
1550          if (!select_visual())          if (!select_visual(screen_num))
1551                  return False;                  return False;
1552    
1553          if (g_no_translate_image)          if (g_no_translate_image)
# Line 1636  ui_deinit(void) Line 1643  ui_deinit(void)
1643                  sw_remove_window(g_seamless_windows);                  sw_remove_window(g_seamless_windows);
1644          }          }
1645    
1646            xclip_deinit();
1647    
1648          if (g_IM != NULL)          if (g_IM != NULL)
1649                  XCloseIM(g_IM);                  XCloseIM(g_IM);
1650    
# Line 3466  ui_seamless_destroy_window(unsigned long Line 3475  ui_seamless_destroy_window(unsigned long
3475  }  }
3476    
3477    
3478    void
3479    ui_seamless_destroy_group(unsigned long id, unsigned long flags)
3480    {
3481            seamless_window *sw, *sw_next;
3482    
3483            if (!g_seamless_active)
3484                    return;
3485    
3486            for (sw = g_seamless_windows; sw; sw = sw_next)
3487            {
3488                    sw_next = sw->next;
3489    
3490                    if (sw->group->id == id)
3491                    {
3492                            XDestroyWindow(g_display, sw->wnd);
3493                            sw_remove_window(sw);
3494                    }
3495            }
3496    }
3497    
3498    
3499  void  void
3500  ui_seamless_move_window(unsigned long id, int x, int y, int width, int height, unsigned long flags)  ui_seamless_move_window(unsigned long id, int x, int y, int width, int height, unsigned long flags)
3501  {  {

Legend:
Removed from v.1199  
changed lines
  Added in v.1250

  ViewVC Help
Powered by ViewVC 1.1.26