/[rdesktop]/sourceforge.net/trunk/seamlessrdp/ServerExe/HookDll/hookdll.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/trunk/seamlessrdp/ServerExe/HookDll/hookdll.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1448 by astrand, Thu Mar 6 15:41:11 2008 UTC revision 1449 by astrand, Tue Mar 11 08:21:33 2008 UTC
# Line 89  is_toplevel(HWND hwnd) Line 89  is_toplevel(HWND hwnd)
89          return toplevel;          return toplevel;
90  }  }
91    
92    /* Returns true if a window is a menu window. */
93    static BOOL
94    is_menu(HWND hwnd)
95    {
96            HWND owner = GetWindow(hwnd, GW_OWNER);
97            LONG exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
98            return (exstyle & (WS_EX_TOOLWINDOW | WS_EX_TOPMOST)) && owner;
99    
100    }
101    
102  /* Determine the "parent" field for the CREATE response. */  /* Determine the "parent" field for the CREATE response. */
103  static HWND  static HWND
104  get_parent(HWND hwnd)  get_parent(HWND hwnd)
# Line 589  wndprocret_hook_proc(int code, WPARAM cu Line 599  wndprocret_hook_proc(int code, WPARAM cu
599    
600          if (msg == g_wm_seamless_focus)          if (msg == g_wm_seamless_focus)
601          {          {
602                  /* FIXME: SetForegroundWindow() kills menus. Need to find a                  /* For some reason, SetForegroundWindow() on menus
603                     clean way to solve this. */                     closes them. Ignore focus requests for menu windows. */
604                  if ((GetForegroundWindow() != hwnd) && !get_parent(hwnd))                  if ((GetForegroundWindow() != hwnd) && !is_menu(hwnd))
605                          SetForegroundWindow(hwnd);                          SetForegroundWindow(hwnd);
606    
607                  vchannel_write("ACK", "%u", g_blocked_focus_serial);                  vchannel_write("ACK", "%u", g_blocked_focus_serial);

Legend:
Removed from v.1448  
changed lines
  Added in v.1449

  ViewVC Help
Powered by ViewVC 1.1.26