CVS: seamlessrdp/ServerExe/HookDll hookdll.c, 1.39, 1.40

Peter Åstrand <[email protected]> Thu, 06 Mar 2008 07:11:55 -0800
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16446/HookDll

Modified Files:
	hookdll.c 
Log Message:
Yet another try at get_parent. The previous implementation incorrectly
returned -1 for many transient windows, which made them transient for
the root window rather than the application window at the X11 side. 

With this implementation, the transient test case in
seamlessrdp-channel.txt passes. 



Index: hookdll.c
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** hookdll.c	21 Feb 2008 10:16:19 -0000	1.39
--- hookdll.c	6 Mar 2008 15:11:53 -0000	1.40
***************
*** 102,118 ****
  	owner = GetWindow(hwnd, GW_OWNER);
  	exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
! 	if (!owner && !(exstyle & WS_EX_TOOLWINDOW)) {
  		/* display taskbar icon */
! 		HWND parent;
! 		parent = GetAncestor(hwnd, GA_PARENT);
! 		if (parent == GetDesktopWindow()) {
! 			/* top-level without parent */
! 			result = NULL;
! 		} else {
! 			result = parent;
! 		}
! 	} else {
  		/* no taskbar icon */
! 		result = (HWND) - 1;
  	}
  
--- 102,117 ----
  	owner = GetWindow(hwnd, GW_OWNER);
  	exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
! 	if (!owner && !(exstyle & WS_EX_TOOLWINDOW)) 
! 	{
  		/* display taskbar icon */
! 		result = NULL;
! 	} 
! 	else 
! 	{
  		/* no taskbar icon */
! 		if (owner) 
! 			result = owner;
! 		else 
! 			result = (HWND) - 1;
  	}
  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/