CVS: seamlessrdp/ServerExe main.c,1.16,1.17
Pierre Ossman <[email protected]> Thu, 16 Mar 2006 05:24:20 -0800
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/seamlessrdp/ServerExe
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27431/ServerExe
Modified Files:
main.c
Log Message:
Prevent moves we do ourself from generating a POSITION. We do this by storing
the coordinate we're moving to in a shared variable. Since SetWindowPos is
synchronous, we know that the variable will have valid data when the hook
is called.
Index: main.c
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/main.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** main.c 15 Mar 2006 13:45:42 -0000 1.16
--- main.c 16 Mar 2006 13:24:18 -0000 1.17
***************
*** 39,42 ****
--- 39,46 ----
typedef int (*get_instance_count_proc_t) ();
+ typedef void (*move_window_proc_t) (HWND hwnd, int x, int y, int width, int height);
+
+ static move_window_proc_t g_move_window_fn = NULL;
+
static void
message(const char *text)
***************
*** 145,149 ****
do_position(HWND hwnd, int x, int y, int width, int height)
{
! SetWindowPos(hwnd, NULL, x, y, width, height, SWP_NOACTIVATE | SWP_NOZORDER);
}
--- 149,153 ----
do_position(HWND hwnd, int x, int y, int width, int height)
{
! g_move_window_fn(hwnd, x, y, width, height);
}
***************
*** 166,171 ****
while ((size = vchannel_read(line, sizeof(line))) >= 0)
{
- debug("Got: %s", line);
-
p = line;
--- 170,173 ----
***************
*** 213,218 ****
remove_hooks_fn = (remove_hooks_proc_t) GetProcAddress(hookdll, "RemoveHooks");
instance_count_fn = (get_instance_count_proc_t) GetProcAddress(hookdll, "GetInstanceCount");
! if (!set_hooks_fn || !remove_hooks_fn || !instance_count_fn)
{
FreeLibrary(hookdll);
--- 215,221 ----
remove_hooks_fn = (remove_hooks_proc_t) GetProcAddress(hookdll, "RemoveHooks");
instance_count_fn = (get_instance_count_proc_t) GetProcAddress(hookdll, "GetInstanceCount");
+ g_move_window_fn = (move_window_proc_t) GetProcAddress(hookdll, "SafeMoveWindow");
! if (!set_hooks_fn || !remove_hooks_fn || !instance_count_fn || !g_move_window_fn)
{
FreeLibrary(hookdll);
-------------------------------------------------------
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