CVS: rdesktop xwin.c,1.205.2.26,1.205.2.27

Pierre Ossman <[email protected]> Mon, 20 Mar 2006 06:39:02 -0800
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21029

Modified Files:
      Tag: seamlessrdp-branch
	xwin.c 
Log Message:
Make sure we do not update seamless windows' offsets until we get an ACK
back (i.e. when the request has been executed).


Index: xwin.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v
retrieving revision 1.205.2.26
retrieving revision 1.205.2.27
diff -C2 -d -r1.205.2.26 -r1.205.2.27
*** xwin.c	20 Mar 2006 12:36:14 -0000	1.205.2.26
--- xwin.c	20 Mar 2006 14:39:00 -0000	1.205.2.27
***************
*** 61,64 ****
--- 61,70 ----
  	unsigned int desktop;
  	struct timeval *position_timer;
+ 
+ 	BOOL outstanding_position;
+ 	unsigned int outpos_serial;
+ 	int outpos_xoffset, outpos_yoffset;
+ 	int outpos_width, outpos_height;
+ 
  	struct _seamless_window *next;
  } seamless_window;
***************
*** 333,336 ****
--- 339,343 ----
  	int x, y;
  	Window child_return;
+ 	unsigned int serial;
  
  	XGetWindowAttributes(g_display, sw->wnd, &wa);
***************
*** 338,346 ****
  			      -wa.border_width, -wa.border_width, &x, &y, &child_return);
  
! 	seamless_send_position(sw->id, x, y, wa.width, wa.height, 0);
! 	sw->xoffset = x;
! 	sw->yoffset = y;
! 	sw->width = wa.width;
! 	sw->height = wa.height;
  }
  
--- 345,357 ----
  			      -wa.border_width, -wa.border_width, &x, &y, &child_return);
  
! 	serial = seamless_send_position(sw->id, x, y, wa.width, wa.height, 0);
! 
! 	sw->outstanding_position = True;
! 	sw->outpos_serial = serial;
! 
! 	sw->outpos_xoffset = x;
! 	sw->outpos_yoffset = y;
! 	sw->outpos_width = wa.width;
! 	sw->outpos_height = wa.height;
  }
  
***************
*** 3294,3297 ****
--- 3305,3309 ----
  	sw->position_timer = xmalloc(sizeof(struct timeval));
  	timerclear(sw->position_timer);
+ 	sw->outstanding_position = False;
  	sw->next = g_seamless_windows;
  	g_seamless_windows = sw;
***************
*** 3334,3337 ****
--- 3346,3353 ----
  	}
  
+ 	/* We ignore server updates until it has handled our request. */
+ 	if (sw->outstanding_position)
+ 		return;
+ 
  	if (!width || !height)
  		/* X11 windows must be at least 1x1 */
***************
*** 3485,3487 ****
--- 3501,3520 ----
  ui_seamless_ack(unsigned int serial)
  {
+ 	seamless_window *sw;
+ 	for (sw = g_seamless_windows; sw; sw = sw->next)
+ 	{
+ 		if (sw->outpos_serial == serial)
+ 		{
+ 			sw->xoffset = sw->outpos_xoffset;
+ 			sw->yoffset = sw->outpos_yoffset;
+ 			sw->width = sw->outpos_width;
+ 			sw->height = sw->outpos_height;
+ 
+ 			sw->outstanding_position = False;
+ 
+ 			break;
+ 		}
+ 	}
+ 
+ 	return;
  }



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642