Changes to help support focus and window embeding in parent

This commit is contained in:
Roger Hughston 2007-04-20 07:49:58 +00:00
parent 80d18524aa
commit 6b968ee0ee
2 changed files with 34 additions and 3 deletions

View File

@ -1852,8 +1852,6 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
// on may be lost.
_lost_keypresses = true;
}
properties.set_foreground(false);
system_changed_properties(properties);
break;
case WM_SETFOCUS:
@ -1881,9 +1879,30 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
windisplay_cat.debug()
<< "setfocus\n";
}
if (_lost_keypresses) {
resend_lost_keypresses();
}
break;
case PM_ACTIVE:
if (windisplay_cat.is_debug()) {
windisplay_cat.debug()
<< "PM_ACTIVE\n";
}
properties.set_foreground(true);
system_changed_properties(properties);
break;
case PM_INACTIVE:
if (windisplay_cat.is_debug()) {
windisplay_cat.debug()
<< "PM_INACTIVE\n";
}
properties.set_foreground(false);
system_changed_properties(properties);
break;
}
return DefWindowProc(hwnd, msg, wparam, lparam);
@ -1976,7 +1995,15 @@ resend_lost_keypresses() {
<< "key has gone down: " << i << " (" << lookup_key(i) << ")\n";
}
handle_keyresume(lookup_key(i), message_time);
// Roger
//handle_keyresume(lookup_key(i), message_time);
// resume does not seem to work and sending the pointer position seems to
// weird ot some cursor controls
ButtonHandle key = lookup_key(i);
if (key != ButtonHandle::none())
_input_devices[0].button_down(key, message_time);
} else {
// The key is now released.
if (windisplay_cat.is_debug()) {

View File

@ -26,6 +26,10 @@
class WinGraphicsPipe;
#define PM_ACTIVE (WM_APP+123)
#define PM_INACTIVE (WM_APP+124)
////////////////////////////////////////////////////////////////////
// Class : WinGraphicsWindow
// Description : An abstract base class for glGraphicsWindow and