/[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 1166 by ossman_, Mon Mar 20 12:36:14 2006 UTC revision 1168 by ossman_, Mon Mar 20 14:39:00 2006 UTC
# Line 60  typedef struct _seamless_window Line 60  typedef struct _seamless_window
60          int state;              /* normal/minimized/maximized. */          int state;              /* normal/minimized/maximized. */
61          unsigned int desktop;          unsigned int desktop;
62          struct timeval *position_timer;          struct timeval *position_timer;
63    
64            BOOL outstanding_position;
65            unsigned int outpos_serial;
66            int outpos_xoffset, outpos_yoffset;
67            int outpos_width, outpos_height;
68    
69          struct _seamless_window *next;          struct _seamless_window *next;
70  } seamless_window;  } seamless_window;
71  static seamless_window *g_seamless_windows = NULL;  static seamless_window *g_seamless_windows = NULL;
# Line 332  seamless_update_position(seamless_window Line 338  seamless_update_position(seamless_window
338          XWindowAttributes wa;          XWindowAttributes wa;
339          int x, y;          int x, y;
340          Window child_return;          Window child_return;
341            unsigned int serial;
342    
343          XGetWindowAttributes(g_display, sw->wnd, &wa);          XGetWindowAttributes(g_display, sw->wnd, &wa);
344          XTranslateCoordinates(g_display, sw->wnd, wa.root,          XTranslateCoordinates(g_display, sw->wnd, wa.root,
345                                -wa.border_width, -wa.border_width, &x, &y, &child_return);                                -wa.border_width, -wa.border_width, &x, &y, &child_return);
346    
347          seamless_send_position(sw->id, x, y, wa.width, wa.height, 0);          serial = seamless_send_position(sw->id, x, y, wa.width, wa.height, 0);
348          sw->xoffset = x;  
349          sw->yoffset = y;          sw->outstanding_position = True;
350          sw->width = wa.width;          sw->outpos_serial = serial;
351          sw->height = wa.height;  
352            sw->outpos_xoffset = x;
353            sw->outpos_yoffset = y;
354            sw->outpos_width = wa.width;
355            sw->outpos_height = wa.height;
356  }  }
357    
358    
# Line 3293  ui_seamless_create_window(unsigned long Line 3304  ui_seamless_create_window(unsigned long
3304          sw->desktop = 0;          sw->desktop = 0;
3305          sw->position_timer = xmalloc(sizeof(struct timeval));          sw->position_timer = xmalloc(sizeof(struct timeval));
3306          timerclear(sw->position_timer);          timerclear(sw->position_timer);
3307            sw->outstanding_position = False;
3308          sw->next = g_seamless_windows;          sw->next = g_seamless_windows;
3309          g_seamless_windows = sw;          g_seamless_windows = sw;
3310  }  }
# Line 3333  ui_seamless_move_window(unsigned long id Line 3345  ui_seamless_move_window(unsigned long id
3345                  return;                  return;
3346          }          }
3347    
3348            /* We ignore server updates until it has handled our request. */
3349            if (sw->outstanding_position)
3350                    return;
3351    
3352          if (!width || !height)          if (!width || !height)
3353                  /* X11 windows must be at least 1x1 */                  /* X11 windows must be at least 1x1 */
3354                  return;                  return;
# Line 3484  ui_seamless_syncbegin(unsigned long flag Line 3500  ui_seamless_syncbegin(unsigned long flag
3500  void  void
3501  ui_seamless_ack(unsigned int serial)  ui_seamless_ack(unsigned int serial)
3502  {  {
3503            seamless_window *sw;
3504            for (sw = g_seamless_windows; sw; sw = sw->next)
3505            {
3506                    if (sw->outpos_serial == serial)
3507                    {
3508                            sw->xoffset = sw->outpos_xoffset;
3509                            sw->yoffset = sw->outpos_yoffset;
3510                            sw->width = sw->outpos_width;
3511                            sw->height = sw->outpos_height;
3512    
3513                            sw->outstanding_position = False;
3514    
3515                            break;
3516                    }
3517            }
3518    
3519            return;
3520  }  }

Legend:
Removed from v.1166  
changed lines
  Added in v.1168

  ViewVC Help
Powered by ViewVC 1.1.26