# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1048762146 0 # Node ID 887675ee5b67cd135f95c4c4e6b17e3c5723e977 # Parent 4559a2fd2db226e863a8a6591a593e8e0c1906e6 More keypress fixes on Windows. diff -r 4559a2fd2db2 -r 887675ee5b67 win/dw.c --- 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;