CVS: rdesktop proto.h,1.87.2.5,1.87.2.6 seamless.c,1.1.2.11,1.1.2.12 xwin.c,1.205.2.19,1.205.2.20

Pierre Ossman <[email protected]> Thu, 16 Mar 2006 07:28: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-serv17377

Modified Files:
      Tag: seamlessrdp-branch
	proto.h seamless.c xwin.c 
Log Message:
Don't activate seamless mode until we have a working connection with the
remote server (i.e. when we get a HELLO).

Also change g_seamless_rdp to mean that -A was specified on the command line.
g_seamless_active now indicates if we're in seamless or "normal" mode.


Index: proto.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/proto.h,v
retrieving revision 1.87.2.5
retrieving revision 1.87.2.6
diff -C2 -d -r1.87.2.5 -r1.87.2.6
*** proto.h	15 Mar 2006 11:48:32 -0000	1.87.2.5
--- proto.h	16 Mar 2006 15:27:59 -0000	1.87.2.6
***************
*** 273,276 ****
--- 273,277 ----
  void ui_begin_update(void);
  void ui_end_update(void);
+ void ui_seamless_begin(void);
  void ui_seamless_toggle(void);
  void ui_seamless_create_window(unsigned long id, unsigned long parent, unsigned long flags);

Index: seamless.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/Attic/seamless.c,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -C2 -d -r1.1.2.11 -r1.1.2.12
*** seamless.c	15 Mar 2006 11:34:55 -0000	1.1.2.11
--- seamless.c	16 Mar 2006 15:27:59 -0000	1.1.2.12
***************
*** 70,76 ****
  	DEBUG_SEAMLESS(("seamlessrdp got:%s\n", p));
  
- 	if (!g_seamless_rdp)
- 		return True;
- 
  	tok1 = seamless_get_token(&p);
  	tok2 = seamless_get_token(&p);
--- 70,73 ----
***************
*** 219,222 ****
--- 216,230 ----
  		/* do nothing, currently */
  	}
+ 	else if (!strcmp("HELLO", tok1))
+ 	{
+ 		if (!tok2)
+ 			return False;
+ 
+ 		flags = strtoul(tok2, &endptr, 0);
+ 		if (*endptr)
+ 			return False;
+ 
+ 		ui_seamless_begin();
+ 	}
  
  
***************
*** 262,265 ****
--- 270,276 ----
  seamless_init(void)
  {
+ 	if (!g_seamless_rdp)
+ 		return False;
+ 
  	seamless_channel =
  		channel_register("seamrdp", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
***************
*** 298,301 ****
--- 309,315 ----
  seamless_send_sync()
  {
+ 	if (!g_seamless_rdp)
+ 		return;
+ 
  	seamless_send("SYNC\n");
  }
***************
*** 305,308 ****
--- 319,325 ----
  seamless_send_state(unsigned long id, unsigned int state, unsigned long flags)
  {
+ 	if (!g_seamless_rdp)
+ 		return;
+ 
  	seamless_send("STATE,0x%08lx,0x%x,0x%lx\n", id, state, flags);
  }

Index: xwin.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v
retrieving revision 1.205.2.19
retrieving revision 1.205.2.20
diff -C2 -d -r1.205.2.19 -r1.205.2.20
*** xwin.c	16 Mar 2006 10:14:18 -0000	1.205.2.19
--- xwin.c	16 Mar 2006 15:27:59 -0000	1.205.2.20
***************
*** 63,66 ****
--- 63,68 ----
  } seamless_window;
  static seamless_window *g_seamless_windows = NULL;
+ static BOOL g_seamless_started = False;	/* Server end is up and running */
+ static BOOL g_seamless_active = False;	/* We are currently in seamless mode */
  extern BOOL g_seamless_rdp;
  
***************
*** 1566,1580 ****
  
  	XSelectInput(g_display, g_wnd, input_mask);
! 	if (!g_seamless_rdp)
  	{
! 		XMapWindow(g_display, g_wnd);
! 		/* wait for VisibilityNotify */
! 		do
! 		{
! 			XMaskEvent(g_display, VisibilityChangeMask, &xevent);
! 		}
! 		while (xevent.type != VisibilityNotify);
! 		g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured;
  	}
  
  	g_focused = False;
--- 1568,1580 ----
  
  	XSelectInput(g_display, g_wnd, input_mask);
! 
! 	XMapWindow(g_display, g_wnd);
! 	/* wait for VisibilityNotify */
! 	do
  	{
! 		XMaskEvent(g_display, VisibilityChangeMask, &xevent);
  	}
+ 	while (xevent.type != VisibilityNotify);
+ 	g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured;
  
  	g_focused = False;
***************
*** 1640,1644 ****
  	Pixmap contents = 0;
  
! 	if (g_seamless_rdp)
  		/* Turn off SeamlessRDP mode */
  		ui_seamless_toggle();
--- 1640,1644 ----
  	Pixmap contents = 0;
  
! 	if (g_seamless_active)
  		/* Turn off SeamlessRDP mode */
  		ui_seamless_toggle();
***************
*** 1989,1997 ****
  				break;
  			case MapNotify:
! 				if (!g_seamless_rdp)
  					rdp_send_client_window_status(1);
  				break;
  			case UnmapNotify:
! 				if (!g_seamless_rdp)
  					rdp_send_client_window_status(0);
  				break;
--- 1989,1997 ----
  				break;
  			case MapNotify:
! 				if (!g_seamless_active)
  					rdp_send_client_window_status(1);
  				break;
  			case UnmapNotify:
! 				if (!g_seamless_active)
  					rdp_send_client_window_status(0);
  				break;
***************
*** 3007,3013 ****
  
  void
  ui_seamless_toggle()
  {
! 	if (g_seamless_rdp)
  	{
  		/* Deactivate */
--- 3007,3033 ----
  
  void
+ ui_seamless_begin()
+ {
+ 	if (!g_seamless_rdp)
+ 		return;
+ 
+ 	if (g_seamless_started)
+ 		return;
+ 
+ 	g_seamless_started = True;
+ 
+ 	ui_seamless_toggle();
+ }
+ 
+ void
  ui_seamless_toggle()
  {
! 	if (!g_seamless_rdp)
! 		return;
! 
! 	if (!g_seamless_started)
! 		return;
! 
! 	if (g_seamless_active)
  	{
  		/* Deactivate */
***************
*** 3022,3041 ****
  	{
  		/* Activate */
- 		if (g_win_button_size)
- 		{
- 			error("SeamlessRDP mode cannot be activated when using single application mode\n");
- 			return;
- 		}
- 		if (!g_using_full_workarea)
- 		{
- 			error("SeamlessRDP mode requires a session that covers the whole screen");
- 			return;
- 		}
- 
  		XUnmapWindow(g_display, g_wnd);
  		seamless_send_sync();
  	}
  
! 	g_seamless_rdp = !g_seamless_rdp;
  }
  
--- 3042,3050 ----
  	{
  		/* Activate */
  		XUnmapWindow(g_display, g_wnd);
  		seamless_send_sync();
  	}
  
! 	g_seamless_active = !g_seamless_active;
  }
  
***************
*** 3050,3053 ****
--- 3059,3065 ----
  	seamless_window *sw, *sw_parent;
  
+ 	if (!g_seamless_active)
+ 		return;
+ 
  	/* Ignore CREATEs for existing windows */
  	sw = seamless_get_window_by_id(id);
***************
*** 3129,3132 ****
--- 3141,3147 ----
  	seamless_window *sw;
  
+ 	if (!g_seamless_active)
+ 		return;
+ 
  	sw = seamless_get_window_by_id(id);
  	if (!sw)
***************
*** 3146,3149 ****
--- 3161,3167 ----
  	seamless_window *sw;
  
+ 	if (!g_seamless_active)
+ 		return;
+ 
  	sw = seamless_get_window_by_id(id);
  	if (!sw)
***************
*** 3187,3190 ****
--- 3205,3211 ----
  	seamless_window *sw;
  
+ 	if (!g_seamless_active)
+ 		return;
+ 
  	sw = seamless_get_window_by_id(id);
  	if (!sw)
***************
*** 3205,3208 ****
--- 3226,3232 ----
  	seamless_window *sw;
  
+ 	if (!g_seamless_active)
+ 		return;
+ 
  	sw = seamless_get_window_by_id(id);
  	if (!sw)
***************
*** 3254,3257 ****
--- 3278,3284 ----
  ui_seamless_syncbegin(unsigned long flags)
  {
+ 	if (!g_seamless_active)
+ 		return;
+ 
  	/* Destroy all seamless windows */
  	while (g_seamless_windows)



-------------------------------------------------------
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