changeset 301:887675ee5b67

More keypress fixes on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 27 Mar 2003 10:49:06 +0000
parents 4559a2fd2db2
children 7c1770e3fe08
files win/dw.c
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Thu Mar 27 10:43:58 2003 +0000
+++ b/win/dw.c	Thu Mar 27 10:49:06 2003 +0000
@@ -752,6 +752,20 @@
 	}
 }
 
+HWND _toplevel_window(HWND handle)
+{
+	HWND box, lastbox = GetParent(handle);
+
+	/* Find the toplevel window */
+	while((box = GetParent(lastbox)))
+	{
+		lastbox = box;
+	}
+	if(lastbox)
+		return lastbox;
+	return handle;
+}
+
 /* This function finds the current widget in the
  * layout and moves the current focus to the next item.
  */
@@ -1412,7 +1426,7 @@
 					{
 						int (*keypressfunc)(HWND, char, int, int, void *) = tmp->signalfunction;
 
-						if(hWnd == tmp->window)
+						if(hWnd == tmp->window || _toplevel_window(hWnd) == tmp->window)
 						{
 							int special = 0;
 							char ch = 0;